| 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 <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 const OnDecoderResourcesReleasedCB& on_decoder_resources_released_cb, | 53 const OnDecoderResourcesReleasedCB& on_decoder_resources_released_cb, |
| 54 const GURL& frame_url, | 54 const GURL& frame_url, |
| 55 bool allow_credentials, | 55 bool allow_credentials, |
| 56 int media_session_id); | 56 int media_session_id); |
| 57 ~MediaPlayerBridge() override; | 57 ~MediaPlayerBridge() override; |
| 58 | 58 |
| 59 // Initialize this object and extract the metadata from the media. | 59 // Initialize this object and extract the metadata from the media. |
| 60 virtual void Initialize(); | 60 virtual void Initialize(); |
| 61 | 61 |
| 62 // MediaPlayerAndroid implementation. | 62 // MediaPlayerAndroid implementation. |
| 63 void SetVideoSurface(gfx::ScopedJavaSurface surface) override; | 63 void SetVideoSurface(gl::ScopedJavaSurface surface) override; |
| 64 void Start() override; | 64 void Start() override; |
| 65 void Pause(bool is_media_related_action) override; | 65 void Pause(bool is_media_related_action) override; |
| 66 void SeekTo(base::TimeDelta timestamp) override; | 66 void SeekTo(base::TimeDelta timestamp) override; |
| 67 void Release() override; | 67 void Release() override; |
| 68 bool HasVideo() const override; | 68 bool HasVideo() const override; |
| 69 bool HasAudio() const override; | 69 bool HasAudio() const override; |
| 70 int GetVideoWidth() override; | 70 int GetVideoWidth() override; |
| 71 int GetVideoHeight() override; | 71 int GetVideoHeight() override; |
| 72 base::TimeDelta GetCurrentTime() override; | 72 base::TimeDelta GetCurrentTime() override; |
| 73 base::TimeDelta GetDuration() override; | 73 base::TimeDelta GetDuration() override; |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 | 182 |
| 183 // Meta data about actions can be taken. | 183 // Meta data about actions can be taken. |
| 184 bool can_pause_; | 184 bool can_pause_; |
| 185 bool can_seek_forward_; | 185 bool can_seek_forward_; |
| 186 bool can_seek_backward_; | 186 bool can_seek_backward_; |
| 187 | 187 |
| 188 // Cookies for |url_|. | 188 // Cookies for |url_|. |
| 189 std::string cookies_; | 189 std::string cookies_; |
| 190 | 190 |
| 191 // The surface object currently owned by the player. | 191 // The surface object currently owned by the player. |
| 192 gfx::ScopedJavaSurface surface_; | 192 gl::ScopedJavaSurface surface_; |
| 193 | 193 |
| 194 // Java MediaPlayerBridge instance. | 194 // Java MediaPlayerBridge instance. |
| 195 base::android::ScopedJavaGlobalRef<jobject> j_media_player_bridge_; | 195 base::android::ScopedJavaGlobalRef<jobject> j_media_player_bridge_; |
| 196 | 196 |
| 197 base::RepeatingTimer time_update_timer_; | 197 base::RepeatingTimer time_update_timer_; |
| 198 | 198 |
| 199 base::TimeDelta last_time_update_timestamp_; | 199 base::TimeDelta last_time_update_timestamp_; |
| 200 | 200 |
| 201 // Whether user credentials are allowed to be passed. | 201 // Whether user credentials are allowed to be passed. |
| 202 bool allow_credentials_; | 202 bool allow_credentials_; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 216 | 216 |
| 217 // NOTE: Weak pointers must be invalidated before all other member variables. | 217 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 218 base::WeakPtrFactory<MediaPlayerBridge> weak_factory_; | 218 base::WeakPtrFactory<MediaPlayerBridge> weak_factory_; |
| 219 | 219 |
| 220 DISALLOW_COPY_AND_ASSIGN(MediaPlayerBridge); | 220 DISALLOW_COPY_AND_ASSIGN(MediaPlayerBridge); |
| 221 }; | 221 }; |
| 222 | 222 |
| 223 } // namespace media | 223 } // namespace media |
| 224 | 224 |
| 225 #endif // MEDIA_BASE_ANDROID_MEDIA_PLAYER_BRIDGE_H_ | 225 #endif // MEDIA_BASE_ANDROID_MEDIA_PLAYER_BRIDGE_H_ |
| OLD | NEW |