| 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 SourceType { |
| 41 SOURCE_TYPE_URL, |
| 42 SOURCE_TYPE_MSE, // W3C Media Source Extensions |
| 43 SOURCE_TYPE_STREAM, // W3C Media Stream, e.g. getUserMedia(). |
| 44 }; |
| 45 |
| 39 // Construct a MediaPlayerAndroid object with all the needed media player | 46 // Construct a MediaPlayerAndroid object with all the needed media player |
| 40 // callbacks. This object needs to call |manager_|'s RequestMediaResources() | 47 // callbacks. This object needs to call |manager_|'s RequestMediaResources() |
| 41 // before decoding the media stream. This allows |manager_| to track | 48 // before decoding the media stream. This allows |manager_| to track |
| 42 // unused resources and free them when needed. On the other hand, it needs | 49 // unused resources and free them when needed. On the other hand, it needs |
| 43 // to call ReleaseMediaResources() when it is done with decoding. | 50 // to call ReleaseMediaResources() when it is done with decoding. |
| 44 static MediaPlayerAndroid* Create( | 51 static MediaPlayerAndroid* Create(int player_id, |
| 45 int player_id, | 52 const GURL& url, |
| 46 const GURL& url, | 53 SourceType source_type, |
| 47 bool is_media_source, | 54 const GURL& first_party_for_cookies, |
| 48 const GURL& first_party_for_cookies, | 55 bool hide_url_log, |
| 49 bool hide_url_log, | 56 MediaPlayerManager* manager); |
| 50 MediaPlayerManager* manager); | |
| 51 | 57 |
| 52 // Passing an external java surface object to the player. | 58 // Passing an external java surface object to the player. |
| 53 virtual void SetVideoSurface(jobject surface) = 0; | 59 virtual void SetVideoSurface(jobject surface) = 0; |
| 54 | 60 |
| 55 // Start playing the media. | 61 // Start playing the media. |
| 56 virtual void Start() = 0; | 62 virtual void Start() = 0; |
| 57 | 63 |
| 58 // Pause the media. | 64 // Pause the media. |
| 59 virtual void Pause() = 0; | 65 virtual void Pause() = 0; |
| 60 | 66 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 124 |
| 119 // Resource manager for all the media players. | 125 // Resource manager for all the media players. |
| 120 MediaPlayerManager* manager_; | 126 MediaPlayerManager* manager_; |
| 121 | 127 |
| 122 DISALLOW_COPY_AND_ASSIGN(MediaPlayerAndroid); | 128 DISALLOW_COPY_AND_ASSIGN(MediaPlayerAndroid); |
| 123 }; | 129 }; |
| 124 | 130 |
| 125 } // namespace media | 131 } // namespace media |
| 126 | 132 |
| 127 #endif // MEDIA_BASE_ANDROID_MEDIA_PLAYER_ANDROID_H_ | 133 #endif // MEDIA_BASE_ANDROID_MEDIA_PLAYER_ANDROID_H_ |
| OLD | NEW |