Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_ANDROID_H_ | 5 #ifndef MEDIA_BASE_ANDROID_MEDIA_PLAYER_ANDROID_H_ |
| 6 #define MEDIA_BASE_ANDROID_MEDIA_PLAYER_ANDROID_H_ | 6 #define MEDIA_BASE_ANDROID_MEDIA_PLAYER_ANDROID_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 29 virtual ~MediaPlayerAndroid(); | 29 virtual ~MediaPlayerAndroid(); |
| 30 | 30 |
| 31 // Error types for MediaErrorCB. | 31 // Error types for MediaErrorCB. |
| 32 enum MediaErrorType { | 32 enum MediaErrorType { |
| 33 MEDIA_ERROR_FORMAT, | 33 MEDIA_ERROR_FORMAT, |
| 34 MEDIA_ERROR_DECODE, | 34 MEDIA_ERROR_DECODE, |
| 35 MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK, | 35 MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK, |
| 36 MEDIA_ERROR_INVALID_CODE, | 36 MEDIA_ERROR_INVALID_CODE, |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 // Types of media source that this object will play. | |
| 40 enum MediaSourceType { | |
|
acolwell GONE FROM CHROMIUM
2013/05/14 18:17:47
nit: s/MediaSourceType/SourceType and s/MEDIA_SOUR
wonsik
2013/05/20 14:02:24
Done.
| |
| 41 MEDIA_SOURCE_URL, | |
| 42 MEDIA_SOURCE_MSE, // W3C Media Source Extensions | |
| 43 MEDIA_SOURCE_STREAM, // W3C Media Stream, e.g. getUserMedia(). | |
| 44 }; | |
| 45 | |
| 39 // Callback when error happens. Args: player ID, error type. | 46 // Callback when error happens. Args: player ID, error type. |
| 40 typedef base::Callback<void(int, int)> MediaErrorCB; | 47 typedef base::Callback<void(int, int)> MediaErrorCB; |
| 41 | 48 |
| 42 // Callback when video size has changed. Args: player ID, width, height. | 49 // Callback when video size has changed. Args: player ID, width, height. |
| 43 typedef base::Callback<void(int, int, int)> VideoSizeChangedCB; | 50 typedef base::Callback<void(int, int, int)> VideoSizeChangedCB; |
| 44 | 51 |
| 45 // Callback when buffering has changed. Args: player ID, percentage | 52 // Callback when buffering has changed. Args: player ID, percentage |
| 46 // of the media. | 53 // of the media. |
| 47 typedef base::Callback<void(int, int)> BufferingUpdateCB; | 54 typedef base::Callback<void(int, int)> BufferingUpdateCB; |
| 48 | 55 |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 71 #endif | 78 #endif |
| 72 | 79 |
| 73 // Construct a MediaPlayerAndroid object with all the needed media player | 80 // Construct a MediaPlayerAndroid object with all the needed media player |
| 74 // callbacks. This object needs to call |manager_|'s RequestMediaResources() | 81 // callbacks. This object needs to call |manager_|'s RequestMediaResources() |
| 75 // before decoding the media stream. This allows |manager_| to track | 82 // before decoding the media stream. This allows |manager_| to track |
| 76 // unused resources and free them when needed. On the other hand, it needs | 83 // unused resources and free them when needed. On the other hand, it needs |
| 77 // to call ReleaseMediaResources() when it is done with decoding. | 84 // to call ReleaseMediaResources() when it is done with decoding. |
| 78 static MediaPlayerAndroid* Create( | 85 static MediaPlayerAndroid* Create( |
| 79 int player_id, | 86 int player_id, |
| 80 const GURL& url, | 87 const GURL& url, |
| 81 bool is_media_source, | 88 MediaSourceType media_source_type, |
| 82 const GURL& first_party_for_cookies, | 89 const GURL& first_party_for_cookies, |
| 83 bool hide_url_log, | 90 bool hide_url_log, |
| 84 MediaPlayerManager* manager, | 91 MediaPlayerManager* manager, |
| 85 #if defined(GOOGLE_TV) | 92 #if defined(GOOGLE_TV) |
| 86 const ReadFromDemuxerCB read_from_demuxer_cb, | 93 const ReadFromDemuxerCB read_from_demuxer_cb, |
| 87 #endif | 94 #endif |
| 88 const MediaErrorCB& media_error_cb, | 95 const MediaErrorCB& media_error_cb, |
| 89 const VideoSizeChangedCB& video_size_changed_cb, | 96 const VideoSizeChangedCB& video_size_changed_cb, |
| 90 const BufferingUpdateCB& buffering_update_cb, | 97 const BufferingUpdateCB& buffering_update_cb, |
| 91 const MediaMetadataChangedCB& media_metadata_changed_cb, | 98 const MediaMetadataChangedCB& media_metadata_changed_cb, |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 181 SeekCompleteCB seek_complete_cb_; | 188 SeekCompleteCB seek_complete_cb_; |
| 182 MediaInterruptedCB media_interrupted_cb_; | 189 MediaInterruptedCB media_interrupted_cb_; |
| 183 TimeUpdateCB time_update_cb_; | 190 TimeUpdateCB time_update_cb_; |
| 184 | 191 |
| 185 DISALLOW_COPY_AND_ASSIGN(MediaPlayerAndroid); | 192 DISALLOW_COPY_AND_ASSIGN(MediaPlayerAndroid); |
| 186 }; | 193 }; |
| 187 | 194 |
| 188 } // namespace media | 195 } // namespace media |
| 189 | 196 |
| 190 #endif // MEDIA_BASE_ANDROID_MEDIA_PLAYER_ANDROID_H_ | 197 #endif // MEDIA_BASE_ANDROID_MEDIA_PLAYER_ANDROID_H_ |
| OLD | NEW |