Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2116)

Unified Diff: chromecast/media/cma/base/cast_decoder_buffer_impl.h

Issue 1257013003: Load CMA backend from shared library (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chromecast/media/cma/base/cast_decoder_buffer_impl.h
diff --git a/chromecast/media/cma/base/cast_decoder_buffer_impl.h b/chromecast/media/cma/base/cast_decoder_buffer_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..444ccf430837695b4820364b0a69853767954e8c
--- /dev/null
+++ b/chromecast/media/cma/base/cast_decoder_buffer_impl.h
@@ -0,0 +1,53 @@
+// 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_CAST_DECODER_BUFFER_IMPL_H_
+#define CHROMECAST_MEDIA_CMA_BASE_CAST_DECODER_BUFFER_IMPL_H_
+
+#include "chromecast/public/media/cast_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 CastDecoderBufferImpl : public CastDecoderBuffer {
+ public:
+ CastDecoderBufferImpl(const scoped_refptr<DecoderBufferBase>& buffer);
+ ~CastDecoderBufferImpl() 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 in microseconds.
+ int64_t timestamp() const override;
+
+ // Gets the frame data.
+ const uint8* 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 CastDecryptConfig* 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_CAST_DECODER_BUFFER_BASE_H_

Powered by Google App Engine
This is Rietveld 408576698