Index: media/base/android/access_unit_queue.h |
diff --git a/media/base/android/access_unit_queue.h b/media/base/android/access_unit_queue.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1e4311e3491923eadf0826f4515094f32b25b0b0 |
--- /dev/null |
+++ b/media/base/android/access_unit_queue.h |
@@ -0,0 +1,60 @@ |
+// 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_ACCESS_UNIT_QUEUE_H_ |
+#define MEDIA_BASE_ANDROID_ACCESS_UNIT_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 AccessUnitQueue { |
qinmin
2015/05/14 19:52:57
class description
Tima Vaisburd
2015/05/15 00:12:39
Done.
|
+ 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) {} |
+ }; |
+ |
+ AccessUnitQueue(); |
+ virtual ~AccessUnitQueue(); |
+ |
+ void PushBack(const DemuxerData& frames); |
+ void PopFront(); |
+ void Flush(); |
+ |
+ // Looks for the first key frame and if it exists, |
+ // removes prior frames and returns true. If it does not |
+ // exist returns false. |
+ bool SkipToKeyFrame(); |
+ |
+ void GetInfo(Info* info) const; |
+ |
+ bool HasEOS() const; |
+ int Length() const; |
+ |
+ private: |
+ std::deque<AccessUnit> access_units_; |
+ std::deque<DemuxerConfigs> demuxer_configs_; |
+ bool has_eos_; |
+ |
+ mutable base::Lock lock_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(AccessUnitQueue); |
+}; |
+ |
+} // namespace media |
+ |
+// For logging |
+std::ostream& operator<<(std::ostream& os, const media::AccessUnit& au); |
+ |
+#endif // MEDIA_BASE_ANDROID_ACCESS_UNIT_QUEUE_H_ |