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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 95 |
96 // Callback to notify that MediaCrypto is ready in |drm_bridge_|. | 96 // Callback to notify that MediaCrypto is ready in |drm_bridge_|. |
97 void OnMediaCryptoReady(); | 97 void OnMediaCryptoReady(); |
98 | 98 |
99 // Handle pending events if all the decoder jobs are not currently decoding. | 99 // Handle pending events if all the decoder jobs are not currently decoding. |
100 void ProcessPendingEvents(); | 100 void ProcessPendingEvents(); |
101 | 101 |
102 // Helper method to clear any pending |SURFACE_CHANGE_EVENT_PENDING| | 102 // Helper method to clear any pending |SURFACE_CHANGE_EVENT_PENDING| |
103 // and reset |video_decoder_job_| to null. | 103 // and reset |video_decoder_job_| to null. |
104 void ResetVideoDecoderJob(); | 104 void ResetVideoDecoderJob(); |
| 105 void ResetAudioDecoderJob(); |
105 | 106 |
106 // Helper methods to configure the decoder jobs. | 107 // Helper methods to configure the decoder jobs. |
107 void ConfigureVideoDecoderJob(); | 108 void ConfigureVideoDecoderJob(); |
108 void ConfigureAudioDecoderJob(); | 109 void ConfigureAudioDecoderJob(); |
109 | 110 |
110 // Flush the decoders and clean up all the data needs to be decoded. | 111 // Flush the decoders and clean up all the data needs to be decoded. |
111 void ClearDecodingData(); | 112 void ClearDecodingData(); |
112 | 113 |
113 // Called to decode more data. | 114 // Called to decode more data. |
114 void DecodeMoreAudio(); | 115 void DecodeMoreAudio(); |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 // the player should pause. When a new key is added (OnKeyAdded()), we should | 276 // the player should pause. When a new key is added (OnKeyAdded()), we should |
276 // try to start playback again. | 277 // try to start playback again. |
277 bool is_waiting_for_key_; | 278 bool is_waiting_for_key_; |
278 | 279 |
279 // Test-only callback for hooking the completion of the next decode cycle. | 280 // Test-only callback for hooking the completion of the next decode cycle. |
280 base::Closure decode_callback_for_testing_; | 281 base::Closure decode_callback_for_testing_; |
281 | 282 |
282 // Whether |surface_| is currently used by the player. | 283 // Whether |surface_| is currently used by the player. |
283 bool is_surface_in_use_; | 284 bool is_surface_in_use_; |
284 | 285 |
| 286 // Whether there are pending data requests by the decoder. |
| 287 bool has_pending_audio_data_request_; |
| 288 bool has_pending_video_data_request_; |
| 289 |
285 friend class MediaSourcePlayerTest; | 290 friend class MediaSourcePlayerTest; |
286 DISALLOW_COPY_AND_ASSIGN(MediaSourcePlayer); | 291 DISALLOW_COPY_AND_ASSIGN(MediaSourcePlayer); |
287 }; | 292 }; |
288 | 293 |
289 } // namespace media | 294 } // namespace media |
290 | 295 |
291 #endif // MEDIA_BASE_ANDROID_MEDIA_SOURCE_PLAYER_H_ | 296 #endif // MEDIA_BASE_ANDROID_MEDIA_SOURCE_PLAYER_H_ |
OLD | NEW |