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 // TODO(halliwell): consider renaming functions here to camel case. |
| 25 class CastDecoderBuffer { |
| 26 public: |
| 27 virtual ~CastDecoderBuffer() {} |
| 28 |
| 29 // Returns the stream id of this decoder buffer. |
| 30 virtual StreamId stream_id() const = 0; |
| 31 |
| 32 // Returns the PTS of the frame in microseconds. |
| 33 virtual int64_t timestamp() const = 0; |
| 34 |
| 35 // Gets the frame data. |
| 36 virtual const uint8_t* data() const = 0; |
| 37 |
| 38 // Returns the size of the frame in bytes. |
| 39 virtual size_t data_size() const = 0; |
| 40 |
| 41 // Returns the decrypt configuration. |
| 42 // Returns NULL if and only if the buffer is unencrypted. |
| 43 virtual const CastDecryptConfig* decrypt_config() const = 0; |
| 44 |
| 45 // Indicates if this is a special frame that indicates the end of the stream. |
| 46 // If true, functions to access the frame content cannot be called. |
| 47 virtual bool end_of_stream() const = 0; |
| 48 }; |
| 49 |
| 50 } // namespace media |
| 51 } // namespace chromecast |
| 52 |
| 53 #endif // CHROMECAST_PUBLIC_MEDIA_CAST_DECODER_BUFFER_H_ |
OLD | NEW |