OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MEDIA_BASE_ANDROID_MEDIA_PLAYER_BRIDGE_H_ | 5 #ifndef MEDIA_BASE_ANDROID_MEDIA_PLAYER_BRIDGE_H_ |
6 #define MEDIA_BASE_ANDROID_MEDIA_PLAYER_BRIDGE_H_ | 6 #define MEDIA_BASE_ANDROID_MEDIA_PLAYER_BRIDGE_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 26 matching lines...) Expand all Loading... | |
37 class MEDIA_EXPORT MediaPlayerBridge { | 37 class MEDIA_EXPORT MediaPlayerBridge { |
38 public: | 38 public: |
39 // Error types for MediaErrorCB. | 39 // Error types for MediaErrorCB. |
40 enum MediaErrorType { | 40 enum MediaErrorType { |
41 MEDIA_ERROR_FORMAT, | 41 MEDIA_ERROR_FORMAT, |
42 MEDIA_ERROR_DECODE, | 42 MEDIA_ERROR_DECODE, |
43 MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK, | 43 MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK, |
44 MEDIA_ERROR_INVALID_CODE, | 44 MEDIA_ERROR_INVALID_CODE, |
45 }; | 45 }; |
46 | 46 |
47 // Types of media that this object will play. | |
Ami GONE FROM CHROMIUM
2013/05/01 22:01:37
Wow, I *seriously* did not understand what you wer
wonsik
2013/05/02 15:22:00
My bad -- I confused implementation details with t
| |
48 enum MediaType { | |
49 // Plain media from URL. | |
50 MEDIA_TYPE_DEFAULT, | |
51 // Media from W3C Media Source Extensions | |
52 MEDIA_TYPE_MEDIA_SOURCE_EXTENSIONS, | |
53 // Media from W3C Media Streams. | |
54 MEDIA_TYPE_MEDIA_STREAMS, | |
55 }; | |
56 | |
47 // Callback when error happens. Args: player ID, error type. | 57 // Callback when error happens. Args: player ID, error type. |
48 typedef base::Callback<void(int, int)> MediaErrorCB; | 58 typedef base::Callback<void(int, int)> MediaErrorCB; |
49 | 59 |
50 // Callback when video size has changed. Args: player ID, width, height. | 60 // Callback when video size has changed. Args: player ID, width, height. |
51 typedef base::Callback<void(int, int, int)> VideoSizeChangedCB; | 61 typedef base::Callback<void(int, int, int)> VideoSizeChangedCB; |
52 | 62 |
53 // Callback when buffering has changed. Args: player ID, percentage | 63 // Callback when buffering has changed. Args: player ID, percentage |
54 // of the media. | 64 // of the media. |
55 typedef base::Callback<void(int, int)> BufferingUpdateCB; | 65 typedef base::Callback<void(int, int)> BufferingUpdateCB; |
56 | 66 |
(...skipping 18 matching lines...) Expand all Loading... | |
75 // Callback when DemuxerStreamPlayer wants to read data from the demuxer. | 85 // Callback when DemuxerStreamPlayer wants to read data from the demuxer. |
76 typedef base::Callback<void(int, DemuxerStream::Type, bool)> | 86 typedef base::Callback<void(int, DemuxerStream::Type, bool)> |
77 ReadFromDemuxerCB; | 87 ReadFromDemuxerCB; |
78 #endif | 88 #endif |
79 | 89 |
80 static bool RegisterMediaPlayerBridge(JNIEnv* env); | 90 static bool RegisterMediaPlayerBridge(JNIEnv* env); |
81 | 91 |
82 static MediaPlayerBridge* Create( | 92 static MediaPlayerBridge* Create( |
83 int player_id, | 93 int player_id, |
84 const GURL& url, | 94 const GURL& url, |
85 bool is_media_source, | 95 MediaType media_type, |
86 const GURL& first_party_for_cookies, | 96 const GURL& first_party_for_cookies, |
87 MediaResourceGetter* resource_getter, | 97 MediaResourceGetter* resource_getter, |
88 bool hide_url_log, | 98 bool hide_url_log, |
89 MediaPlayerBridgeManager* manager, | 99 MediaPlayerBridgeManager* manager, |
90 #if defined(GOOGLE_TV) | 100 #if defined(GOOGLE_TV) |
91 const ReadFromDemuxerCB read_from_demuxer_cb, | 101 const ReadFromDemuxerCB read_from_demuxer_cb, |
92 #endif | 102 #endif |
93 const MediaErrorCB& media_error_cb, | 103 const MediaErrorCB& media_error_cb, |
94 const VideoSizeChangedCB& video_size_changed_cb, | 104 const VideoSizeChangedCB& video_size_changed_cb, |
95 const BufferingUpdateCB& buffering_update_cb, | 105 const BufferingUpdateCB& buffering_update_cb, |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
279 | 289 |
280 // Listener object that listens to all the media player events. | 290 // Listener object that listens to all the media player events. |
281 MediaPlayerListener listener_; | 291 MediaPlayerListener listener_; |
282 | 292 |
283 DISALLOW_COPY_AND_ASSIGN(MediaPlayerBridge); | 293 DISALLOW_COPY_AND_ASSIGN(MediaPlayerBridge); |
284 }; | 294 }; |
285 | 295 |
286 } // namespace media | 296 } // namespace media |
287 | 297 |
288 #endif // MEDIA_BASE_ANDROID_MEDIA_PLAYER_BRIDGE_H_ | 298 #endif // MEDIA_BASE_ANDROID_MEDIA_PLAYER_BRIDGE_H_ |
OLD | NEW |