Index: media/base/android/au_queue.h |
diff --git a/media/base/android/au_queue.h b/media/base/android/au_queue.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..89b80172da094acbdc6316e43f31c3479fed88ce |
--- /dev/null |
+++ b/media/base/android/au_queue.h |
@@ -0,0 +1,61 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef MEDIA_BASE_ANDROID_AU_QUEUE_H_ |
+#define MEDIA_BASE_ANDROID_AU_QUEUE_H_ |
+ |
+#include <deque> |
+ |
+#include "base/macros.h" |
+#include "base/synchronization/lock.h" |
+#include "media/base/android/demuxer_stream_player_params.h" |
+ |
+namespace media { |
+ |
+class AUQueue { |
+ public: |
+ struct Info { |
+ const AccessUnit* front_unit; |
+ const DemuxerConfigs* configs; |
+ int length; |
+ bool has_eos; |
+ |
+ Info() |
+ : front_unit(nullptr), configs(nullptr), length(0), has_eos(false) {} |
+ }; |
+ |
+ AUQueue(); |
+ virtual ~AUQueue(); |
+ |
+ void PushBack(const DemuxerData& frames); |
+ void PopFront(); |
+ void Flush(); |
+ |
+ // Looks for the first key frame and if it exists, |
+ // removes prior frames an returns true. If it does not |
+ // exist returns false. |
+ bool SkipToKeyFrame(); |
+ |
+ void GetInfo(Info* info) const; |
+ |
+ bool HasEOS() const; |
+ int Length() const; |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(AUQueue); |
+ |
+ std::deque<AccessUnit> access_units_; |
+ std::deque<DemuxerConfigs> demuxer_configs_; |
+ bool has_eos_; |
+ |
+ mutable base::Lock lock_; |
+ |
+}; |
+ |
+} // namespace media |
+ |
+// For logging |
+std::ostream& operator<<(std::ostream& os, const media::AccessUnit& au); |
+ |
+#endif // MEDIA_BASE_ANDROID_AU_QUEUE_H_ |