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

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

Issue 1678433002: Motown: Remove LPCM optimizations, fix prepare, add flush, add ActiveMultistreamSink model/stage (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Sync Created 4 years, 10 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: services/media/framework/models/active_sink.h
diff --git a/services/media/framework/models/active_sink.h b/services/media/framework/models/active_sink.h
index 955fe06cdd7e8fc5bed908c0c3f4db948fb1a555..51e387b1d1d6d3f0adbba1baa722d2e85b5f728e 100644
--- a/services/media/framework/models/active_sink.h
+++ b/services/media/framework/models/active_sink.h
@@ -5,41 +5,35 @@
#ifndef MOJO_MEDIA_MODELS_ACTIVE_SINK_H_
#define MOJO_MEDIA_MODELS_ACTIVE_SINK_H_
-#include <memory>
-
-#include "services/media/framework/allocator.h"
#include "services/media/framework/models/demand.h"
+#include "services/media/framework/models/part.h"
#include "services/media/framework/packet.h"
+#include "services/media/framework/payload_allocator.h"
namespace mojo {
namespace media {
// Sink that consumes packets asynchronously.
-class ActiveSink {
+class ActiveSink : public Part {
public:
using DemandCallback = std::function<void(Demand demand)>;
- virtual ~ActiveSink() {}
-
- // Indicates whether the sink must allocate.
- virtual bool must_allocate() const = 0;
+ ~ActiveSink() override {}
- // The consumer's allocator. Can return nullptr, in which case the default
- // allocator should be used.
- virtual Allocator* allocator() = 0;
+ // An allocator that must be used for supplied packets or nullptr if there's
+ // no such requirement.
+ virtual PayloadAllocator* allocator() = 0;
// Sets the callback that signals demand asynchronously.
- virtual void SetDemandCallback(DemandCallback demand_callback) = 0;
+ virtual void SetDemandCallback(const DemandCallback& demand_callback) = 0;
// Initiates demand.
virtual void Prime() = 0;
- // Supplies a packet to the sink.
+ // Supplies a packet to the sink, returning the new demand for the input.
virtual Demand SupplyPacket(PacketPtr packet) = 0;
};
-typedef std::shared_ptr<ActiveSink> ActiveSinkPtr;
-
} // namespace media
} // namespace mojo
« no previous file with comments | « services/media/framework/models/active_multistream_sink.h ('k') | services/media/framework/models/active_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698