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_CAST_DECODER_BUFFER_IMPL_H_ |
| 6 #define CHROMECAST_MEDIA_CMA_BASE_CAST_DECODER_BUFFER_IMPL_H_ |
| 7 |
| 8 #include "chromecast/public/media/cast_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 CastDecoderBufferImpl : public CastDecoderBuffer { |
| 19 public: |
| 20 CastDecoderBufferImpl(const scoped_refptr<DecoderBufferBase>& buffer); |
| 21 ~CastDecoderBufferImpl() 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 in microseconds. |
| 28 int64_t timestamp() const override; |
| 29 |
| 30 // Gets the frame data. |
| 31 const uint8* data() const override; |
| 32 |
| 33 // Returns the size of the frame in bytes. |
| 34 size_t data_size() const override; |
| 35 |
| 36 // Returns the decrypt configuration. |
| 37 // Returns NULL if the buffer has no decrypt info. |
| 38 const CastDecryptConfig* decrypt_config() const override; |
| 39 |
| 40 // Indicate if this is a special frame that indicates the end of the stream. |
| 41 // If true, functions to access the frame content cannot be called. |
| 42 bool end_of_stream() const override; |
| 43 |
| 44 const scoped_refptr<DecoderBufferBase>& buffer() const; |
| 45 |
| 46 private: |
| 47 scoped_refptr<DecoderBufferBase> buffer_; |
| 48 }; |
| 49 |
| 50 } // namespace media |
| 51 } // namespace chromecast |
| 52 |
| 53 #endif // CHROMECAST_MEDIA_CMA_BASE_CAST_DECODER_BUFFER_BASE_H_ |
OLD | NEW |