Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Unified Diff: media/base/android/au_queue.h

Issue 1128383003: Implementation of MediaCodecPlayer stage 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed stop procedure, fixed compilation Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 {
qinmin 2015/05/12 23:58:23 I prefer this to be called AccessUnitQueue, rather
Tima Vaisburd 2015/05/13 22:51:47 Renamed.
+ 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
qinmin 2015/05/12 23:58:23 nit: s/an/and/
Tima Vaisburd 2015/05/13 22:51:47 Done, although this method does the wrong thing, a
+ // exist returns false.
+ bool SkipToKeyFrame();
+
+ void GetInfo(Info* info) const;
+
+ bool HasEOS() const;
+ int Length() const;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AUQueue);
qinmin 2015/05/12 23:58:23 this should stay at the end of the class declarati
Tima Vaisburd 2015/05/13 22:51:47 Done.
+
+ std::deque<AccessUnit> access_units_;
+ std::deque<DemuxerConfigs> demuxer_configs_;
+ bool has_eos_;
+
+ mutable base::Lock lock_;
+
qinmin 2015/05/12 23:58:23 nit: extra line
Tima Vaisburd 2015/05/13 22:51:47 Removed.
+};
+
+} // namespace media
+
+// For logging
+std::ostream& operator<<(std::ostream& os, const media::AccessUnit& au);
+
+#endif // MEDIA_BASE_ANDROID_AU_QUEUE_H_

Powered by Google App Engine
This is Rietveld 408576698