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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 virtual int GetVideoHeight() override; | 67 virtual int GetVideoHeight() override; |
68 virtual base::TimeDelta GetCurrentTime() override; | 68 virtual base::TimeDelta GetCurrentTime() override; |
69 virtual base::TimeDelta GetDuration() override; | 69 virtual base::TimeDelta GetDuration() override; |
70 virtual bool IsPlaying() override; | 70 virtual bool IsPlaying() override; |
71 virtual bool CanPause() override; | 71 virtual bool CanPause() override; |
72 virtual bool CanSeekForward() override; | 72 virtual bool CanSeekForward() override; |
73 virtual bool CanSeekBackward() override; | 73 virtual bool CanSeekBackward() override; |
74 virtual bool IsPlayerReady() override; | 74 virtual bool IsPlayerReady() override; |
75 virtual GURL GetUrl() override; | 75 virtual GURL GetUrl() override; |
76 virtual GURL GetFirstPartyForCookies() override; | 76 virtual GURL GetFirstPartyForCookies() override; |
77 virtual bool IsSurfaceInUse() const override; | |
78 | 77 |
79 // MediaPlayerListener callbacks. | 78 // MediaPlayerListener callbacks. |
80 void OnVideoSizeChanged(int width, int height); | 79 void OnVideoSizeChanged(int width, int height); |
81 void OnMediaError(int error_type); | 80 void OnMediaError(int error_type); |
82 void OnBufferingUpdate(int percent); | 81 void OnBufferingUpdate(int percent); |
83 void OnPlaybackComplete(); | 82 void OnPlaybackComplete(); |
84 void OnMediaInterrupted(); | 83 void OnMediaInterrupted(); |
85 void OnSeekComplete(); | 84 void OnSeekComplete(); |
86 void OnDidSetDataUriDataSource(JNIEnv* env, jobject obj, jboolean success); | 85 void OnDidSetDataUriDataSource(JNIEnv* env, jobject obj, jboolean success); |
87 | 86 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 std::string cookies_; | 176 std::string cookies_; |
178 | 177 |
179 // Java MediaPlayerBridge instance. | 178 // Java MediaPlayerBridge instance. |
180 base::android::ScopedJavaGlobalRef<jobject> j_media_player_bridge_; | 179 base::android::ScopedJavaGlobalRef<jobject> j_media_player_bridge_; |
181 | 180 |
182 base::RepeatingTimer<MediaPlayerBridge> time_update_timer_; | 181 base::RepeatingTimer<MediaPlayerBridge> time_update_timer_; |
183 | 182 |
184 // Listener object that listens to all the media player events. | 183 // Listener object that listens to all the media player events. |
185 scoped_ptr<MediaPlayerListener> listener_; | 184 scoped_ptr<MediaPlayerListener> listener_; |
186 | 185 |
187 // Whether player is currently using a surface. | |
188 bool is_surface_in_use_; | |
189 | |
190 // Volume of playback. | 186 // Volume of playback. |
191 double volume_; | 187 double volume_; |
192 | 188 |
193 // Whether user credentials are allowed to be passed. | 189 // Whether user credentials are allowed to be passed. |
194 bool allow_credentials_; | 190 bool allow_credentials_; |
195 | 191 |
196 // Weak pointer passed to |listener_| for callbacks. | 192 // Weak pointer passed to |listener_| for callbacks. |
197 // NOTE: Weak pointers must be invalidated before all other member variables. | 193 // NOTE: Weak pointers must be invalidated before all other member variables. |
198 base::WeakPtrFactory<MediaPlayerBridge> weak_factory_; | 194 base::WeakPtrFactory<MediaPlayerBridge> weak_factory_; |
199 | 195 |
200 DISALLOW_COPY_AND_ASSIGN(MediaPlayerBridge); | 196 DISALLOW_COPY_AND_ASSIGN(MediaPlayerBridge); |
201 }; | 197 }; |
202 | 198 |
203 } // namespace media | 199 } // namespace media |
204 | 200 |
205 #endif // MEDIA_BASE_ANDROID_MEDIA_PLAYER_BRIDGE_H_ | 201 #endif // MEDIA_BASE_ANDROID_MEDIA_PLAYER_BRIDGE_H_ |
OLD | NEW |