OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef MOJO_MEDIA_MODELS_ACTIVE_MULTISTREAM_SINK_H_ |
| 6 #define MOJO_MEDIA_MODELS_ACTIVE_MULTISTREAM_SINK_H_ |
| 7 |
| 8 #include "services/media/framework/models/demand.h" |
| 9 #include "services/media/framework/models/part.h" |
| 10 #include "services/media/framework/packet.h" |
| 11 |
| 12 namespace mojo { |
| 13 namespace media { |
| 14 |
| 15 // Host for ActiveMultistreamSink. |
| 16 class ActiveMultistreamSinkHost { |
| 17 public: |
| 18 virtual ~ActiveMultistreamSinkHost() {} |
| 19 |
| 20 // Allocates an input and returns its index. |
| 21 virtual size_t AllocateInput() = 0; |
| 22 |
| 23 // Releases a previously-allocated input and returns the container size |
| 24 // required to hold the remaining inputs (i.e. max input index + 1). The |
| 25 // return value can be used to resize the caller's input container. |
| 26 virtual size_t ReleaseInput(size_t index) = 0; |
| 27 |
| 28 // Updates demand for the specified input. |
| 29 virtual void UpdateDemand(size_t input_index, Demand demand) = 0; |
| 30 }; |
| 31 |
| 32 // Synchronous sink of packets for multiple streams. |
| 33 class ActiveMultistreamSink : public Part { |
| 34 public: |
| 35 ~ActiveMultistreamSink() override {} |
| 36 |
| 37 // Sets the host callback interface. |
| 38 virtual void SetHost(ActiveMultistreamSinkHost* host) = 0; |
| 39 |
| 40 // Initiates demand. |
| 41 virtual void Prime() = 0; |
| 42 |
| 43 // Supplies a packet to the sink, returning the new demand for the input. |
| 44 virtual Demand SupplyPacket(size_t input_index, PacketPtr packet) = 0; |
| 45 }; |
| 46 |
| 47 } // namespace media |
| 48 } // namespace mojo |
| 49 |
| 50 #endif // MOJO_MEDIA_MODELS_ACTIVE_MULTISTREAM_SINK_H_ |
OLD | NEW |