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

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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 dispatchEvent(Event::create(EventTypeNames::ended)); 205 dispatchEvent(Event::create(EventTypeNames::ended));
206 propagateTrackEnded(); 206 propagateTrackEnded();
207 } 207 }
208 208
209 MediaStreamTrack* MediaStreamTrack::clone(ScriptState* scriptState) { 209 MediaStreamTrack* MediaStreamTrack::clone(ScriptState* scriptState) {
210 // TODO(pbos): Make sure m_readyState and m_stopped carries over on cloned 210 // TODO(pbos): Make sure m_readyState and m_stopped carries over on cloned
211 // tracks. 211 // tracks.
212 MediaStreamComponent* clonedComponent = component()->clone(); 212 MediaStreamComponent* clonedComponent = component()->clone();
213 MediaStreamTrack* clonedTrack = MediaStreamTrack::create( 213 MediaStreamTrack* clonedTrack = MediaStreamTrack::create(
214 scriptState->getExecutionContext(), clonedComponent); 214 scriptState->getExecutionContext(), clonedComponent);
215 MediaStreamCenter::instance().didCreateMediaStreamTrack(clonedComponent); 215 MediaStreamCenter::instance().didCloneMediaStreamTrack(component(),
216 clonedComponent);
216 return clonedTrack; 217 return clonedTrack;
217 } 218 }
218 219
219 void MediaStreamTrack::setConstraints(const WebMediaConstraints& constraints) { 220 void MediaStreamTrack::setConstraints(const WebMediaConstraints& constraints) {
220 m_constraints = constraints; 221 m_constraints = constraints;
221 } 222 }
222 223
223 void MediaStreamTrack::getCapabilities(MediaTrackCapabilities& capabilities) { 224 void MediaStreamTrack::getCapabilities(MediaTrackCapabilities& capabilities) {
224 if (m_imageCapture) 225 if (m_imageCapture)
225 capabilities = m_imageCapture->getMediaTrackCapabilities(); 226 capabilities = m_imageCapture->getMediaTrackCapabilities();
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 409
409 DEFINE_TRACE(MediaStreamTrack) { 410 DEFINE_TRACE(MediaStreamTrack) {
410 visitor->trace(m_registeredMediaStreams); 411 visitor->trace(m_registeredMediaStreams);
411 visitor->trace(m_component); 412 visitor->trace(m_component);
412 visitor->trace(m_imageCapture); 413 visitor->trace(m_imageCapture);
413 EventTargetWithInlineData::trace(visitor); 414 EventTargetWithInlineData::trace(visitor);
414 ContextLifecycleObserver::trace(visitor); 415 ContextLifecycleObserver::trace(visitor);
415 } 416 }
416 417
417 } // namespace blink 418 } // namespace blink
OLDNEW
« no previous file with comments | « content/renderer/media/media_stream_center.cc ('k') | third_party/WebKit/Source/platform/mediastream/MediaStreamCenter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698