New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 669212 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

MediaStreamTrack.clone() doesn't carry properties over

Project Member Reported by pbos@chromium.org, Nov 28 2016

Issue description

Cloning a MediaStreamStreamTrack creates a new MediaStreamTrack using the same source:

https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.cpp?q=mediastreamtrack.clone&sq=package:chromium&dr=C&l=142

  MediaStreamComponent* clonedComponent =
      MediaStreamComponent::create(component()->source());
  MediaStreamTrack* clonedTrack =
      MediaStreamTrack::create(context, clonedComponent);

This means that flags such as enabled or stopped don't carry over. This is true for CanvasCaptureMediaStreamTrack as well.

Can we make it so that MediaStreamComponent has a clone method that creates a new ID instead? (And avoid code duplication for CanvasCaptureMST.clone as well.)
 

Comment 2 by pbos@chromium.org, Dec 1 2016

FTR not all properties are carried over with the above CL, stopped/readyState which is part of MediaStreamTrack probably need to be cloned. It should be done in a way so that not all subclasses (MST, CanvasCaptureMST) have to implement the clone step separately.

Comment 3 by guidou@chromium.org, Mar 13 2018

Components: -Blink>WebRTC Blink>GetUserMedia

Comment 4 by guidou@chromium.org, Mar 13 2018

Components: -Blink>GetUserMedia Blink>MediaStream

Comment 5 by guidou@chromium.org, Mar 30 2018

Cc: c.pa...@samsung.com
Cc: -c.pa...@samsung.com guidou@chromium.org
Owner: c.pa...@samsung.com
c.padhi@:One thing clone() is missing is cloning constraints.

T.getConstraints() should return the same value as T.clone().getConstraints(), but currently the latter always returns {}.
To fix this, the constraints_ field of MediaStreamComponent must be copied in MediaStreamComponent::Clone().
Project Member

Comment 7 by bugdroid1@chromium.org, Apr 6 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/98a21bb961814a18a259f9d08fe2e2f0ea489d42

commit 98a21bb961814a18a259f9d08fe2e2f0ea489d42
Author: Chandan Padhi <c.padhi@samsung.com>
Date: Fri Apr 06 02:51:18 2018

Clone MediaStreamTrack's constraints

MediaStreamTrack's clone should have same constraints.
This CL ensures that MediaStreamTrack.clone().getConstraints()
returns the same value as MediaStreamTrack.getConstraints().

Bug:  669212 
Change-Id: I305a3e3e831d8355576201dada5f1ef81072bab5
Reviewed-on: https://chromium-review.googlesource.com/997319
Reviewed-by: Guido Urdaneta <guidou@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Chandan Padhi <c.padhi@samsung.com>
Cr-Commit-Position: refs/heads/master@{#548647}
[modify] https://crrev.com/98a21bb961814a18a259f9d08fe2e2f0ea489d42/third_party/WebKit/LayoutTests/fast/mediastream/MediaStreamTrack-clone.html
[modify] https://crrev.com/98a21bb961814a18a259f9d08fe2e2f0ea489d42/third_party/WebKit/Source/platform/mediastream/MediaStreamComponent.cpp
[modify] https://crrev.com/98a21bb961814a18a259f9d08fe2e2f0ea489d42/third_party/WebKit/Source/platform/mediastream/MediaStreamComponent.h

Project Member

Comment 8 by bugdroid1@chromium.org, Apr 6 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4e66bb2982aa9fecc436fe8ef5a605f4acfc22f7

commit 4e66bb2982aa9fecc436fe8ef5a605f4acfc22f7
Author: Chandan Padhi <c.padhi@samsung.com>
Date: Fri Apr 06 06:48:42 2018

Clone MediaStreamTrack's readyState property

MediaStreamTrack's clone should have the same state.
This CL ensures that MediaStreamTrack.clone().readyState
returns the same value as MediaStreamTrack.readyState.

Bug:  669212 
Change-Id: I7547aff039ecdef5fb6d059957ea3566c798d86f
Reviewed-on: https://chromium-review.googlesource.com/996837
Commit-Queue: Chandan Padhi <c.padhi@samsung.com>
Reviewed-by: Guido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548699}
[modify] https://crrev.com/4e66bb2982aa9fecc436fe8ef5a605f4acfc22f7/third_party/WebKit/LayoutTests/fast/mediastream/MediaStreamTrack-clone.html
[modify] https://crrev.com/4e66bb2982aa9fecc436fe8ef5a605f4acfc22f7/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.cpp
[modify] https://crrev.com/4e66bb2982aa9fecc436fe8ef5a605f4acfc22f7/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.h

Comment 9 by guidou@chromium.org, Apr 12 2018

Status: Fixed (was: Assigned)
[bulk-edit: disregard if N/A] Can the owner please set milestone to this bug if applicable?

Sign in to add a comment