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

Unified Diff: content/renderer/pepper/pepper_media_stream_audio_track_host.h

Issue 290993005: Support configuring number of audio buffers in MediaStream Pepper API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix uninitialized variable Created 6 years, 7 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 | « AUTHORS ('k') | content/renderer/pepper/pepper_media_stream_audio_track_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/pepper_media_stream_audio_track_host.h
diff --git a/content/renderer/pepper/pepper_media_stream_audio_track_host.h b/content/renderer/pepper/pepper_media_stream_audio_track_host.h
index 8c0706f2b2d89b540d9761f8004ebc929f311a17..348103c9928c55faa4c7beca1e0259b2347e07a4 100644
--- a/content/renderer/pepper/pepper_media_stream_audio_track_host.h
+++ b/content/renderer/pepper/pepper_media_stream_audio_track_host.h
@@ -15,6 +15,7 @@
#include "content/public/renderer/media_stream_audio_sink.h"
#include "content/renderer/pepper/pepper_media_stream_track_host_base.h"
#include "media/audio/audio_parameters.h"
+#include "ppapi/shared_impl/media_stream_audio_track_shared.h"
#include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
namespace base {
@@ -43,10 +44,14 @@ class PepperMediaStreamAudioTrackHost : public PepperMediaStreamTrackHostBase {
// This function is called on the main thread.
void EnqueueBuffer(int32_t index);
+ // This function is called on the main thread.
+ void Configure(int32_t number_of_buffers);
+
private:
// Initializes buffers on the main thread.
- void InitBuffersOnMainThread(int32_t number_of_buffers,
- int32_t buffer_size);
+ void SetFormatOnMainThread(int bytes_per_second);
+
+ void InitBuffers();
// Send enqueue buffer message on the main thread.
void SendEnqueueBufferMessageOnMainThread(int32_t index);
@@ -99,11 +104,27 @@ class PepperMediaStreamAudioTrackHost : public PepperMediaStreamTrackHostBase {
base::WeakPtrFactory<AudioSink> weak_factory_;
+ // Number of buffers.
+ int32_t number_of_buffers_;
+
+ // Number of bytes per second.
+ int bytes_per_second_;
+
DISALLOW_COPY_AND_ASSIGN(AudioSink);
};
virtual ~PepperMediaStreamAudioTrackHost();
+ // ResourceMessageHandler overrides:
+ virtual int32_t OnResourceMessageReceived(
+ const IPC::Message& msg,
+ ppapi::host::HostMessageContext* context) OVERRIDE;
+
+ // Message handlers:
+ int32_t OnHostMsgConfigure(
+ ppapi::host::HostMessageContext* context,
+ const ppapi::MediaStreamAudioTrackShared::Attributes& attributes);
+
// PepperMediaStreamTrackHostBase overrides:
virtual void OnClose() OVERRIDE;
« no previous file with comments | « AUTHORS ('k') | content/renderer/pepper/pepper_media_stream_audio_track_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698