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

Unified Diff: media/base/audio_bus.h

Issue 2640003002: Implement MojoAudioRendererSink and use it in UtilityMojoMediaClient (Closed)
Patch Set: Rebase Created 3 years, 10 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
« no previous file with comments | « media/audio/audio_device_thread.cc ('k') | media/base/audio_bus.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/audio_bus.h
diff --git a/media/base/audio_bus.h b/media/base/audio_bus.h
index 6d381ccac3daa3c9325fb9d4af99259e4cef3825..2752ec871c9724d49f45d0e58437e8abdfae8e3d 100644
--- a/media/base/audio_bus.h
+++ b/media/base/audio_bus.h
@@ -15,9 +15,20 @@
#include "base/memory/ref_counted.h"
#include "media/base/media_export.h"
+namespace mojo {
+template <typename T, typename U>
+struct TypeConverter;
+template <typename T>
+class StructPtr;
+};
+
namespace media {
class AudioParameters;
+namespace mojom {
+class AudioBus;
+}
+
// Represents a sequence of audio frames containing frames() audio samples for
// each of channels() channels. The data is stored as a set of contiguous
// float arrays with one array per channel. The memory for the arrays is either
@@ -187,6 +198,10 @@ class MEDIA_EXPORT AudioBus {
explicit AudioBus(int channels);
private:
+ // mojo::TypeConverter added as a friend so that AudioBus can be
+ // transferred across a mojo connection.
+ friend struct mojo::TypeConverter<mojo::StructPtr<mojom::AudioBus>, AudioBus>;
+
// Helper method for building |channel_data_| from a block of memory. |data|
// must be at least CalculateMemorySize(...) bytes in size.
void BuildChannelData(int channels, int aligned_frame, float* data);
@@ -209,6 +224,7 @@ class MEDIA_EXPORT AudioBus {
// Contiguous block of channel memory.
std::unique_ptr<float, base::AlignedFreeDeleter> data_;
+ size_t data_size_;
// One float pointer per channel pointing to a contiguous block of memory for
// that channel. If the memory is owned by this instance, this will
« no previous file with comments | « media/audio/audio_device_thread.cc ('k') | media/base/audio_bus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698