Index: chromecast/media/cma/base/decoder_buffer_impl.h |
diff --git a/chromecast/media/cma/base/decoder_buffer_impl.h b/chromecast/media/cma/base/decoder_buffer_impl.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0a97e9678b8299d76d33c123a5c7c403470c0b58 |
--- /dev/null |
+++ b/chromecast/media/cma/base/decoder_buffer_impl.h |
@@ -0,0 +1,57 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROMECAST_MEDIA_CMA_BASE_DECODER_BUFFER_IMPL_H_ |
+#define CHROMECAST_MEDIA_CMA_BASE_DECODER_BUFFER_IMPL_H_ |
+ |
+#include "chromecast/public/media/decoder_buffer.h" |
+#include "chromecast/media/cma/base/decoder_buffer_base.h" |
+ |
+namespace chromecast { |
+namespace media { |
+ |
+// Implementation of public DecoderBuffer interface. |
+// Holds a (refcounted) DecoderBufferBase. This way, ownership throughout |
+// the pipeline is refcounted, but without exposing RefCountedBase in |
+// the public API. |
+class DecoderBufferImpl : public DecoderBuffer { |
+ public: |
+ DecoderBufferImpl(const scoped_refptr<DecoderBufferBase>& buffer); |
+ ~DecoderBufferImpl() override; |
+ |
+ // Returns the stream id of this decoder buffer belonging to. it's optional |
+ // and default value is kPrimary. |
+ StreamId stream_id() const override; |
+ |
+ // Returns the PTS of the frame. |
+ TimeDelta timestamp() const override; |
+ |
+ // Sets the PTS of the frame. |
+ void set_timestamp(TimeDelta timestamp) override; |
+ |
+ // Gets the frame data. |
+ const uint8* data() const override; |
+ uint8* writable_data() const override; |
+ |
+ // Returns the size of the frame in bytes. |
+ size_t data_size() const override; |
+ |
+ // Returns the decrypt configuration. |
+ // Returns NULL if the buffer has no decrypt info. |
+ const DecryptConfig* decrypt_config() const override; |
+ |
+ // Indicate if this is a special frame that indicates the end of the stream. |
+ // If true, functions to access the frame content cannot be called. |
+ bool end_of_stream() const override; |
+ |
+ const scoped_refptr<DecoderBufferBase>& buffer() const; |
+ |
+ private: |
+ scoped_refptr<DecoderBufferBase> buffer_; |
+}; |
+ |
+} // namespace media |
+} // namespace chromecast |
+ |
+#endif // CHROMECAST_MEDIA_CMA_BASE_DECODER_BUFFER_BASE_H_ |