Bug 172831 - A cloned MediaStreamTrack should mute independently other tracks using the same source
Summary: A cloned MediaStreamTrack should mute independently other tracks using the sa...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
: 174126 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-06-01 13:06 PDT by Prerak Jain
Modified: 2017-07-10 13:30 PDT (History)
6 users (show)

See Also:


Attachments
Patch (58.28 KB, patch)
2017-06-16 16:15 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (58.57 KB, patch)
2017-06-16 16:20 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Fixes build (62.77 KB, patch)
2017-06-16 16:57 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Fixing build again (68.58 KB, patch)
2017-06-16 17:25 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Prerak Jain 2017-06-01 13:06:45 PDT
MediaStreamTrack clone API just clones the track but not the media source, as a result, if a track is muted/stopped it will mute/stop the media source and all the tracks associated with media source will be affected. A change in state of a track using a media source should not impact the other tracks using the same media source.
Comment 1 Radar WebKit Bug Importer 2017-06-01 13:16:57 PDT
<rdar://problem/32518527>
Comment 2 youenn fablet 2017-06-01 13:18:04 PDT
(In reply to Prerak Jain from comment #0)
> MediaStreamTrack clone API just clones the track but not the media source,
> as a result, if a track is muted/stopped it will mute/stop the media source
> and all the tracks associated with media source will be affected. A change
> in state of a track using a media source should not impact the other tracks
> using the same media source.

There are things that can be done in terms of stopping/muting.
If it comes to properties of the source (width, height, echo cancellation...), that may be harder.
Comment 3 youenn fablet 2017-06-16 16:15:37 PDT
Created attachment 313153 [details]
Patch
Comment 4 youenn fablet 2017-06-16 16:20:25 PDT
Created attachment 313154 [details]
Patch
Comment 5 Eric Carlson 2017-06-16 16:31:31 PDT
Comment on attachment 313153 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=313153&action=review

> Source/WebCore/ChangeLog:11
> +        Moving enabled handling in MediaStreamTrackPrivate instead of RealtimeMediaSource.

Nit: "Moving enabled handling in" => "Move enabled handling to"

> Source/WebCore/ChangeLog:13
> +        Moving WebRTC and WebAudio customers of RealtimeMediaSource to MediaStreamTrackPrivate.
> +        Moving creation of WebAudio provider to MediaStreamTrackPrivate.

Nit: "Moving" => "Move"

> Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.cpp:196
>      mediaSample.setTrackID(id());

This isn't new to this patch, but sample can only have one "track ID" so I think we have a problem when a source is attached to more than one track.
Comment 6 youenn fablet 2017-06-16 16:40:05 PDT
> > Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.cpp:196
> >      mediaSample.setTrackID(id());
> 
> This isn't new to this patch, but sample can only have one "track ID" so I
> think we have a problem when a source is attached to more than one track.

I was wondering what was its actual use.
It seems it is only used in SourceBuffer::sourceBufferPrivateDidReceiveSample.
Maybe trackID should not be set in MediaSample but retrieved from the track or from another parameter.
Comment 7 youenn fablet 2017-06-16 16:57:43 PDT
Created attachment 313159 [details]
Fixes build
Comment 8 youenn fablet 2017-06-16 17:25:20 PDT
Created attachment 313164 [details]
Fixing build again
Comment 9 WebKit Commit Bot 2017-06-19 10:13:01 PDT
Comment on attachment 313164 [details]
Fixing build again

Clearing flags on attachment: 313164

Committed r218497: <http://trac.webkit.org/changeset/218497>
Comment 10 WebKit Commit Bot 2017-06-19 10:13:03 PDT
All reviewed patches have been landed.  Closing bug.
Comment 11 youenn fablet 2017-07-10 13:30:47 PDT
*** Bug 174126 has been marked as a duplicate of this bug. ***