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 // TODO(dalesat): Revisit allocation semantics. |
| 21 |
| 22 // Allocates an input and returns its index. |
| 23 virtual size_t AllocateInput() = 0; |
| 24 |
| 25 // Releases a previously-allocated input and returns the container size |
| 26 // required to hold the remaining inputs (i.e. max input index + 1). The |
| 27 // return value can be used to resize the caller's input container. |
| 28 virtual size_t ReleaseInput(size_t index) = 0; |
| 29 |
| 30 // Updates demand for the specified input. |
| 31 virtual void UpdateDemand(size_t input_index, Demand demand) = 0; |
| 32 }; |
| 33 |
| 34 // Synchronous sink of packets for multiple streams. |
| 35 class ActiveMultistreamSink : public Part { |
| 36 public: |
| 37 ~ActiveMultistreamSink() override {} |
| 38 |
| 39 // Sets the host callback interface. |
| 40 virtual void SetHost(ActiveMultistreamSinkHost* host) = 0; |
| 41 |
| 42 // Initiates demand. |
| 43 virtual void Prime() = 0; |
| 44 |
| 45 // Supplies a packet to the sink, returning the new demand for the input. |
| 46 virtual Demand SupplyPacket(size_t input_index, PacketPtr packet) = 0; |
| 47 }; |
| 48 |
| 49 } // namespace media |
| 50 } // namespace mojo |
| 51 |
| 52 #endif // MOJO_MEDIA_MODELS_ACTIVE_MULTISTREAM_SINK_H_ |
OLD | NEW |