Chromium Code Reviews| 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_ |