OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_CODEC_PLAYER_H_ | 5 #ifndef MEDIA_BASE_ANDROID_MEDIA_CODEC_PLAYER_H_ |
6 #define MEDIA_BASE_ANDROID_MEDIA_CODEC_PLAYER_H_ | 6 #define MEDIA_BASE_ANDROID_MEDIA_CODEC_PLAYER_H_ |
7 | 7 |
8 #include "base/android/scoped_java_ref.h" | 8 #include "base/android/scoped_java_ref.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 void OnDemuxerDataAvailable(const DemuxerData& params) override; | 201 void OnDemuxerDataAvailable(const DemuxerData& params) override; |
202 void OnDemuxerSeekDone(base::TimeDelta actual_browser_seek_time) override; | 202 void OnDemuxerSeekDone(base::TimeDelta actual_browser_seek_time) override; |
203 void OnDemuxerDurationChanged(base::TimeDelta duration) override; | 203 void OnDemuxerDurationChanged(base::TimeDelta duration) override; |
204 | 204 |
205 // For testing only. | 205 // For testing only. |
206 void SetDecodersTimeCallbackForTests(DecodersTimeCallback cb); | 206 void SetDecodersTimeCallbackForTests(DecodersTimeCallback cb); |
207 void SetCodecCreatedCallbackForTests(CodecCreatedCallback cb); | 207 void SetCodecCreatedCallbackForTests(CodecCreatedCallback cb); |
208 void SetAlwaysReconfigureForTests(DemuxerStream::Type type); | 208 void SetAlwaysReconfigureForTests(DemuxerStream::Type type); |
209 bool IsPrerollingForTests(DemuxerStream::Type type) const; | 209 bool IsPrerollingForTests(DemuxerStream::Type type) const; |
210 | 210 |
| 211 // Turn on and off extra logging with elevated log level. |
| 212 void SetVerboseForTests(bool value); |
| 213 |
211 private: | 214 private: |
212 // The state machine states. | 215 // The state machine states. |
213 enum PlayerState { | 216 enum PlayerState { |
214 kStatePaused, | 217 kStatePaused, |
215 kStateWaitingForConfig, | 218 kStateWaitingForConfig, |
216 kStatePrefetching, | 219 kStatePrefetching, |
217 kStatePlaying, | 220 kStatePlaying, |
218 kStateStopping, | 221 kStateStopping, |
219 kStateWaitingForSurface, | 222 kStateWaitingForSurface, |
220 kStateWaitingForSeek, | 223 kStateWaitingForSeek, |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 base::WeakPtr<MediaCodecPlayer> media_weak_this_; | 361 base::WeakPtr<MediaCodecPlayer> media_weak_this_; |
359 // NOTE: Weak pointers must be invalidated before all other member variables. | 362 // NOTE: Weak pointers must be invalidated before all other member variables. |
360 base::WeakPtrFactory<MediaCodecPlayer> media_weak_factory_; | 363 base::WeakPtrFactory<MediaCodecPlayer> media_weak_factory_; |
361 | 364 |
362 DISALLOW_COPY_AND_ASSIGN(MediaCodecPlayer); | 365 DISALLOW_COPY_AND_ASSIGN(MediaCodecPlayer); |
363 }; | 366 }; |
364 | 367 |
365 } // namespace media | 368 } // namespace media |
366 | 369 |
367 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_PLAYER_H_ | 370 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_PLAYER_H_ |
OLD | NEW |