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 // Flags for creation | |
48 enum Flags { | |
49 FLAG_MEDIA_SOURCE = 1 << 0, | |
qinmin
2013/04/29 17:31:49
add a default flag here for non media source case.
wonsik
2013/05/01 14:15:38
Done.
| |
50 FLAG_LOW_LATENCY = 1 << 1, | |
Ami GONE FROM CHROMIUM
2013/04/29 22:11:09
Neither of these names is meaningful to me.
Does M
wonsik
2013/05/01 14:15:38
Improved names.
| |
51 }; | |
52 | |
47 // Callback when error happens. Args: player ID, error type. | 53 // Callback when error happens. Args: player ID, error type. |
48 typedef base::Callback<void(int, int)> MediaErrorCB; | 54 typedef base::Callback<void(int, int)> MediaErrorCB; |
49 | 55 |
50 // Callback when video size has changed. Args: player ID, width, height. | 56 // Callback when video size has changed. Args: player ID, width, height. |
51 typedef base::Callback<void(int, int, int)> VideoSizeChangedCB; | 57 typedef base::Callback<void(int, int, int)> VideoSizeChangedCB; |
52 | 58 |
53 // Callback when buffering has changed. Args: player ID, percentage | 59 // Callback when buffering has changed. Args: player ID, percentage |
54 // of the media. | 60 // of the media. |
55 typedef base::Callback<void(int, int)> BufferingUpdateCB; | 61 typedef base::Callback<void(int, int)> BufferingUpdateCB; |
56 | 62 |
(...skipping 18 matching lines...) Expand all Loading... | |
75 // Callback when DemuxerStreamPlayer wants to read data from the demuxer. | 81 // Callback when DemuxerStreamPlayer wants to read data from the demuxer. |
76 typedef base::Callback<void(int, DemuxerStream::Type, bool)> | 82 typedef base::Callback<void(int, DemuxerStream::Type, bool)> |
77 ReadFromDemuxerCB; | 83 ReadFromDemuxerCB; |
78 #endif | 84 #endif |
79 | 85 |
80 static bool RegisterMediaPlayerBridge(JNIEnv* env); | 86 static bool RegisterMediaPlayerBridge(JNIEnv* env); |
81 | 87 |
82 static MediaPlayerBridge* Create( | 88 static MediaPlayerBridge* Create( |
83 int player_id, | 89 int player_id, |
84 const GURL& url, | 90 const GURL& url, |
85 bool is_media_source, | 91 int flags, |
86 const GURL& first_party_for_cookies, | 92 const GURL& first_party_for_cookies, |
87 MediaResourceGetter* resource_getter, | 93 MediaResourceGetter* resource_getter, |
88 bool hide_url_log, | 94 bool hide_url_log, |
89 MediaPlayerBridgeManager* manager, | 95 MediaPlayerBridgeManager* manager, |
90 #if defined(GOOGLE_TV) | 96 #if defined(GOOGLE_TV) |
91 const ReadFromDemuxerCB read_from_demuxer_cb, | 97 const ReadFromDemuxerCB read_from_demuxer_cb, |
92 #endif | 98 #endif |
93 const MediaErrorCB& media_error_cb, | 99 const MediaErrorCB& media_error_cb, |
94 const VideoSizeChangedCB& video_size_changed_cb, | 100 const VideoSizeChangedCB& video_size_changed_cb, |
95 const BufferingUpdateCB& buffering_update_cb, | 101 const BufferingUpdateCB& buffering_update_cb, |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
279 | 285 |
280 // Listener object that listens to all the media player events. | 286 // Listener object that listens to all the media player events. |
281 MediaPlayerListener listener_; | 287 MediaPlayerListener listener_; |
282 | 288 |
283 DISALLOW_COPY_AND_ASSIGN(MediaPlayerBridge); | 289 DISALLOW_COPY_AND_ASSIGN(MediaPlayerBridge); |
284 }; | 290 }; |
285 | 291 |
286 } // namespace media | 292 } // namespace media |
287 | 293 |
288 #endif // MEDIA_BASE_ANDROID_MEDIA_PLAYER_BRIDGE_H_ | 294 #endif // MEDIA_BASE_ANDROID_MEDIA_PLAYER_BRIDGE_H_ |
OLD | NEW |