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

Side by Side Diff: third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.cpp

Issue 2791303002: Clone MediaStream video tracks correctly with spec-compliant constraints. (Closed)
Patch Set: rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * Copyright (C) 2011 Ericsson AB. All rights reserved. 3 * Copyright (C) 2011 Ericsson AB. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 dispatchEvent(Event::create(EventTypeNames::ended)); 209 dispatchEvent(Event::create(EventTypeNames::ended));
210 propagateTrackEnded(); 210 propagateTrackEnded();
211 } 211 }
212 212
213 MediaStreamTrack* MediaStreamTrack::clone(ScriptState* scriptState) { 213 MediaStreamTrack* MediaStreamTrack::clone(ScriptState* scriptState) {
214 // TODO(pbos): Make sure m_readyState and m_stopped carries over on cloned 214 // TODO(pbos): Make sure m_readyState and m_stopped carries over on cloned
215 // tracks. 215 // tracks.
216 MediaStreamComponent* clonedComponent = component()->clone(); 216 MediaStreamComponent* clonedComponent = component()->clone();
217 MediaStreamTrack* clonedTrack = MediaStreamTrack::create( 217 MediaStreamTrack* clonedTrack = MediaStreamTrack::create(
218 scriptState->getExecutionContext(), clonedComponent); 218 scriptState->getExecutionContext(), clonedComponent);
219 MediaStreamCenter::instance().didCreateMediaStreamTrack(clonedComponent); 219 MediaStreamCenter::instance().didCloneMediaStreamTrack(component(),
220 clonedComponent);
220 return clonedTrack; 221 return clonedTrack;
221 } 222 }
222 223
223 void MediaStreamTrack::setConstraints(const WebMediaConstraints& constraints) { 224 void MediaStreamTrack::setConstraints(const WebMediaConstraints& constraints) {
224 m_constraints = constraints; 225 m_constraints = constraints;
225 } 226 }
226 227
227 void MediaStreamTrack::getCapabilities(MediaTrackCapabilities& capabilities) { 228 void MediaStreamTrack::getCapabilities(MediaTrackCapabilities& capabilities) {
228 if (m_imageCapture) 229 if (m_imageCapture)
229 capabilities = m_imageCapture->getMediaTrackCapabilities(); 230 capabilities = m_imageCapture->getMediaTrackCapabilities();
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 413
413 DEFINE_TRACE(MediaStreamTrack) { 414 DEFINE_TRACE(MediaStreamTrack) {
414 visitor->trace(m_registeredMediaStreams); 415 visitor->trace(m_registeredMediaStreams);
415 visitor->trace(m_component); 416 visitor->trace(m_component);
416 visitor->trace(m_imageCapture); 417 visitor->trace(m_imageCapture);
417 EventTargetWithInlineData::trace(visitor); 418 EventTargetWithInlineData::trace(visitor);
418 ContextLifecycleObserver::trace(visitor); 419 ContextLifecycleObserver::trace(visitor);
419 } 420 }
420 421
421 } // namespace blink 422 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698