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_MEDIA_CMA_BASE_DECODER_BUFFER_IMPL_H_ |
| 6 #define CHROMECAST_MEDIA_CMA_BASE_DECODER_BUFFER_IMPL_H_ |
| 7 |
| 8 #include "chromecast/public/media/decoder_buffer.h" |
| 9 #include "chromecast/media/cma/base/decoder_buffer_base.h" |
| 10 |
| 11 namespace chromecast { |
| 12 namespace media { |
| 13 |
| 14 // Implementation of public DecoderBuffer interface. |
| 15 // Holds a (refcounted) DecoderBufferBase. This way, ownership throughout |
| 16 // the pipeline is refcounted, but without exposing RefCountedBase in |
| 17 // the public API. |
| 18 class DecoderBufferImpl : public DecoderBuffer { |
| 19 public: |
| 20 DecoderBufferImpl(const scoped_refptr<DecoderBufferBase>& buffer); |
| 21 ~DecoderBufferImpl() override; |
| 22 |
| 23 // Returns the stream id of this decoder buffer belonging to. it's optional |
| 24 // and default value is kPrimary. |
| 25 StreamId stream_id() const override; |
| 26 |
| 27 // Returns the PTS of the frame. |
| 28 TimeDelta timestamp() const override; |
| 29 |
| 30 // Sets the PTS of the frame. |
| 31 void set_timestamp(TimeDelta timestamp) override; |
| 32 |
| 33 // Gets the frame data. |
| 34 const uint8* data() const override; |
| 35 uint8* writable_data() const override; |
| 36 |
| 37 // Returns the size of the frame in bytes. |
| 38 size_t data_size() const override; |
| 39 |
| 40 // Returns the decrypt configuration. |
| 41 // Returns NULL if the buffer has no decrypt info. |
| 42 const DecryptConfig* decrypt_config() const override; |
| 43 |
| 44 // Indicate 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 bool end_of_stream() const override; |
| 47 |
| 48 const scoped_refptr<DecoderBufferBase>& buffer() const; |
| 49 |
| 50 private: |
| 51 scoped_refptr<DecoderBufferBase> buffer_; |
| 52 }; |
| 53 |
| 54 } // namespace media |
| 55 } // namespace chromecast |
| 56 |
| 57 #endif // CHROMECAST_MEDIA_CMA_BASE_DECODER_BUFFER_BASE_H_ |
OLD | NEW |