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

Unified 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 bots 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/peer_connection_audio_sink_owner.h
diff --git a/content/renderer/media/peer_connection_audio_sink_owner.h b/content/renderer/media/peer_connection_audio_sink_owner.h
new file mode 100644
index 0000000000000000000000000000000000000000..44cfef89bfc55e0a32d7d4e3508559946c09cad5
--- /dev/null
+++ b/content/renderer/media/peer_connection_audio_sink_owner.h
@@ -0,0 +1,53 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_RENDERER_MEDIA_PEER_CONNECTION_AUDIO_SINK_OWNER_H_
+#define CONTENT_RENDERER_MEDIA_PEER_CONNECTION_AUDIO_SINK_OWNER_H_
+
+#include <vector>
+
+#include "base/synchronization/lock.h"
+#include "content/renderer/media/media_stream_audio_track_sink.h"
+
+namespace content {
+
+class PeerConnectionAudioSink;
+
+// Reference counted holder of PeerConnectionAudioSink.
Alpha Left Google 2013/12/02 19:11:38 This class looks very similar to MediaStreamAudioS
no longer working on chromium 2013/12/03 11:45:45 I think you want Patch Set 3, where I was asked to
+class PeerConnectionAudioSinkOwner
+ : public MediaStreamAudioTrackSink {
+ public:
+ explicit PeerConnectionAudioSinkOwner(PeerConnectionAudioSink* sink);
+
+ // MediaStreamAudioTrackSink implementation.
+ virtual int OnData(const int16* audio_data,
+ int sample_rate,
+ int number_of_channels,
+ int number_of_frames,
+ const std::vector<int>& channels,
+ int audio_delay_milliseconds,
+ int current_volume,
+ bool need_audio_processing,
+ bool key_pressed) OVERRIDE;
+ virtual void OnSetFormat(const media::AudioParameters& params) OVERRIDE;
+ virtual void Reset() OVERRIDE;
+ virtual bool IsEqual(const MediaStreamAudioSink* other) const OVERRIDE;
+ virtual bool IsEqual(const PeerConnectionAudioSink* other) const OVERRIDE;
+
+ protected:
+ virtual ~PeerConnectionAudioSinkOwner() {}
+
+ private:
+ mutable base::Lock lock_;
+
+ // Raw pointer to the delegate, the client need to call Reset() to set the
+ // pointer to NULL before the delegate goes away.
+ PeerConnectionAudioSink* delegate_;
+
+ DISALLOW_COPY_AND_ASSIGN(PeerConnectionAudioSinkOwner);
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_MEDIA_PEER_CONNECTION_AUDIO_SINK_OWNER_H_

Powered by Google App Engine
This is Rietveld 408576698