diff options
author | henrika@chromium.org <henrika@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-11 08:38:14 +0000 |
---|---|---|
committer | henrika@chromium.org <henrika@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-11 08:38:14 +0000 |
commit | 15c0e988468004e7cb3de746084e65b3c9a32c5d (patch) | |
tree | d650475e78ca311c9290c62cb50e0bbcb2527536 /webkit/media | |
parent | dad804c692d856e33a85c9ecb530f5c071411401 (diff) | |
download | chromium_src-15c0e988468004e7cb3de746084e65b3c9a32c5d.zip chromium_src-15c0e988468004e7cb3de746084e65b3c9a32c5d.tar.gz chromium_src-15c0e988468004e7cb3de746084e65b3c9a32c5d.tar.bz2 |
Adds support of local audio streams for more than one media player.
Main goal is to allow the user to use a local stream as source for more than one audio element. Adding the stream to one extra element will result in an increased output volume and the possibility to tune the volume on each element. If two elements are used, both elements must be muted to silence the audio.
The design is now more clear since more work is done in the local renderer and not divided between the capturer (which used to own the FIFO) and the local renderer. The capturer only dispatches the recorded audio out to its sinks and they deal with the rest.
- Removes auto-mute on local media streams when rendered by a media player.
- Moves local FIFO from WebRtcAudioCapturer to WebRtcLocalAudioRenderer.
- Now allows multiple WebRtcLocalAudioRenderer objects where each instance creates its own output stream.
- Adds support for the enabled attribute on the MediaStreamTrack object.
BUG=none
TEST=All existing WebRTC demos and a new test at: https://www.corp.google.com/~henrika/webrtc/multi_local_rendering.html
TBR=wjia@chromium.org
Review URL: https://codereview.chromium.org/12599002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@187252 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/media')
-rw-r--r-- | webkit/media/webmediaplayer_ms.cc | 18 | ||||
-rw-r--r-- | webkit/media/webmediaplayer_ms.h | 4 |
2 files changed, 2 insertions, 20 deletions
diff --git a/webkit/media/webmediaplayer_ms.cc b/webkit/media/webmediaplayer_ms.cc index ba8231a..fc21a3a 100644 --- a/webkit/media/webmediaplayer_ms.cc +++ b/webkit/media/webmediaplayer_ms.cc @@ -53,8 +53,7 @@ WebMediaPlayerMS::WebMediaPlayerMS( sequence_started_(false), total_frame_count_(0), dropped_frame_count_(0), - media_log_(media_log), - volume_modified_(false) { + media_log_(media_log) { DVLOG(1) << "WebMediaPlayerMS::ctor"; DCHECK(media_stream_client); media_log_->AddEvent( @@ -196,21 +195,8 @@ void WebMediaPlayerMS::setVolume(float volume) { DCHECK(thread_checker_.CalledOnValidThread()); if (!audio_renderer_) return; - - // The first time setVolume() is called, the call will come from WebKit's - // initialization code, not from javascript. For local video streams we - // have this temporary workaround for WebRTC applications that automatically - // mutes the audio output of locally captured streams when the stream is - // assigned to a video or audio tag. - // So, when WebKit calls us, we set the volume to 0 (mute) for local - // audio streams only but subsequent calls will actually set the volume - // since those calls will be from the application. - // More details here: http://crbug.com/164811. - if (!volume_modified_ && audio_renderer_->IsLocalRenderer()) - volume = 0.0f; - + DVLOG(1) << "WebMediaPlayerMS::setVolume(volume=" << volume << ")"; audio_renderer_->SetVolume(volume); - volume_modified_ = true; } void WebMediaPlayerMS::setVisible(bool visible) { diff --git a/webkit/media/webmediaplayer_ms.h b/webkit/media/webmediaplayer_ms.h index 68a00e5..9d2d43e 100644 --- a/webkit/media/webmediaplayer_ms.h +++ b/webkit/media/webmediaplayer_ms.h @@ -176,10 +176,6 @@ class WebMediaPlayerMS scoped_refptr<media::MediaLog> media_log_; - // Used to auto mute the local media streams when getting the first - // SetVolume() from WebMediaPlayer. - bool volume_modified_; - DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerMS); }; |