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.
5 #ifndef CHROMECAST_PUBLIC_MEDIA_CAST_DECODER_BUFFER_H_
6 #define CHROMECAST_PUBLIC_MEDIA_CAST_DECODER_BUFFER_H_
12 #include "stream_id.h"
14 namespace chromecast
{
17 class CastDecryptConfig
;
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
{
27 virtual ~CastDecoderBuffer() {}
29 // Returns the stream id of this decoder buffer.
30 virtual StreamId
stream_id() const = 0;
32 // Returns the PTS of the frame in microseconds.
33 virtual int64_t timestamp() const = 0;
35 // Gets the frame data.
36 virtual const uint8_t* data() const = 0;
38 // Returns the size of the frame in bytes.
39 virtual size_t data_size() const = 0;
41 // Returns the decrypt configuration.
42 // Returns NULL if and only if the buffer is unencrypted.
43 virtual const CastDecryptConfig
* decrypt_config() const = 0;
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;
51 } // namespace chromecast
53 #endif // CHROMECAST_PUBLIC_MEDIA_CAST_DECODER_BUFFER_H_