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

Unified Diff: services/media/framework_mojo/mojo_consumer.h

Issue 2097953002: Motown: Rename MediaProducer/Consumer to MediaPacketProducer/Consumer (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fixed #ifndef guards Created 4 years, 6 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_mojo/BUILD.gn ('k') | services/media/framework_mojo/mojo_consumer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/media/framework_mojo/mojo_consumer.h
diff --git a/services/media/framework_mojo/mojo_consumer.h b/services/media/framework_mojo/mojo_consumer.h
deleted file mode 100644
index 44ffc8eb079aced1a6be91972b913114d2b25250..0000000000000000000000000000000000000000
--- a/services/media/framework_mojo/mojo_consumer.h
+++ /dev/null
@@ -1,115 +0,0 @@
-// 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 SERVICES_MEDIA_FRAMEWORK_MOJO_MOJO_CONSUMER_H_
-#define SERVICES_MEDIA_FRAMEWORK_MOJO_MOJO_CONSUMER_H_
-
-#include "base/single_thread_task_runner.h"
-#include "base/task_runner.h"
-#include "mojo/common/binding_set.h"
-#include "mojo/services/media/common/cpp/mapped_shared_buffer.h"
-#include "mojo/services/media/common/interfaces/media_transport.mojom.h"
-#include "services/media/framework/models/active_source.h"
-
-namespace mojo {
-namespace media {
-
-// Implements MediaConsumer::Flush on behalf of MediaConsumer to avoid name
-// conflict with Part::Flush.
-class MojoConsumerMediaConsumer : public MediaConsumer {
- // MediaConsumer implementation.
- void Flush(const FlushCallback& callback) override;
-
- // Implements MediaConsumer::Flush.
- virtual void MediaConsumerFlush(const FlushCallback& callback) = 0;
-};
-
-// Implements MediaConsumer to receive a stream from across mojo.
-class MojoConsumer : public MojoConsumerMediaConsumer, public ActiveSource {
- public:
- using PrimeRequestedCallback = std::function<void(const PrimeCallback&)>;
- using FlushRequestedCallback = std::function<void(const FlushCallback&)>;
-
- static std::shared_ptr<MojoConsumer> Create() {
- return std::shared_ptr<MojoConsumer>(new MojoConsumer());
- }
-
- ~MojoConsumer() override;
-
- // Adds a binding.
- void AddBinding(InterfaceRequest<MediaConsumer> consumer);
-
- // Sets a callback signalling that a prime has been requested from the
- // MediaConsumer client.
- void SetPrimeRequestedCallback(const PrimeRequestedCallback& callback);
-
- // Sets a callback signalling that a flush has been requested from the
- // MediaConsumer client.
- void SetFlushRequestedCallback(const FlushRequestedCallback& callback);
-
- // MediaConsumer implementation.
- void SetBuffer(ScopedSharedBufferHandle buffer,
- const SetBufferCallback& callback) override;
-
- void SendPacket(MediaPacketPtr packet,
- const SendPacketCallback& callback) override;
-
- void Prime(const PrimeCallback& callback) override;
-
- void MediaConsumerFlush(const FlushCallback& callback) override;
-
- // ActiveSource implementation.
- bool can_accept_allocator() const override;
-
- void set_allocator(PayloadAllocator* allocator) override;
-
- void SetSupplyCallback(const SupplyCallback& supply_callback) override;
-
- void SetDownstreamDemand(Demand demand) override;
-
- private:
- MojoConsumer();
-
- // Specialized packet implementation.
- class PacketImpl : public Packet {
- public:
- static PacketPtr Create(
- MediaPacketPtr media_packet,
- const SendPacketCallback& callback,
- scoped_refptr<base::SingleThreadTaskRunner> task_runner,
- const MappedSharedBuffer& buffer) {
- return PacketPtr(
- new PacketImpl(media_packet.Pass(), callback, task_runner, buffer));
- }
-
- protected:
- void Release() override;
-
- private:
- PacketImpl(MediaPacketPtr media_packet,
- const SendPacketCallback& callback,
- scoped_refptr<base::SingleThreadTaskRunner> task_runner,
- const MappedSharedBuffer& buffer);
-
- ~PacketImpl() override;
-
- static void RunCallback(const SendPacketCallback& callback);
-
- MediaPacketPtr media_packet_;
- const SendPacketCallback callback_;
- scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
- };
-
- BindingSet<MediaConsumer> bindings_;
- PrimeRequestedCallback prime_requested_callback_;
- FlushRequestedCallback flush_requested_callback_;
- scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
- MappedSharedBuffer buffer_;
- SupplyCallback supply_callback_;
-};
-
-} // namespace media
-} // namespace mojo
-
-#endif // SERVICES_MEDIA_FRAMEWORK_MOJO_MOJO_CONSUMER_H_
« no previous file with comments | « services/media/framework_mojo/BUILD.gn ('k') | services/media/framework_mojo/mojo_consumer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698