| 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 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 // Construct a MediaPlayerBridge object. This object needs to call |manager|'s | 39 // Construct a MediaPlayerBridge object. This object needs to call |manager|'s |
| 40 // RequestMediaResources() before decoding the media stream. This allows | 40 // RequestMediaResources() before decoding the media stream. This allows |
| 41 // |manager| to track unused resources and free them when needed. On the other | 41 // |manager| to track unused resources and free them when needed. On the other |
| 42 // hand, it needs to call ReleaseMediaResources() when it is done with | 42 // hand, it needs to call ReleaseMediaResources() when it is done with |
| 43 // decoding. MediaPlayerBridge also forwards Android MediaPlayer callbacks to | 43 // decoding. MediaPlayerBridge also forwards Android MediaPlayer callbacks to |
| 44 // the |manager| when needed. | 44 // the |manager| when needed. |
| 45 MediaPlayerBridge(int player_id, | 45 MediaPlayerBridge(int player_id, |
| 46 const GURL& url, | 46 const GURL& url, |
| 47 const GURL& first_party_for_cookies, | 47 const GURL& first_party_for_cookies, |
| 48 const std::string& user_agent, |
| 48 bool hide_url_log, | 49 bool hide_url_log, |
| 49 MediaPlayerManager* manager); | 50 MediaPlayerManager* manager); |
| 50 virtual ~MediaPlayerBridge(); | 51 virtual ~MediaPlayerBridge(); |
| 51 | 52 |
| 52 // Initialize this object and extract the metadata from the media. | 53 // Initialize this object and extract the metadata from the media. |
| 53 virtual void Initialize(); | 54 virtual void Initialize(); |
| 54 | 55 |
| 55 // MediaPlayerAndroid implementation. | 56 // MediaPlayerAndroid implementation. |
| 56 virtual void SetVideoSurface(gfx::ScopedJavaSurface surface) OVERRIDE; | 57 virtual void SetVideoSurface(gfx::ScopedJavaSurface surface) OVERRIDE; |
| 57 virtual void Start() OVERRIDE; | 58 virtual void Start() OVERRIDE; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 | 134 |
| 134 // Pending seek time while player is preparing. | 135 // Pending seek time while player is preparing. |
| 135 base::TimeDelta pending_seek_; | 136 base::TimeDelta pending_seek_; |
| 136 | 137 |
| 137 // Url for playback. | 138 // Url for playback. |
| 138 GURL url_; | 139 GURL url_; |
| 139 | 140 |
| 140 // First party url for cookies. | 141 // First party url for cookies. |
| 141 GURL first_party_for_cookies_; | 142 GURL first_party_for_cookies_; |
| 142 | 143 |
| 144 // User agent string to be used for media player. |
| 145 const std::string& user_agent_; |
| 146 |
| 143 // Hide url log from media player. | 147 // Hide url log from media player. |
| 144 bool hide_url_log_; | 148 bool hide_url_log_; |
| 145 | 149 |
| 146 // Stats about the media. | 150 // Stats about the media. |
| 147 base::TimeDelta duration_; | 151 base::TimeDelta duration_; |
| 148 int width_; | 152 int width_; |
| 149 int height_; | 153 int height_; |
| 150 | 154 |
| 151 // Meta data about actions can be taken. | 155 // Meta data about actions can be taken. |
| 152 bool can_pause_; | 156 bool can_pause_; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 167 // Listener object that listens to all the media player events. | 171 // Listener object that listens to all the media player events. |
| 168 MediaPlayerListener listener_; | 172 MediaPlayerListener listener_; |
| 169 | 173 |
| 170 friend class MediaPlayerListener; | 174 friend class MediaPlayerListener; |
| 171 DISALLOW_COPY_AND_ASSIGN(MediaPlayerBridge); | 175 DISALLOW_COPY_AND_ASSIGN(MediaPlayerBridge); |
| 172 }; | 176 }; |
| 173 | 177 |
| 174 } // namespace media | 178 } // namespace media |
| 175 | 179 |
| 176 #endif // MEDIA_BASE_ANDROID_MEDIA_PLAYER_BRIDGE_H_ | 180 #endif // MEDIA_BASE_ANDROID_MEDIA_PLAYER_BRIDGE_H_ |
| OLD | NEW |