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

Side by Side Diff: remoting/client/plugin/pepper_audio_player.h

Issue 2052723002: Adding an interface to allow extention of the audio player for CRD and iOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing comments in CL. Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef REMOTING_CLIENT_PLUGIN_PEPPER_AUDIO_PLAYER_H_ 5 #ifndef REMOTING_CLIENT_PLUGIN_PEPPER_AUDIO_PLAYER_H_
6 #define REMOTING_CLIENT_PLUGIN_PEPPER_AUDIO_PLAYER_H_ 6 #define REMOTING_CLIENT_PLUGIN_PEPPER_AUDIO_PLAYER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/weak_ptr.h"
12 #include "ppapi/cpp/audio.h" 13 #include "ppapi/cpp/audio.h"
13 #include "ppapi/cpp/instance.h" 14 #include "ppapi/cpp/instance.h"
14 #include "remoting/client/audio_player.h" 15 #include "remoting/client/audio_player.h"
15 #include "remoting/proto/audio.pb.h" 16 #include "remoting/proto/audio.pb.h"
16 17
17 namespace remoting { 18 namespace remoting {
18 19
19 class PepperAudioPlayer : public AudioPlayer { 20 class PepperAudioPlayer : public AudioPlayer {
20 public: 21 public:
21 explicit PepperAudioPlayer(pp::Instance* instance); 22 explicit PepperAudioPlayer(pp::Instance* instance);
22 ~PepperAudioPlayer() override; 23 ~PepperAudioPlayer() override;
23 24
24 uint32_t GetSamplesPerFrame() override; 25 uint32_t GetSamplesPerFrame() override;
25 26
26 bool ResetAudioPlayer(AudioPacket::SamplingRate sampling_rate) override; 27 bool ResetAudioPlayer(AudioPacket::SamplingRate sampling_rate) override;
27 28
29 base::WeakPtr<PepperAudioPlayer> GetWeakPtr();
30
28 private: 31 private:
29 pp::Instance* instance_; 32 pp::Instance* instance_;
30 pp::Audio audio_; 33 pp::Audio audio_;
31 34
32 // The count of sample frames per channel in an audio buffer. 35 // The count of sample frames per channel in an audio buffer.
33 uint32_t samples_per_frame_; 36 uint32_t samples_per_frame_;
34 37
38 base::WeakPtrFactory<PepperAudioPlayer> weak_factory_;
39
35 DISALLOW_COPY_AND_ASSIGN(PepperAudioPlayer); 40 DISALLOW_COPY_AND_ASSIGN(PepperAudioPlayer);
36 }; 41 };
37 42
38 } // namespace remoting 43 } // namespace remoting
39 44
40 #endif // REMOTING_CLIENT_PLUGIN_PEPPER_AUDIO_PLAYER_H_ 45 #endif // REMOTING_CLIENT_PLUGIN_PEPPER_AUDIO_PLAYER_H_
OLDNEW
« no previous file with comments | « remoting/client/plugin/chromoting_instance.cc ('k') | remoting/client/plugin/pepper_audio_player.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698