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

Unified Diff: services/media/framework/models/active_multistream_source.h

Issue 1833323002: Motown: Add ActiveMultistreamSource model in preparation for the ffmpeg demux with async I/O (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: dalesat Created 4 years, 9 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 | « services/media/framework/graph.h ('k') | services/media/framework/models/multistream_source.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/media/framework/models/active_multistream_source.h
diff --git a/services/media/framework/models/active_multistream_source.h b/services/media/framework/models/active_multistream_source.h
new file mode 100644
index 0000000000000000000000000000000000000000..22b1b11cdf2ddec3c8531c075f4d4463d21a1de9
--- /dev/null
+++ b/services/media/framework/models/active_multistream_source.h
@@ -0,0 +1,38 @@
+// Copyright 2016 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 MOJO_MEDIA_MODELS_ACTIVE_MULTISTREAM_SOURCE_H_
+#define MOJO_MEDIA_MODELS_ACTIVE_MULTISTREAM_SOURCE_H_
+
+#include "services/media/framework/models/part.h"
+#include "services/media/framework/packet.h"
+
+namespace mojo {
+namespace media {
+
+// Asynchronous source of packets for multiple streams.
+class ActiveMultistreamSource : public Part {
+ public:
+ using SupplyCallback =
+ std::function<void(size_t output_index, PacketPtr packet)>;
+
+ ~ActiveMultistreamSource() override {}
+
+ // TODO(dalesat): Support dynamic output creation.
+
+ // Returns the number of streams the source produces.
+ virtual size_t stream_count() const = 0;
+
+ // Sets the callback that supplies a packet asynchronously.
+ virtual void SetSupplyCallback(const SupplyCallback& supply_callback) = 0;
+
+ // Requests a packet from the source to be supplied asynchronously via
+ // the supply callback.
+ virtual void RequestPacket() = 0;
+};
+
+} // namespace media
+} // namespace mojo
+
+#endif // MOJO_MEDIA_MODELS_ACTIVE_MULTISTREAM_SOURCE_H_
« no previous file with comments | « services/media/framework/graph.h ('k') | services/media/framework/models/multistream_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698