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

Unified Diff: chromecast/media/cma/base/coded_frame_provider.h

Issue 542893003: Add the frame provider base class used in cast media. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Do not use: scoped_refptr operator T* (disabled recently). Created 6 years, 3 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: chromecast/media/cma/base/coded_frame_provider.h
diff --git a/chromecast/media/cma/base/coded_frame_provider.h b/chromecast/media/cma/base/coded_frame_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..a8df6253c38bdeeb2c70ed2389ebb02f8c5403aa
--- /dev/null
+++ b/chromecast/media/cma/base/coded_frame_provider.h
@@ -0,0 +1,51 @@
+// Copyright 2014 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 CHROMECAST_MEDIA_CMA_BASE_CODED_FRAME_PROVIDER_H_
+#define CHROMECAST_MEDIA_CMA_BASE_CODED_FRAME_PROVIDER_H_
+
+#include "base/callback.h"
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+
+namespace media {
+class AudioDecoderConfig;
+class VideoDecoderConfig;
+}
+
+namespace chromecast {
+namespace media {
+class DecoderBufferBase;
+
+class CodedFrameProvider {
+ public:
+ typedef base::Callback<void(const scoped_refptr<DecoderBufferBase>&,
+ const ::media::AudioDecoderConfig&,
+ const ::media::VideoDecoderConfig&)> ReadCb;
damienv1 2014/09/05 20:15:48 ReadCB
damienv1 2014/09/05 21:15:57 Done.
+
+ CodedFrameProvider();
+ virtual ~CodedFrameProvider();
+
+ // Request a coded frame which is provided asynchronously through callback
+ // |read_cb|.
+ // If the frame is associated with a new video/audio configuration,
+ // these configurations are returned as part of the |read_cb| callback.
+ // Invoking the |read_cb| callback with invalid audio/video configurations
+ // means the configurations have not changed.
+ virtual void Read(const ReadCb& read_cb) = 0;
+
+ // Flush the coded frames held by the frame provider.
+ // Invoke callback |flush_cb| when completed.
+ // Note: any pending read is cancelled, meaning that any pending |read_cb|
+ // callback will not be invoked.
+ virtual void Flush(const base::Closure& flush_cb) = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(CodedFrameProvider);
+};
+
+} // namespace media
+} // namespace chromecast
+
+#endif // CHROMECAST_MEDIA_CMA_BASE_CODED_FRAME_PROVIDER_H_

Powered by Google App Engine
This is Rietveld 408576698