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

Unified Diff: chromecast/public/media/decoder_buffer.h

Issue 1257013003: Load CMA backend from shared library (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Unit test + android fixes Created 5 years, 5 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/public/media/decoder_buffer.h
diff --git a/chromecast/public/media/decoder_buffer.h b/chromecast/public/media/decoder_buffer.h
new file mode 100644
index 0000000000000000000000000000000000000000..833282f7a42de8cd05deb537f9e4e0015f6eb80e
--- /dev/null
+++ b/chromecast/public/media/decoder_buffer.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_PUBLIC_MEDIA_DECODER_BUFFER_H_
+#define CHROMECAST_PUBLIC_MEDIA_DECODER_BUFFER_H_
+
+#include <stdint.h>
+
+#include <cstddef>
+
+#include "chromecast/public/time_delta.h"
byungchul 2015/07/27 18:22:23 should be relative to chromecast/public
halliwell 2015/07/28 02:19:35 TimeDelta removed now anyway.
+#include "stream_id.h"
+
+namespace chromecast {
+namespace media {
+
+class DecryptConfig;
+
+// DecoderBuffer exposes only the properties of an audio/video buffer.
+// The way a DecoderBuffer is created and organized in memory
+// is left as a detail of the implementation of derived classes.
+class DecoderBuffer {
gunsch 2015/07/27 17:14:49 Any chance we can change the name, to avoid confus
halliwell 2015/07/28 02:19:35 Happy to change the name. DecryptConfig is a simi
halliwell 2015/07/28 23:26:06 Ok, renamed to CastDecoderBuffer, CastDecryptConfi
+ public:
+ DecoderBuffer() {}
byungchul 2015/07/27 18:22:23 not necessary
halliwell 2015/07/28 02:19:35 removed.
+ virtual ~DecoderBuffer() {}
+
+ // Returns the stream id of this decoder buffer belonging to. it's optional
+ // and default value is kPrimary.
+ virtual StreamId stream_id() const = 0;
byungchul 2015/07/27 18:22:23 Isn't const in public apis too restricted?
halliwell 2015/07/28 02:19:35 This isn't an API for vendors to implement. It's
+
+ // Returns the PTS of the frame.
+ virtual TimeDelta timestamp() const = 0;
+
+ // Sets the PTS of the frame.
+ virtual void set_timestamp(TimeDelta timestamp) = 0;
byungchul 2015/07/27 18:22:23 No simple setters/getters in public apis. Otherwis
halliwell 2015/07/28 02:19:35 I removed this and also writable_data. I had been
byungchul 2015/07/28 18:05:43 If it is not for vendors, why is this defined in p
halliwell 2015/07/28 23:26:06 We need to pass buffers to vendors, this is their
+
+ // Gets the frame data.
+ virtual const uint8_t* data() const = 0;
+ virtual uint8_t* writable_data() const = 0;
+
+ // Returns the size of the frame in bytes.
+ virtual size_t data_size() const = 0;
+
+ // Returns the decrypt configuration.
+ // Returns NULL if the buffer has no decrypt info.
+ virtual const DecryptConfig* decrypt_config() const = 0;
+
+ // 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.
+ virtual bool end_of_stream() const = 0;
+};
+
+} // namespace media
+} // namespace chromecast
+
+#endif // CHROMECAST_MEDIA_CMA_BASE_DECODER_BUFFER_BASE_H_

Powered by Google App Engine
This is Rietveld 408576698