OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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 CHROMECAST_PUBLIC_MEDIA_CAST_DECODER_BUFFER_H_ |
| 6 #define CHROMECAST_PUBLIC_MEDIA_CAST_DECODER_BUFFER_H_ |
| 7 |
| 8 #include <stdint.h> |
| 9 |
| 10 #include <cstddef> |
| 11 |
| 12 #include "stream_id.h" |
| 13 |
| 14 namespace chromecast { |
| 15 namespace media { |
| 16 |
| 17 class CastDecryptConfig; |
| 18 |
| 19 // CastDecoderBuffer provides an interface for passing a single frame of audio |
| 20 // or video data to the pipeline backend. End-of-stream is indicated by passing |
| 21 // a frame where end_of_stream() returns true. |
| 22 // Buffer ownership passes to backend when they are pushed (see |
| 23 // MediaComponentDevice::PushFrame). |
| 24 class CastDecoderBuffer { |
| 25 public: |
| 26 virtual ~CastDecoderBuffer() {} |
| 27 |
| 28 // Returns the stream id of this decoder buffer. |
| 29 virtual StreamId stream_id() const = 0; |
| 30 |
| 31 // Returns the PTS of the frame in microseconds. |
| 32 virtual int64_t timestamp() const = 0; |
| 33 |
| 34 // Gets the frame data. |
| 35 virtual const uint8_t* data() const = 0; |
| 36 |
| 37 // Returns the size of the frame in bytes. |
| 38 virtual size_t data_size() const = 0; |
| 39 |
| 40 // Returns the decrypt configuration. |
| 41 // Returns NULL if and only if the buffer is unencrypted. |
| 42 virtual const CastDecryptConfig* decrypt_config() const = 0; |
| 43 |
| 44 // Indicates if this is a special frame that indicates the end of the stream. |
| 45 // If true, functions to access the frame content cannot be called. |
| 46 virtual bool end_of_stream() const = 0; |
| 47 }; |
| 48 |
| 49 } // namespace media |
| 50 } // namespace chromecast |
| 51 |
| 52 #endif // CHROMECAST_PUBLIC_MEDIA_CAST_DECODER_BUFFER_H_ |
OLD | NEW |