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

Issue 2622643006: Reland of Fix getUserMedia so that failure is reported for invalid audio sources. (Closed)

Created:
3 years, 11 months ago by tommi (sloooow) - chröme
Modified:
3 years, 11 months ago
CC:
avayvod+watch_chromium.org, chfremer+watch_chromium.org, chromium-reviews, darin-cc_chromium.org, einbinder+watch-test-runner_chromium.org, feature-media-reviews_chromium.org, imcheng+watch_chromium.org, isheriff+watch_chromium.org, jam, jasonroberts+watch_google.com, jochen+watch_chromium.org, mcasas+watch+vc_chromium.org, miu+watch_chromium.org, mlamouri+watch-content_chromium.org, mlamouri+watch-test-runner_chromium.org, Peter Beverloo, posciak+watch_chromium.org, xjz+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Reland of Fix getUserMedia so that failure is reported for invalid audio sources. (patchset #1 id:1 of https://codereview.chromium.org/2626533002/ ) Reason for revert: Preparing reland Original issue's description: > Revert of Fix getUserMedia so that failure is reported for invalid audio sources. (patchset #2 id:20001 of https://codereview.chromium.org/2623443002/ ) > > Reason for revert: > Revert due to WebRTC tests failing: > > https://uberchromegw.corp.google.com/i/chromium.win/builders/Win7%20Tests%20%28dbg%29%281%29/builds/56312 > > [4832:364:0109/131325.673:4351226:ERROR:browser_test_utils.cc(147)] Cannot communicate with DOMMessageQueue. > c:\c\win\src\contentrowser\webrtc\webrtc_content_browsertest_base.cc(66): error: Value of: ExecuteScriptAndExtractString(shell(), javascript, &result) > Actual: false > Expected: true > Failed to execute javascript callAndRenegotiateToVideo({audio: true}, {audio: true, video:true});. > From javascript: (nothing) > When executing 'callAndRenegotiateToVideo({audio: true}, {audio: true, video:true});' > c:\c\win\src\contentrowser\webrtc\webrtc_content_browsertest_base.cc(90): error: Failed > > and > > [4704:4156:0109/131352.840:4378402:ERROR:browser_test_utils.cc(147)] Cannot communicate with DOMMessageQueue. > c:\c\win\src\contentrowser\webrtc\webrtc_content_browsertest_base.cc(66): error: Value of: ExecuteScriptAndExtractString(shell(), javascript, &result) > Actual: false > Expected: true > Failed to execute javascript getUserMediaInIframeAndCloseInSuccessCb({audio: true});. > From javascript: (nothing) > When executing 'getUserMediaInIframeAndCloseInSuccessCb({audio: true});' > c:\c\win\src\contentrowser\webrtc\webrtc_content_browsertest_base.cc(90): error: Failed > > Original issue's description: > > Fix getUserMedia so that failure is reported for invalid audio sources. > > This changes getUserMedia to wait for initialization of local > > audio sources before issuing the completion callback (either success or > > failure). > > Previously, if an error occurs between attempting to start a local > > audio source and the render side OnStreamCreated callback, getUserMedia > > would report successful completion with an audio track but no audio > > would actually be delivered for that track. > > > > BUG=679210 > > CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel > > > > Review-Url: https://codereview.chromium.org/2623443002 > > Cr-Commit-Position: refs/heads/master@{#442323} > > Committed: https://chromium.googlesource.com/chromium/src/+/81cb66acf3f8099e416c7fc5ecbcaabf6d5c3c04 > > TBR=jochen@chromium.org,guidou@chromium.org,xhwang@chromium.org,tommi@chromium.org > # Skipping CQ checks because original CL landed less than 1 days ago. > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=679210 > > Review-Url: https://codereview.chromium.org/2626533002 > Cr-Commit-Position: refs/heads/master@{#442373} > Committed: https://chromium.googlesource.com/chromium/src/+/f05caaa1349e44abd44a00f88506bf140a0bc887 TBR=jochen@chromium.org,guidou@chromium.org,xhwang@chromium.org,dewittj@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. BUG=679210 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Review-Url: https://codereview.chromium.org/2622643006 Cr-Commit-Position: refs/heads/master@{#442628} Committed: https://chromium.googlesource.com/chromium/src/+/5d02cf8e38acafeea410906105d5fc11c3e3395b

Patch Set 1 #

Patch Set 2 : Handle case in debug builds where content_browsertests exit without cleaning up state #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+414 lines, -130 lines) Patch
M chrome/renderer/media/cast_receiver_audio_valve.h View 1 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/renderer/media/cast_receiver_audio_valve.cc View 1 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/renderer/media/cast_receiver_session_delegate.cc View 1 1 chunk +2 lines, -1 line 0 comments Download
M content/renderer/media/external_media_stream_audio_source.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/media/external_media_stream_audio_source.cc View 1 2 chunks +8 lines, -1 line 0 comments Download
M content/renderer/media/local_media_stream_audio_source.h View 1 3 chunks +6 lines, -1 line 0 comments Download
M content/renderer/media/local_media_stream_audio_source.cc View 1 2 chunks +8 lines, -2 lines 0 comments Download
M content/renderer/media/rtc_peer_connection_handler_unittest.cc View 1 2 chunks +6 lines, -2 lines 0 comments Download
M content/renderer/media/user_media_client_impl.h View 1 7 chunks +49 lines, -7 lines 0 comments Download
M content/renderer/media/user_media_client_impl.cc View 1 10 chunks +198 lines, -99 lines 1 comment Download
M content/renderer/media/user_media_client_impl_unittest.cc View 1 3 chunks +18 lines, -1 line 0 comments Download
M content/renderer/media/webrtc/processed_local_audio_source.h View 1 4 chunks +7 lines, -2 lines 0 comments Download
M content/renderer/media/webrtc/processed_local_audio_source.cc View 1 3 chunks +8 lines, -8 lines 0 comments Download
M content/renderer/media/webrtc/processed_local_audio_source_unittest.cc View 1 3 chunks +11 lines, -2 lines 0 comments Download
M content/renderer/media/webrtc/webrtc_media_stream_adapter_unittest.cc View 1 2 chunks +6 lines, -2 lines 0 comments Download
M content/shell/renderer/layout_test/blink_test_runner.cc View 1 1 chunk +12 lines, -2 lines 0 comments Download
M media/audio/audio_input_device.cc View 1 1 chunk +6 lines, -0 lines 0 comments Download
M media/audio/audio_input_device_unittest.cc View 1 3 chunks +53 lines, -0 lines 0 comments Download
M media/base/audio_capturer_source.h View 1 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 18 (5 generated)
tommi (sloooow) - chröme
Created Reland of Fix getUserMedia so that failure is reported for invalid audio sources.
3 years, 11 months ago (2017-01-10 10:41:10 UTC) #1
tommi (sloooow) - chröme
On 2017/01/10 10:41:10, tommi (chrömium) wrote: > Created Reland of Fix getUserMedia so that failure ...
3 years, 11 months ago (2017-01-10 10:56:45 UTC) #2
tommi (sloooow) - chröme
Handle case in debug builds where content_browsertests exit without cleaning up state
3 years, 11 months ago (2017-01-10 15:03:51 UTC) #3
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/2622643006/250001
3 years, 11 months ago (2017-01-10 15:06:52 UTC) #7
commit-bot: I haz the power
Committed patchset #2 (id:250001) as https://chromium.googlesource.com/chromium/src/+/5d02cf8e38acafeea410906105d5fc11c3e3395b
3 years, 11 months ago (2017-01-10 18:00:38 UTC) #10
dewittj
not lgtm - this CL should have been reviewed before landing.
3 years, 11 months ago (2017-01-10 18:18:52 UTC) #11
tommi (sloooow) - chröme
On 2017/01/10 18:18:52, dewittj wrote: > not lgtm - this CL should have been reviewed ...
3 years, 11 months ago (2017-01-10 18:53:51 UTC) #12
dewittj
I didn't read the new code, but I don't see a reason to skip the ...
3 years, 11 months ago (2017-01-10 19:35:03 UTC) #13
tommi (sloooow) - chröme
A revert of this CL (patchset #2 id:250001) has been created in https://codereview.chromium.org/2628603003/ by tommi@chromium.org. ...
3 years, 11 months ago (2017-01-10 19:36:55 UTC) #14
tommi (sloooow) - chröme
On 2017/01/10 19:35:03, dewittj wrote: > I didn't read the new code, but I don't ...
3 years, 11 months ago (2017-01-10 19:40:47 UTC) #15
miu
Since this touches a lot of code I spent a long time refactoring, I'd like ...
3 years, 11 months ago (2017-01-10 21:20:32 UTC) #16
tommi (sloooow) - chröme
I made a change last week that does exactly that (fires onended as soon as ...
3 years, 11 months ago (2017-01-10 22:25:53 UTC) #17
chromium-reviews
3 years, 11 months ago (2017-01-11 18:43:48 UTC) #18
Message was sent while issue was closed.
So, IIUC, the spec requires getUserMedia() run the rejection callback if a
device can't be accessed instead of later shutting down the source
on-error? I'm looking at GUM algorithm steps 6.2.4 and 10
<https://www.w3.org/TR/mediacapture-streams/#dom-mediadevices-getusermedia>.
Is this what you're trying to fix?

Sure, I can help w/ code reviews and general discussion of approaches.


On Tue, Jan 10, 2017 at 2:25 PM, Tommi <tommi@chromium.org> wrote:

> I made a change last week that does exactly that (fires onended as soon as
> the source has finished initializing). So as is, we're in a better state
> than we were but we're not spec compliant until we fire an error if
> actually can't access the devices.
>
> The reason I did that first step is because this is complicated. At the
> heart of what makes it complicated is that we have a synchronous
> EnsureSourceIsStarted method (on my phone right now, don't recall the exact
> name) that returns a bool. Changing that design to support an asynchronous
> callback would probably be the right thing but it's a bigger change than
> this approach, which is to only change the way local audio sources are
> initialized during a getUserMedia call.
>
> I'm open to suggestions and better yet, if you could work with me on this,
> that would be great. Olga might be able to help too but I know she's busy
> with the mojo work for audio. There are more issues with audio source
> initialization that I'm looking at, including issues with how our stats are
> reported and I would really like it if we could be in a better shape than
> we are in 56 and earlier. I unfortunately have to do a lot of juggling of
> various tasks :-)
>
> On Tue, Jan 10, 2017, 22:20 <miu@chromium.org> wrote:
>
>> Since this touches a lot of code I spent a long time refactoring, I'd
>> like to
>> review the next attempt (olka@ is also very familiar with this code).
>>
>> Looking at this patch, I feel there's a lot of complexity introduced in
>> the
>> start-up workflow now (extra OnCaptureStarted() thread-hopping, a new
>> "pending
>> source" list in UMCImpl, etc.). Granted, maybe I don't understand the big
>> picture, and this is actually necessary complexity. However, consider
>> whether
>> this simpler scheme would work:
>>
>> 1. How about we just start the tracks optimistically (as we do now)? If
>> the
>> source later fails to start, MediaStreamAudioTrack::StopSourceOnError()
>> should
>> be called. This will set the ready state to "ended" for the source and
>> notify
>> the web platform.
>>
>> 2. What isn't happening now, but perhaps is what really motivated this
>> change,
>> is to also "end" the tracks when the source is ended. That can be
>> accomplished
>> by simply adding the following to MediaStreamAudioSource::DoStopSource():
>>
>> std::Vector<MediaStreamTrack*> tracks;
>> deliverer_->GetConsumerList(tracks);
>> for (MediaStreamTrack* track : tracks)
>> track->Stop();
>>
>> 3. There doesn't seem to be any error API in the W3C spec right now. I
>> assume
>> web pages are supposed to use "onEnded" events to react to errors that
>> end a
>> source/track?
>>
>>
>> https://codereview.chromium.org/2622643006/
>>
>

-- 
You received this message because you are subscribed to the Google Groups
"Chromium-reviews" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698