Chromium Code Reviews| 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_SOURCE_PLAYER_H_ | 5 #ifndef MEDIA_BASE_ANDROID_MEDIA_SOURCE_PLAYER_H_ |
| 6 #define MEDIA_BASE_ANDROID_MEDIA_SOURCE_PLAYER_H_ | 6 #define MEDIA_BASE_ANDROID_MEDIA_SOURCE_PLAYER_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 147 // Helper function to determine whether a protected surface is needed for | 147 // Helper function to determine whether a protected surface is needed for |
| 148 // video playback. | 148 // video playback. |
| 149 bool IsProtectedSurfaceRequired(); | 149 bool IsProtectedSurfaceRequired(); |
| 150 | 150 |
| 151 // Called when a MediaDecoderJob finishes prefetching data. Once all | 151 // Called when a MediaDecoderJob finishes prefetching data. Once all |
| 152 // MediaDecoderJobs have prefetched data, then this method updates | 152 // MediaDecoderJobs have prefetched data, then this method updates |
| 153 // |start_time_ticks_| and |start_presentation_timestamp_| so that video can | 153 // |start_time_ticks_| and |start_presentation_timestamp_| so that video can |
| 154 // resync with audio and starts decoding. | 154 // resync with audio and starts decoding. |
| 155 void OnPrefetchDone(); | 155 void OnPrefetchDone(); |
| 156 | 156 |
| 157 // Test-only method to setup hook for the completion of the next decode cycle. | |
|
acolwell GONE FROM CHROMIUM
2013/10/31 17:54:00
nit: You should add that this callback state is cl
wolenetz
2013/11/01 20:45:28
Done.
| |
| 158 void set_decode_callback_for_testing(const base::Closure& test_decode_cb) { | |
| 159 decode_callback_for_testing_ = test_decode_cb; | |
| 160 } | |
| 161 | |
| 162 // TODO(qinmin/wolenetz): Reorder these based on their priority from | |
| 163 // ProcessPendingEvents(). Release() and other routines are dependent upon | |
| 164 // priority consistency. | |
| 157 enum PendingEventFlags { | 165 enum PendingEventFlags { |
| 158 NO_EVENT_PENDING = 0, | 166 NO_EVENT_PENDING = 0, |
| 159 SEEK_EVENT_PENDING = 1 << 0, | 167 SEEK_EVENT_PENDING = 1 << 0, |
| 160 SURFACE_CHANGE_EVENT_PENDING = 1 << 1, | 168 SURFACE_CHANGE_EVENT_PENDING = 1 << 1, |
| 161 CONFIG_CHANGE_EVENT_PENDING = 1 << 2, | 169 CONFIG_CHANGE_EVENT_PENDING = 1 << 2, |
| 162 PREFETCH_REQUEST_EVENT_PENDING = 1 << 3, | 170 PREFETCH_REQUEST_EVENT_PENDING = 1 << 3, |
| 163 PREFETCH_DONE_EVENT_PENDING = 1 << 4, | 171 PREFETCH_DONE_EVENT_PENDING = 1 << 4, |
| 164 }; | 172 }; |
| 165 | 173 |
| 166 static const char* GetEventName(PendingEventFlags event); | 174 static const char* GetEventName(PendingEventFlags event); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 250 // Weak pointer passed to media decoder jobs for callbacks. | 258 // Weak pointer passed to media decoder jobs for callbacks. |
| 251 base::WeakPtrFactory<MediaSourcePlayer> weak_this_; | 259 base::WeakPtrFactory<MediaSourcePlayer> weak_this_; |
| 252 | 260 |
| 253 MediaDrmBridge* drm_bridge_; | 261 MediaDrmBridge* drm_bridge_; |
| 254 | 262 |
| 255 // No decryption key available to decrypt the encrypted buffer. In this case, | 263 // No decryption key available to decrypt the encrypted buffer. In this case, |
| 256 // the player should pause. When a new key is added (OnKeyAdded()), we should | 264 // the player should pause. When a new key is added (OnKeyAdded()), we should |
| 257 // try to start playback again. | 265 // try to start playback again. |
| 258 bool is_waiting_for_key_; | 266 bool is_waiting_for_key_; |
| 259 | 267 |
| 268 // Test-only callback for hooking the completion of the next decode cycle. | |
| 269 base::Closure decode_callback_for_testing_; | |
| 270 | |
| 260 friend class MediaSourcePlayerTest; | 271 friend class MediaSourcePlayerTest; |
| 261 DISALLOW_COPY_AND_ASSIGN(MediaSourcePlayer); | 272 DISALLOW_COPY_AND_ASSIGN(MediaSourcePlayer); |
| 262 }; | 273 }; |
| 263 | 274 |
| 264 } // namespace media | 275 } // namespace media |
| 265 | 276 |
| 266 #endif // MEDIA_BASE_ANDROID_MEDIA_SOURCE_PLAYER_H_ | 277 #endif // MEDIA_BASE_ANDROID_MEDIA_SOURCE_PLAYER_H_ |
| OLD | NEW |