OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROMECAST_MEDIA_CMA_BASE_DECODER_BUFFER_BASE_H_ | 5 #ifndef CHROMECAST_MEDIA_CMA_BASE_DECODER_BUFFER_BASE_H_ |
6 #define CHROMECAST_MEDIA_CMA_BASE_DECODER_BUFFER_BASE_H_ | 6 #define CHROMECAST_MEDIA_CMA_BASE_DECODER_BUFFER_BASE_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 15 matching lines...) Expand all Loading... | |
26 public: | 26 public: |
27 DecoderBufferBase(); | 27 DecoderBufferBase(); |
28 | 28 |
29 // Returns the stream id of this decoder buffer belonging to. it's optional | 29 // Returns the stream id of this decoder buffer belonging to. it's optional |
30 // and default value is kPrimary. | 30 // and default value is kPrimary. |
31 virtual StreamId stream_id() const = 0; | 31 virtual StreamId stream_id() const = 0; |
32 | 32 |
33 // Returns the PTS of the frame. | 33 // Returns the PTS of the frame. |
34 virtual base::TimeDelta timestamp() const = 0; | 34 virtual base::TimeDelta timestamp() const = 0; |
35 | 35 |
36 // Sets the PTS of the frame. | |
37 virtual void set_timestamp(const base::TimeDelta& timestamp) = 0; | |
gunsch
2015/06/05 20:02:48
Today, DecoderBufferBase is immutable, which is a
halliwell
2015/06/05 20:16:47
Hmmm ... I could definitely do either of those if
| |
38 | |
36 // Gets the frame data. | 39 // Gets the frame data. |
37 virtual const uint8* data() const = 0; | 40 virtual const uint8* data() const = 0; |
38 virtual uint8* writable_data() const = 0; | 41 virtual uint8* writable_data() const = 0; |
39 | 42 |
40 // Returns the size of the frame in bytes. | 43 // Returns the size of the frame in bytes. |
41 virtual size_t data_size() const = 0; | 44 virtual size_t data_size() const = 0; |
42 | 45 |
43 // Returns the decrypt configuration. | 46 // Returns the decrypt configuration. |
44 // Returns NULL if the buffer has no decrypt info. | 47 // Returns NULL if the buffer has no decrypt info. |
45 virtual const ::media::DecryptConfig* decrypt_config() const = 0; | 48 virtual const ::media::DecryptConfig* decrypt_config() const = 0; |
46 | 49 |
47 // Indicate if this is a special frame that indicates the end of the stream. | 50 // Indicate if this is a special frame that indicates the end of the stream. |
48 // If true, functions to access the frame content cannot be called. | 51 // If true, functions to access the frame content cannot be called. |
49 virtual bool end_of_stream() const = 0; | 52 virtual bool end_of_stream() const = 0; |
50 | 53 |
51 protected: | 54 protected: |
52 friend class base::RefCountedThreadSafe<DecoderBufferBase>; | 55 friend class base::RefCountedThreadSafe<DecoderBufferBase>; |
53 virtual ~DecoderBufferBase(); | 56 virtual ~DecoderBufferBase(); |
54 | 57 |
55 private: | 58 private: |
56 DISALLOW_COPY_AND_ASSIGN(DecoderBufferBase); | 59 DISALLOW_COPY_AND_ASSIGN(DecoderBufferBase); |
57 }; | 60 }; |
58 | 61 |
59 } // namespace media | 62 } // namespace media |
60 } // namespace chromecast | 63 } // namespace chromecast |
61 | 64 |
62 #endif // CHROMECAST_MEDIA_CMA_BASE_DECODER_BUFFER_BASE_H_ | 65 #endif // CHROMECAST_MEDIA_CMA_BASE_DECODER_BUFFER_BASE_H_ |
OLD | NEW |