OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_LOOP_H_ | 5 #ifndef MEDIA_BASE_ANDROID_MEDIA_CODEC_LOOP_H_ |
6 #define MEDIA_BASE_ANDROID_MEDIA_CODEC_LOOP_H_ | 6 #define MEDIA_BASE_ANDROID_MEDIA_CODEC_LOOP_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/single_thread_task_runner.h" |
15 #include "base/time/tick_clock.h" | 16 #include "base/time/tick_clock.h" |
16 #include "base/time/time.h" | 17 #include "base/time/time.h" |
17 #include "base/timer/timer.h" | 18 #include "base/timer/timer.h" |
18 #include "media/base/android/media_codec_bridge.h" | 19 #include "media/base/android/media_codec_bridge.h" |
19 #include "media/base/decode_status.h" | 20 #include "media/base/decode_status.h" |
20 #include "media/base/encryption_scheme.h" | 21 #include "media/base/encryption_scheme.h" |
21 #include "media/base/media_export.h" | 22 #include "media/base/media_export.h" |
22 #include "media/base/subsample_entry.h" | 23 #include "media/base/subsample_entry.h" |
23 | 24 |
24 // MediaCodecLoop is based on Android's MediaCodec API. | 25 // MediaCodecLoop is based on Android's MediaCodec API. |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 // (OnKeyAdded) | 95 // (OnKeyAdded) |
95 // | | 96 // | |
96 // [Ready] | 97 // [Ready] |
97 // | 98 // |
98 // -[Any state]- | 99 // -[Any state]- |
99 // | | | 100 // | | |
100 // (Flush ok) (Flush fails) | 101 // (Flush ok) (Flush fails) |
101 // | | | 102 // | | |
102 // [Ready] [Error] | 103 // [Ready] [Error] |
103 | 104 |
104 namespace base { | |
105 class SingleThreadTaskRunner; | |
106 } | |
107 | |
108 namespace media { | 105 namespace media { |
109 | 106 |
110 class MEDIA_EXPORT MediaCodecLoop { | 107 class MEDIA_EXPORT MediaCodecLoop { |
111 public: | 108 public: |
112 // TODO(liberato): this exists in video_decoder.h and audio_decoder.h too. | 109 // TODO(liberato): this exists in video_decoder.h and audio_decoder.h too. |
113 using InitCB = base::Callback<void(bool success)>; | 110 using InitCB = base::Callback<void(bool success)>; |
114 using DecodeCB = base::Callback<void(DecodeStatus status)>; | 111 using DecodeCB = base::Callback<void(DecodeStatus status)>; |
115 | 112 |
116 // Data that the client wants to put into an input buffer. | 113 // Data that the client wants to put into an input buffer. |
117 struct InputData { | 114 struct InputData { |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 | 319 |
323 // NOTE: Weak pointers must be invalidated before all other member variables. | 320 // NOTE: Weak pointers must be invalidated before all other member variables. |
324 base::WeakPtrFactory<MediaCodecLoop> weak_factory_; | 321 base::WeakPtrFactory<MediaCodecLoop> weak_factory_; |
325 | 322 |
326 DISALLOW_COPY_AND_ASSIGN(MediaCodecLoop); | 323 DISALLOW_COPY_AND_ASSIGN(MediaCodecLoop); |
327 }; | 324 }; |
328 | 325 |
329 } // namespace media | 326 } // namespace media |
330 | 327 |
331 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_LOOP_H_ | 328 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_LOOP_H_ |
OLD | NEW |