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

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: 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
« no previous file with comments | « no previous file | chromecast/media/cma/base/coded_frame_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b13231d8e59e1a59ff451498a696174b1bbad2b9
--- /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;
+
+ 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_
« no previous file with comments | « no previous file | chromecast/media/cma/base/coded_frame_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698