summaryrefslogtreecommitdiffstats
path: root/content/renderer/pepper_plugin_delegate_impl.cc
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-21 19:19:24 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-21 19:19:24 +0000
commit4460ee53d9a79830f9445778d6473a49a22c4ba6 (patch)
treed3d3f740e7350c6b50cbf3bf5c9f9f01e3da9696 /content/renderer/pepper_plugin_delegate_impl.cc
parent224b6c13741261566e9e9c5a39adb3cef9d79213 (diff)
downloadchromium_src-4460ee53d9a79830f9445778d6473a49a22c4ba6.zip
chromium_src-4460ee53d9a79830f9445778d6473a49a22c4ba6.tar.gz
chromium_src-4460ee53d9a79830f9445778d6473a49a22c4ba6.tar.bz2
Move audio messages to their own file.
TBR=hclam Review URL: http://codereview.chromium.org/6717001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78903 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/pepper_plugin_delegate_impl.cc')
-rw-r--r--content/renderer/pepper_plugin_delegate_impl.cc29
1 files changed, 14 insertions, 15 deletions
diff --git a/content/renderer/pepper_plugin_delegate_impl.cc b/content/renderer/pepper_plugin_delegate_impl.cc
index 2acad4d..6f701fb 100644
--- a/content/renderer/pepper_plugin_delegate_impl.cc
+++ b/content/renderer/pepper_plugin_delegate_impl.cc
@@ -19,6 +19,7 @@
#include "chrome/common/render_messages.h"
#include "chrome/common/render_messages_params.h"
#include "chrome/renderer/render_thread.h"
+#include "content/common/audio_messages.h"
#include "content/common/child_process_messages.h"
#include "content/common/child_thread.h"
#include "content/common/file_system/file_system_dispatcher.h"
@@ -142,8 +143,7 @@ class PlatformAudioImpl
private:
// I/O thread backends to above functions.
- void InitializeOnIOThread(
- const ViewHostMsg_Audio_CreateStream_Params& params);
+ void InitializeOnIOThread(const AudioParameters& params);
void StartPlaybackOnIOThread();
void StopPlaybackOnIOThread();
void ShutDownOnIOThread();
@@ -152,7 +152,7 @@ class PlatformAudioImpl
LOG(FATAL) << "Should never get OnRequestPacket in PlatformAudioImpl";
}
- virtual void OnStateChanged(const ViewMsg_AudioStreamState_Params& state) {}
+ virtual void OnStateChanged(AudioStreamState state) {}
virtual void OnCreated(base::SharedMemoryHandle handle, uint32 length) {
LOG(FATAL) << "Should never get OnCreated in PlatformAudioImpl";
@@ -191,12 +191,12 @@ bool PlatformAudioImpl::Initialize(
client_ = client;
- ViewHostMsg_Audio_CreateStream_Params params;
- params.params.format = AudioParameters::AUDIO_PCM_LINEAR;
- params.params.channels = 2;
- params.params.sample_rate = sample_rate;
- params.params.bits_per_sample = 16;
- params.params.samples_per_packet = sample_count;
+ AudioParameters params;
+ params.format = AudioParameters::AUDIO_PCM_LINEAR;
+ params.channels = 2;
+ params.sample_rate = sample_rate;
+ params.bits_per_sample = 16;
+ params.samples_per_packet = sample_count;
filter_->message_loop()->PostTask(FROM_HERE,
NewRunnableMethod(this, &PlatformAudioImpl::InitializeOnIOThread,
@@ -230,20 +230,19 @@ void PlatformAudioImpl::ShutDown() {
NewRunnableMethod(this, &PlatformAudioImpl::ShutDownOnIOThread));
}
-void PlatformAudioImpl::InitializeOnIOThread(
- const ViewHostMsg_Audio_CreateStream_Params& params) {
+void PlatformAudioImpl::InitializeOnIOThread(const AudioParameters& params) {
stream_id_ = filter_->AddDelegate(this);
- filter_->Send(new ViewHostMsg_CreateAudioStream(0, stream_id_, params, true));
+ filter_->Send(new AudioHostMsg_CreateStream(0, stream_id_, params, true));
}
void PlatformAudioImpl::StartPlaybackOnIOThread() {
if (stream_id_)
- filter_->Send(new ViewHostMsg_PlayAudioStream(0, stream_id_));
+ filter_->Send(new AudioHostMsg_PlayStream(0, stream_id_));
}
void PlatformAudioImpl::StopPlaybackOnIOThread() {
if (stream_id_)
- filter_->Send(new ViewHostMsg_PauseAudioStream(0, stream_id_));
+ filter_->Send(new AudioHostMsg_PauseStream(0, stream_id_));
}
void PlatformAudioImpl::ShutDownOnIOThread() {
@@ -251,7 +250,7 @@ void PlatformAudioImpl::ShutDownOnIOThread() {
if (!stream_id_)
return;
- filter_->Send(new ViewHostMsg_CloseAudioStream(0, stream_id_));
+ filter_->Send(new AudioHostMsg_CloseStream(0, stream_id_));
filter_->RemoveDelegate(stream_id_);
stream_id_ = 0;