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

Issue 2219933003: Use LocalMediaStreamAudioSource for screen-casting use cases. (Closed)

Created:
4 years, 4 months ago by miu
Modified:
4 years, 4 months ago
Reviewers:
xjz, no sievers, o1ka
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, posciak+watch_chromium.org, jam, feature-media-reviews_chromium.org, darin-cc_chromium.org, mcasas+watch+vc_chromium.org, miu+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Use LocalMediaStreamAudioSource for screen-casting use cases. Adds a new MediaStreamAudioSource implementation for taking input from a local source, and passing it directly to sinks without going through the WebRTC MediaStreamAudioProcessor. This new implementation will be used by the screen casting use cases (e.g., tab or desktop audio capture). Before this change, even if the MediaStreamAudioProcessor was disabled, a rather large graph of objects, extra threads (for libjingle), and additional audio buffers were being created; with audio being copied into and out of the buffers; even though no processing was being done. BUG=577881, 638081 Committed: https://crrev.com/81c7ecbbe69b2be50bf2a6a30b4e88d72b09e249 Cr-Commit-Position: refs/heads/master@{#412333}

Patch Set 1 #

Total comments: 12

Patch Set 2 : Addressed comments on patch set 1 (mostly rewrote comments). #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+256 lines, -11 lines) Patch
M content/content_renderer.gypi View 1 1 chunk +2 lines, -0 lines 0 comments Download
M content/public/common/media_stream_request.h View 1 chunk +1 line, -0 lines 0 comments Download
M content/public/common/media_stream_request.cc View 1 chunk +11 lines, -4 lines 0 comments Download
A content/renderer/media/local_media_stream_audio_source.h View 1 chunk +58 lines, -0 lines 0 comments Download
A content/renderer/media/local_media_stream_audio_source.cc View 1 1 chunk +108 lines, -0 lines 2 comments Download
M content/renderer/media/media_stream_audio_processor.h View 1 1 chunk +11 lines, -0 lines 0 comments Download
M content/renderer/media/media_stream_audio_processor.cc View 1 3 chunks +50 lines, -3 lines 0 comments Download
M content/renderer/media/user_media_client_impl.cc View 1 2 chunks +13 lines, -3 lines 0 comments Download
M content/renderer/media/webrtc/processed_local_audio_source.cc View 1 2 chunks +2 lines, -1 line 0 comments Download

Messages

