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() {} | |
byungchul
2015/07/29 20:32:23
If it won't be destroyed by shlib, it should be a
gunsch-google
2015/07/29 20:48:26
This will be owned and destroyed by shlib.
halliwell
2015/07/29 22:39:27
Correct. This definitely needs to be public.
| |
27 | |
28 // Returns the stream id of this decoder buffer. | |
29 virtual StreamId stream_id() const = 0; | |
byungchul
2015/07/29 20:32:23
Still don't understand why these names are lower-c
gunsch-google
2015/07/29 20:48:26
I'm in favor of getters. For example, data() and d
halliwell
2015/07/29 22:39:27
After offline discussion, prefer to leave these as
byungchul
2015/07/29 23:12:29
A TODO would be appreciated to not forget re-addre
halliwell
2015/07/30 00:19:57
Ok, TODO added :)
| |
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 |