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

Unified Diff: remoting/client/plugin/pepper_audio_player.h

Issue 10795066: Support for both 44.1 kHz and 48 kHz on the client. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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: remoting/client/plugin/pepper_audio_player.h
diff --git a/remoting/client/plugin/pepper_audio_player.h b/remoting/client/plugin/pepper_audio_player.h
index 925b0dcda7deba659eae63093b992d90fac3104e..14309bb61de36407e49d0ac733dd3dc2f4d52b9f 100644
--- a/remoting/client/plugin/pepper_audio_player.h
+++ b/remoting/client/plugin/pepper_audio_player.h
@@ -15,11 +15,10 @@
#include "ppapi/cpp/audio.h"
#include "ppapi/cpp/instance.h"
#include "remoting/client/audio_player.h"
+#include "remoting/proto/audio.pb.h"
namespace remoting {
-class AudioPacket;
-
class PepperAudioPlayer : public AudioPlayer {
public:
explicit PepperAudioPlayer(pp::Instance* instance);
@@ -35,6 +34,14 @@ class PepperAudioPlayer : public AudioPlayer {
private:
typedef std::list<AudioPacket*> AudioPacketQueue;
+ bool DoStart();
+ void DoStop();
+
+ PP_AudioSampleRate ConvertToPepperSampleRate(
+ AudioPacket::SamplingRate sampling_rate);
+
+ void ResetAudioPlayer(AudioPacket::SamplingRate sampling_rate);
+
// Function called by the browser when it needs more audio samples.
static void PepperAudioPlayerCallback(void* samples,
uint32_t buffer_size,
@@ -42,8 +49,11 @@ class PepperAudioPlayer : public AudioPlayer {
void FillWithSamples(void* samples, uint32_t buffer_size);
+ pp::Instance* instance_;
pp::Audio audio_;
+ AudioPacket::SamplingRate sampling_rate_;
+
// The count of sample frames per channel in an audio buffer.
uint32_t samples_per_frame_;
@@ -57,6 +67,7 @@ class PepperAudioPlayer : public AudioPlayer {
// The number of bytes from |queued_packets_| that have been consumed.
size_t bytes_consumed_;
+ // Equal to true, only if Start() has been called.
Sergey Ulanov 2012/07/23 22:01:47 this comment seems to be redundant. maybe just ren
kxing 2012/07/23 22:58:47 Done.
bool running_;
DISALLOW_COPY_AND_ASSIGN(PepperAudioPlayer);
« no previous file with comments | « no previous file | remoting/client/plugin/pepper_audio_player.cc » ('j') | remoting/client/plugin/pepper_audio_player.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698