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

Side by Side Diff: content/renderer/media/peer_connection_audio_sink_owner.h

Issue 90743004: Add generic interfaces for the sinks of the media stream audio track (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed the nits. Created 7 years 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_RENDERER_MEDIA_PEER_CONNECTION_AUDIO_SINK_OWNER_H_
6 #define CONTENT_RENDERER_MEDIA_PEER_CONNECTION_AUDIO_SINK_OWNER_H_
7
8 #include <vector>
9
10 #include "base/synchronization/lock.h"
11 #include "content/renderer/media/media_stream_audio_track_sink.h"
12
13 namespace content {
14
15 class PeerConnectionAudioSink;
16
17 // Reference counted holder of PeerConnectionAudioSink.
18 class PeerConnectionAudioSinkOwner : public MediaStreamAudioTrackSink {
19 public:
20 explicit PeerConnectionAudioSinkOwner(PeerConnectionAudioSink* sink);
21
22 // MediaStreamAudioTrackSink implementation.
23 virtual int OnData(const int16* audio_data,
24 int sample_rate,
25 int number_of_channels,
26 int number_of_frames,
27 const std::vector<int>& channels,
28 int audio_delay_milliseconds,
29 int current_volume,
30 bool need_audio_processing,
31 bool key_pressed) OVERRIDE;
32 virtual void OnSetFormat(const media::AudioParameters& params) OVERRIDE;
33 virtual void Reset() OVERRIDE;
34 virtual bool IsEqual(const MediaStreamAudioSink* other) const OVERRIDE;
35 virtual bool IsEqual(const PeerConnectionAudioSink* other) const OVERRIDE;
36
37 protected:
38 virtual ~PeerConnectionAudioSinkOwner() {}
39
40 private:
41 mutable base::Lock lock_;
42
43 // Raw pointer to the delegate, the client need to call Reset() to set the
44 // pointer to NULL before the delegate goes away.
45 PeerConnectionAudioSink* delegate_;
46
47 DISALLOW_COPY_AND_ASSIGN(PeerConnectionAudioSinkOwner);
48 };
49
50 } // namespace content
51
52 #endif // CONTENT_RENDERER_MEDIA_PEER_CONNECTION_AUDIO_SINK_OWNER_H_
OLDNEW
« no previous file with comments | « content/renderer/media/media_stream_track_extra_data.cc ('k') | content/renderer/media/peer_connection_audio_sink_owner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698