• Guido Urdaneta's avatar
    Serialize MediaStreamTrack.stop() with getUserMedia() · a58c8bd6
    Guido Urdaneta authored
    When multiple getUserMedia and stop() requests are active concurrently, 
    getUserMedia() sometimes fails with TrackStartError.
    The reason is that the underlying video capture subsystem does not keep
    a count of how many sources have opened a video device.
    It can happen that a stop request stops video capture while a 
    getUserMedia() request is being processed, with the result being that
    the video device is closed before getUserMedia() starts the new video
    track, resulting in an error.
    
    One solution to this problem is to make sure that stop requests and
    getUserMedia() requests cannot run concurrently, which is the approach
    followed by this CL.
    
    This CL basically moves handling of MediaStramTrack.stop() from 
    MediaStreamCenter to UserMediaClient, and puts stop() requests in the
    same queue used for getUserMedia() and applyConstraints() requests.
    
    
    Bug: 778039
    Change-Id: Id7e0ee38e40265fd599dc6dd0712f0b667d2e1a5
    Reviewed-on: https://chromium-review.googlesource.com/751981Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
    Reviewed-by: default avatarHenrik Boström <hbos@chromium.org>
    Commit-Queue: Guido Urdaneta <guidou@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#515494}
    a58c8bd6
media_stream_track.h 1.83 KB