| 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" |
| 11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
| 12 | 12 |
| 13 namespace media { | 13 namespace media { |
| 14 class DecryptConfig; | 14 class DecryptConfig; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace chromecast { | 17 namespace chromecast { |
| 18 namespace media { | 18 namespace media { |
| 19 | 19 |
| 20 // DecoderBufferBase exposes only the properties of an audio/video buffer. | 20 // DecoderBufferBase exposes only the properties of an audio/video buffer. |
| 21 // The way a DecoderBufferBase is created and organized in memory | 21 // The way a DecoderBufferBase is created and organized in memory |
| 22 // is left as a detail of the implementation of derived classes. | 22 // is left as a detail of the implementation of derived classes. |
| 23 class DecoderBufferBase | 23 class DecoderBufferBase |
| 24 : public base::RefCountedThreadSafe<DecoderBufferBase> { | 24 : public base::RefCountedThreadSafe<DecoderBufferBase> { |
| 25 public: | 25 public: |
| 26 DecoderBufferBase(); | 26 DecoderBufferBase(); |
| 27 | 27 |
| 28 // Returns the stream id of this decoder buffer belonging to. it's optional |
| 29 // and the value is -1 if it's undefined. |
| 30 virtual int stream_id() const = 0; |
| 31 |
| 28 // Returns the PTS of the frame. | 32 // Returns the PTS of the frame. |
| 29 virtual base::TimeDelta timestamp() const = 0; | 33 virtual base::TimeDelta timestamp() const = 0; |
| 30 | 34 |
| 31 // Gets the frame data. | 35 // Gets the frame data. |
| 32 virtual const uint8* data() const = 0; | 36 virtual const uint8* data() const = 0; |
| 33 virtual uint8* writable_data() const = 0; | 37 virtual uint8* writable_data() const = 0; |
| 34 | 38 |
| 35 // Returns the size of the frame in bytes. | 39 // Returns the size of the frame in bytes. |
| 36 virtual size_t data_size() const = 0; | 40 virtual size_t data_size() const = 0; |
| 37 | 41 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 48 virtual ~DecoderBufferBase(); | 52 virtual ~DecoderBufferBase(); |
| 49 | 53 |
| 50 private: | 54 private: |
| 51 DISALLOW_COPY_AND_ASSIGN(DecoderBufferBase); | 55 DISALLOW_COPY_AND_ASSIGN(DecoderBufferBase); |
| 52 }; | 56 }; |
| 53 | 57 |
| 54 } // namespace media | 58 } // namespace media |
| 55 } // namespace chromecast | 59 } // namespace chromecast |
| 56 | 60 |
| 57 #endif // CHROMECAST_MEDIA_CMA_BASE_DECODER_BUFFER_BASE_H_ | 61 #endif // CHROMECAST_MEDIA_CMA_BASE_DECODER_BUFFER_BASE_H_ |
| OLD | NEW |