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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // Handle pending events when all the decoder jobs finished. | 100 // Handle pending events when all the decoder jobs finished. |
101 void ProcessPendingEvents(); | 101 void ProcessPendingEvents(); |
102 | 102 |
103 // Helper method to configure the decoder jobs. | 103 // Helper method to configure the decoder jobs. |
104 void ConfigureVideoDecoderJob(); | 104 void ConfigureVideoDecoderJob(); |
105 void ConfigureAudioDecoderJob(); | 105 void ConfigureAudioDecoderJob(); |
106 | 106 |
107 // Flush the decoders and clean up all the data needs to be decoded. | 107 // Flush the decoders and clean up all the data needs to be decoded. |
108 void ClearDecodingData(); | 108 void ClearDecodingData(); |
109 | 109 |
110 // Called to decoder more data. | 110 // Called to decode more data. |
111 void DecodeMoreAudio(); | 111 // If |*_change_already_pending| is true and |kConfigChanged| is detected |
112 void DecodeMoreVideo(); | 112 // during the call, then redundant setting of |CONFIG_CHANGE_EVENT_PENDING| |
| 113 // and call of ProcessPendingEvents() is skipped. This allows simultaneous |
| 114 // audio and video config change, such as may occur during OnPrefetchDone(). |
| 115 void DecodeMoreAudio(bool video_change_already_pending); |
| 116 void DecodeMoreVideo(bool audio_change_already_pending); |
113 | 117 |
114 // Functions check whether audio/video is present. | 118 // Functions check whether audio/video is present. |
115 bool HasVideo(); | 119 bool HasVideo(); |
116 bool HasAudio(); | 120 bool HasAudio(); |
117 | 121 |
118 // Determine seekability based on duration. | 122 // Determine seekability based on duration. |
119 bool Seekable(); | 123 bool Seekable(); |
120 | 124 |
121 // Called when the |decoder_starvation_callback_| times out. | 125 // Called when the |decoder_starvation_callback_| times out. |
122 void OnDecoderStarved(); | 126 void OnDecoderStarved(); |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 // try to start playback again. | 261 // try to start playback again. |
258 bool is_waiting_for_key_; | 262 bool is_waiting_for_key_; |
259 | 263 |
260 friend class MediaSourcePlayerTest; | 264 friend class MediaSourcePlayerTest; |
261 DISALLOW_COPY_AND_ASSIGN(MediaSourcePlayer); | 265 DISALLOW_COPY_AND_ASSIGN(MediaSourcePlayer); |
262 }; | 266 }; |
263 | 267 |
264 } // namespace media | 268 } // namespace media |
265 | 269 |
266 #endif // MEDIA_BASE_ANDROID_MEDIA_SOURCE_PLAYER_H_ | 270 #endif // MEDIA_BASE_ANDROID_MEDIA_SOURCE_PLAYER_H_ |
OLD | NEW |