Total messages: 32 (18 generated)
miu
olka: PTAL. This is the last piece to finally resolve https://crbug.com/577881. Better late than never! ...
4 years, 4 months ago (2016-08-06 00:56:43 UTC) #4
miu
henrika: Can you PTAL? (Olga's OOO it seems.)
4 years, 4 months ago (2016-08-11 22:44:42 UTC) #8
miu
Hmm...Having trouble finding a code reviewer from the Stockholm team. So, will try a local ...
4 years, 4 months ago (2016-08-12 21:57:38 UTC) #10
xjz
LGTM https://codereview.chromium.org/2219933003/diff/1/content/renderer/media/media_stream_audio_processor.cc File content/renderer/media/media_stream_audio_processor.cc (right): https://codereview.chromium.org/2219933003/diff/1/content/renderer/media/media_stream_audio_processor.cc#newcode457 content/renderer/media/media_stream_audio_processor.cc:457: // MediaStreamAudioProcessor::InitializeAudioProcessingModule(). nit: The logic here is in ...
4 years, 4 months ago (2016-08-13 00:43:56 UTC) #11
henrika (OOO until Aug 14)
Olga is back today and she knows this code base much better than I do ...
4 years, 4 months ago (2016-08-15 10:50:25 UTC) #12
o1ka
Sorry for the delay. A couple of questions: https://codereview.chromium.org/2219933003/diff/1/content/renderer/media/local_media_stream_audio_source.cc File content/renderer/media/local_media_stream_audio_source.cc (right): https://codereview.chromium.org/2219933003/diff/1/content/renderer/media/local_media_stream_audio_source.cc#newcode29 content/renderer/media/local_media_stream_audio_source.cc:29: device_info.device.input.sample_rate ...
4 years, 4 months ago (2016-08-15 15:15:00 UTC) #15
miu
o1ka: Thanks, PTAL. sievers: Need OWNERS RS for additions to content/public/common/media_stream_request.*. https://codereview.chromium.org/2219933003/diff/1/content/renderer/media/local_media_stream_audio_source.cc File content/renderer/media/local_media_stream_audio_source.cc (right): ...
4 years, 4 months ago (2016-08-16 04:30:02 UTC) #16
o1ka
Thank you, the changes in naming and comments do make a difference. lgtm https://codereview.chromium.org/2219933003/diff/1/content/renderer/media/local_media_stream_audio_source.h File ...
4 years, 4 months ago (2016-08-16 14:18:11 UTC) #22
miu
https://codereview.chromium.org/2219933003/diff/1/content/renderer/media/local_media_stream_audio_source.h File content/renderer/media/local_media_stream_audio_source.h (right): https://codereview.chromium.org/2219933003/diff/1/content/renderer/media/local_media_stream_audio_source.h#newcode18 content/renderer/media/local_media_stream_audio_source.h:18: class CONTENT_EXPORT LocalMediaStreamAudioSource On 2016/08/16 14:18:11, o1ka wrote: > ...
4 years, 4 months ago (2016-08-16 20:13:39 UTC) #23
no sievers
content/public lgtm stamp
4 years, 4 months ago (2016-08-16 20:33:55 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2219933003/20001
4 years, 4 months ago (2016-08-16 20:55:32 UTC) #27
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 4 months ago (2016-08-16 20:59:39 UTC) #29
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/81c7ecbbe69b2be50bf2a6a30b4e88d72b09e249 Cr-Commit-Position: refs/heads/master@{#412333}
4 years, 4 months ago (2016-08-16 21:01:46 UTC) #31
o1ka
4 years, 4 months ago (2016-08-17 08:02:17 UTC) #32
Message was sent while issue was closed.
On 2016/08/16 20:13:39, miu wrote:
>
https://codereview.chromium.org/2219933003/diff/1/content/renderer/media/loca...
> File content/renderer/media/local_media_stream_audio_source.h (right):
> 
>
https://codereview.chromium.org/2219933003/diff/1/content/renderer/media/loca...
> content/renderer/media/local_media_stream_audio_source.h:18: class
> CONTENT_EXPORT LocalMediaStreamAudioSource
> On 2016/08/16 14:18:11, o1ka wrote:
> > I just find it easier to read the code when naming reflects inheritance
> > hierarchy. (ProcessedLocalMediaStreamAudioSource is unfortunately too long
:)
> )
> > No, I don't feel super-strongly, just a little annoyed that I have to
embrace
> > and memorize that those classes are siblings :)
> 
> I can understand this concern. FWIW, the other two implementations of
> MediaStreamAudioSource, ExternalMediaStreamAudioSource and
> PeerConnectionRemoteAudioSource, don't do processing either. So, if anything,
> the ProcessedLocalAudioSource is the only "special" one to remember. ;-)
> 
>
https://codereview.chromium.org/2219933003/diff/20001/content/renderer/media/...
> File content/renderer/media/local_media_stream_audio_source.cc (right):
> 
>
https://codereview.chromium.org/2219933003/diff/20001/content/renderer/media/...
> content/renderer/media/local_media_stream_audio_source.cc:22: int
> frames_per_buffer = device_info.device.input.frames_per_buffer;
> On 2016/08/16 14:18:11, o1ka wrote:
> > I would prefer to avoid the duplication: now we have this weird  Android
hack
> in
> > two places. Can it be a function which calculates it? (I still think it's a
> good
> > idea to keep buffer size changes separated from this CL: we already had some
> > problems with buffer size changes before, it requires a separate attention)
> 
> Yeah, the duplication bothered me a little too. The options here are:
> 
>   1. Find a centralized place for the GetBufferSize() code (only two of the
> MSAudioSources actually need it). It's not exactly clear where this should
live.
> Maybe as a static function in the base class, even though other subclasses
don't
> need it?
> 
>   2. Keep it in two places, both referencing the same crbug; and hope we can
> delete it soon.
> 
> Based on henrika's recent comments in the crbug, option 2 looks much more
> attractive to me. That makes this duplicated code temporary. In fact, I'll
just
> follow-up on this now and see if I can get this stuff deleted in a follow-up
> CL...

Sounds good!

Powered by Google App Engine
This is Rietveld 408576698