OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef MEDIA_BASE_ANDROID_ACCESS_UNIT_QUEUE_H_ | |
6 #define MEDIA_BASE_ANDROID_ACCESS_UNIT_QUEUE_H_ | |
7 | |
8 #include <deque> | |
9 | |
10 #include "base/macros.h" | |
11 #include "base/synchronization/lock.h" | |
12 #include "media/base/android/demuxer_stream_player_params.h" | |
13 | |
14 namespace media { | |
15 | |
16 class AccessUnitQueue { | |
qinmin
2015/05/14 19:52:57
class description
Tima Vaisburd
2015/05/15 00:12:39
Done.
| |
17 public: | |
18 struct Info { | |
19 const AccessUnit* front_unit; | |
20 const DemuxerConfigs* configs; | |
21 int length; | |
22 bool has_eos; | |
23 | |
24 Info() | |
25 : front_unit(nullptr), configs(nullptr), length(0), has_eos(false) {} | |
26 }; | |
27 | |
28 AccessUnitQueue(); | |
29 virtual ~AccessUnitQueue(); | |
30 | |
31 void PushBack(const DemuxerData& frames); | |
32 void PopFront(); | |
33 void Flush(); | |
34 | |
35 // Looks for the first key frame and if it exists, | |
36 // removes prior frames and returns true. If it does not | |
37 // exist returns false. | |
38 bool SkipToKeyFrame(); | |
39 | |
40 void GetInfo(Info* info) const; | |
41 | |
42 bool HasEOS() const; | |
43 int Length() const; | |
44 | |
45 private: | |
46 std::deque<AccessUnit> access_units_; | |
47 std::deque<DemuxerConfigs> demuxer_configs_; | |
48 bool has_eos_; | |
49 | |
50 mutable base::Lock lock_; | |
51 | |
52 DISALLOW_COPY_AND_ASSIGN(AccessUnitQueue); | |
53 }; | |
54 | |
55 } // namespace media | |
56 | |
57 // For logging | |
58 std::ostream& operator<<(std::ostream& os, const media::AccessUnit& au); | |
59 | |
60 #endif // MEDIA_BASE_ANDROID_ACCESS_UNIT_QUEUE_H_ | |
OLD | NEW |