| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // Callbacks when seek completed. Args: player ID, current time. | 55 // Callbacks when seek completed. Args: player ID, current time. |
| 56 typedef base::Callback<void(int, base::TimeDelta)> SeekCompleteCB; | 56 typedef base::Callback<void(int, base::TimeDelta)> SeekCompleteCB; |
| 57 | 57 |
| 58 // Callbacks when playback completed. Args: player ID. | 58 // Callbacks when playback completed. Args: player ID. |
| 59 typedef base::Callback<void(int)> PlaybackCompleteCB; | 59 typedef base::Callback<void(int)> PlaybackCompleteCB; |
| 60 | 60 |
| 61 // Callback when time update messages need to be sent. Args: player ID, | 61 // Callback when time update messages need to be sent. Args: player ID, |
| 62 // current time. | 62 // current time. |
| 63 typedef base::Callback<void(int, base::TimeDelta)> TimeUpdateCB; | 63 typedef base::Callback<void(int, base::TimeDelta)> TimeUpdateCB; |
| 64 | 64 |
| 65 static bool RegisterMediaPlayerBridge(JNIEnv* env); |
| 66 |
| 65 // Construct a MediaPlayerBridge object with all the needed media player | 67 // Construct a MediaPlayerBridge object with all the needed media player |
| 66 // callbacks. This object needs to call |manager|'s RequestMediaResources() | 68 // callbacks. This object needs to call |manager|'s RequestMediaResources() |
| 67 // before decoding the media stream. This allows |manager| to track | 69 // before decoding the media stream. This allows |manager| to track |
| 68 // unused resources and free them when needed. On the other hand, it needs | 70 // unused resources and free them when needed. On the other hand, it needs |
| 69 // to call ReleaseMediaResources() when it is done with decoding. | 71 // to call ReleaseMediaResources() when it is done with decoding. |
| 70 MediaPlayerBridge(int player_id, | 72 MediaPlayerBridge(int player_id, |
| 71 const std::string& url, | 73 const std::string& url, |
| 72 const std::string& first_party_for_cookies, | 74 const std::string& first_party_for_cookies, |
| 73 CookieGetter* cookies_getter, | 75 CookieGetter* cookies_getter, |
| 74 bool hide_url_log, | 76 bool hide_url_log, |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 | 218 |
| 217 // Listener object that listens to all the media player events. | 219 // Listener object that listens to all the media player events. |
| 218 MediaPlayerListener listener_; | 220 MediaPlayerListener listener_; |
| 219 | 221 |
| 220 DISALLOW_COPY_AND_ASSIGN(MediaPlayerBridge); | 222 DISALLOW_COPY_AND_ASSIGN(MediaPlayerBridge); |
| 221 }; | 223 }; |
| 222 | 224 |
| 223 } // namespace media | 225 } // namespace media |
| 224 | 226 |
| 225 #endif // MEDIA_BASE_ANDROID_MEDIA_PLAYER_BRIDGE_H_ | 227 #endif // MEDIA_BASE_ANDROID_MEDIA_PLAYER_BRIDGE_H_ |
| OLD | NEW |