| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MOJO_MEDIA_MODELS_MULTISTREAM_SOURCE_H_ | 5 #ifndef MOJO_MEDIA_MODELS_MULTISTREAM_SOURCE_H_ |
| 6 #define MOJO_MEDIA_MODELS_MULTISTREAM_SOURCE_H_ | 6 #define MOJO_MEDIA_MODELS_MULTISTREAM_SOURCE_H_ |
| 7 | 7 |
| 8 #include "services/media/framework/models/part.h" | 8 #include "services/media/framework/models/part.h" |
| 9 #include "services/media/framework/packet.h" | 9 #include "services/media/framework/packet.h" |
| 10 | 10 |
| 11 namespace mojo { | 11 namespace mojo { |
| 12 namespace media { | 12 namespace media { |
| 13 | 13 |
| 14 // Synchronous source of packets for multiple streams. This is currently used | 14 // Synchronous source of packets for multiple streams. |
| 15 // by Demux, though it would be better if Demux were asynchronous. | |
| 16 class MultistreamSource : public Part { | 15 class MultistreamSource : public Part { |
| 17 public: | 16 public: |
| 18 ~MultistreamSource() override {} | 17 ~MultistreamSource() override {} |
| 19 | 18 |
| 20 // Returns the number of streams the source produces. | 19 // Returns the number of streams the source produces. |
| 21 virtual size_t stream_count() const = 0; | 20 virtual size_t stream_count() const = 0; |
| 22 | 21 |
| 23 // Gets a packet for the stream indicated via stream_index_out. This call | 22 // Gets a packet for the stream indicated via stream_index_out. This call |
| 24 // should always produce a packet until end-of-stream. The caller is | 23 // should always produce a packet until end-of-stream. The caller is |
| 25 // responsible for releasing the packet. | 24 // responsible for releasing the packet. |
| 26 virtual PacketPtr PullPacket(size_t* stream_index_out) = 0; | 25 virtual PacketPtr PullPacket(size_t* stream_index_out) = 0; |
| 27 }; | 26 }; |
| 28 | 27 |
| 29 } // namespace media | 28 } // namespace media |
| 30 } // namespace mojo | 29 } // namespace mojo |
| 31 | 30 |
| 32 #endif // MOJO_MEDIA_MODELS_MULTISTREAM_SOURCE_H_ | 31 #endif // MOJO_MEDIA_MODELS_MULTISTREAM_SOURCE_H_ |
| OLD | NEW |