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

Unified Diff: media/base/audio_buffer.h

Issue 1468153003: Define AudioBuffer and VideoFrame for mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: switch statement Created 5 years, 1 month 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
« no previous file with comments | « no previous file | media/base/audio_buffer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/audio_buffer.h
diff --git a/media/base/audio_buffer.h b/media/base/audio_buffer.h
index 63390d4781cacca98c636d465b0e75c28fecd50f..bf8e4334912e78736dba4e3c1e6204beb6d6fec1 100644
--- a/media/base/audio_buffer.h
+++ b/media/base/audio_buffer.h
@@ -15,9 +15,20 @@
#include "media/base/media_export.h"
#include "media/base/sample_format.h"
+namespace mojo {
+template <typename T, typename U>
+struct TypeConverter;
+template <typename T>
+class StructPtr;
+};
+
namespace media {
class AudioBus;
+namespace interfaces {
+class AudioBuffer;
+}
+
// An audio buffer that takes a copy of the data passed to it, holds it, and
// copies it into an AudioBus when needed. Also supports an end of stream
// marker.
@@ -123,6 +134,11 @@ class MEDIA_EXPORT AudioBuffer
private:
friend class base::RefCountedThreadSafe<AudioBuffer>;
+ // mojo::TypeConverter added as a friend so that AudioBuffer can be
+ // transferred across a mojo connection.
+ friend struct mojo::TypeConverter<mojo::StructPtr<interfaces::AudioBuffer>,
+ scoped_refptr<AudioBuffer>>;
+
// Allocates aligned contiguous buffer to hold all channel data (1 block for
// interleaved data, |channel_count| blocks for planar data), copies
// [data,data+data_size) to the allocated buffer(s). If |data| is null, no
@@ -151,6 +167,7 @@ class MEDIA_EXPORT AudioBuffer
// Contiguous block of channel data.
scoped_ptr<uint8, base::AlignedFreeDeleter> data_;
+ size_t data_size_;
// For planar data, points to each channels data.
std::vector<uint8*> channel_data_;
« no previous file with comments | « no previous file | media/base/audio_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698