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_AU_QUEUE_H_ |
| 6 #define MEDIA_BASE_ANDROID_AU_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 AUQueue { |
| 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 AUQueue(); |
| 29 virtual ~AUQueue(); |
| 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 an 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 DISALLOW_COPY_AND_ASSIGN(AUQueue); |
| 47 |
| 48 std::deque<AccessUnit> access_units_; |
| 49 std::deque<DemuxerConfigs> demuxer_configs_; |
| 50 bool has_eos_; |
| 51 |
| 52 mutable base::Lock lock_; |
| 53 |
| 54 }; |
| 55 |
| 56 } // namespace media |
| 57 |
| 58 // For logging |
| 59 std::ostream& operator<<(std::ostream& os, const media::AccessUnit& au); |
| 60 |
| 61 #endif // MEDIA_BASE_ANDROID_AU_QUEUE_H_ |
OLD | NEW |