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_MULTISTREAM_PACKET_SOURCE_H_ |
| 6 #define MOJO_MEDIA_MODELS_MULTISTREAM_PACKET_SOURCE_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "services/media/framework/packet.h" |
| 11 |
| 12 namespace mojo { |
| 13 namespace media { |
| 14 |
| 15 // Synchronous source of packets for multiple streams. This is currently used |
| 16 // by Demux, though it would be better if Demux were asynchronous. |
| 17 class MultiStreamPacketSource { |
| 18 public: |
| 19 virtual ~MultiStreamPacketSource() {} |
| 20 |
| 21 // Returns the number of streams the source produces. |
| 22 virtual uint32_t stream_count() const = 0; |
| 23 |
| 24 // Gets a packet for the stream indicated via stream_index_out. This call |
| 25 // should always produce a packet until end-of-stream. The caller is |
| 26 // responsible for releasing the packet. |
| 27 virtual PacketPtr PullPacket(uint32_t *stream_index_out) = 0; |
| 28 }; |
| 29 |
| 30 typedef std::shared_ptr<MultiStreamPacketSource> MultiStreamPacketSourcePtr; |
| 31 |
| 32 } // namespace media |
| 33 } // namespace mojo |
| 34 |
| 35 #endif // MOJO_MEDIA_MODELS_MULTISTREAM_PACKET_SOURCE_H_ |
OLD | NEW |