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

Side by Side Diff: third_party/WebKit/Source/platform/mediastream/MediaStreamComponent.cpp

Issue 2540263003: Carry MediaStreamComponent properties on clone. (Closed)
Patch Set: added test + todo comments Created 4 years 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
« no previous file with comments | « third_party/WebKit/Source/platform/mediastream/MediaStreamComponent.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Ericsson AB. All rights reserved. 2 * Copyright (C) 2011 Ericsson AB. All rights reserved.
3 * Copyright (C) 2013 Google Inc. All rights reserved. 3 * Copyright (C) 2013 Google Inc. 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 are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 return new MediaStreamComponent(createCanonicalUUIDString(), source); 43 return new MediaStreamComponent(createCanonicalUUIDString(), source);
44 } 44 }
45 45
46 MediaStreamComponent* MediaStreamComponent::create(const String& id, 46 MediaStreamComponent* MediaStreamComponent::create(const String& id,
47 MediaStreamSource* source) { 47 MediaStreamSource* source) {
48 return new MediaStreamComponent(id, source); 48 return new MediaStreamComponent(id, source);
49 } 49 }
50 50
51 MediaStreamComponent::MediaStreamComponent(const String& id, 51 MediaStreamComponent::MediaStreamComponent(const String& id,
52 MediaStreamSource* source) 52 MediaStreamSource* source)
53 : m_source(source), m_id(id), m_enabled(true), m_muted(false) { 53 : MediaStreamComponent(id, source, true, false) {}
54
55 MediaStreamComponent::MediaStreamComponent(const String& id,
56 MediaStreamSource* source,
57 bool enabled,
58 bool muted)
59 : m_source(source), m_id(id), m_enabled(enabled), m_muted(muted) {
54 DCHECK(m_id.length()); 60 DCHECK(m_id.length());
55 ThreadState::current()->registerPreFinalizer(this); 61 ThreadState::current()->registerPreFinalizer(this);
56 } 62 }
57 63
64 MediaStreamComponent* MediaStreamComponent::clone() const {
65 MediaStreamComponent* clonedComponent = new MediaStreamComponent(
66 createCanonicalUUIDString(), source(), m_enabled, m_muted);
67 // TODO(pbos): Clone |m_trackData| as well.
68 // TODO(pbos): Move properties from MediaStreamTrack here so that they are
69 // also cloned. Part of crbug:669212 since stopped is currently not carried
70 // over, nor is ended().
71 return clonedComponent;
72 }
73
58 void MediaStreamComponent::dispose() { 74 void MediaStreamComponent::dispose() {
59 m_trackData.reset(); 75 m_trackData.reset();
60 } 76 }
61 77
62 void MediaStreamComponent::AudioSourceProviderImpl::wrap( 78 void MediaStreamComponent::AudioSourceProviderImpl::wrap(
63 WebAudioSourceProvider* provider) { 79 WebAudioSourceProvider* provider) {
64 MutexLocker locker(m_provideInputLock); 80 MutexLocker locker(m_provideInputLock);
65 m_webAudioSourceProvider = provider; 81 m_webAudioSourceProvider = provider;
66 } 82 }
67 83
(...skipping 23 matching lines...) Expand all
91 webAudioData[i] = bus->channel(i)->mutableData(); 107 webAudioData[i] = bus->channel(i)->mutableData();
92 108
93 m_webAudioSourceProvider->provideInput(webAudioData, framesToProcess); 109 m_webAudioSourceProvider->provideInput(webAudioData, framesToProcess);
94 } 110 }
95 111
96 DEFINE_TRACE(MediaStreamComponent) { 112 DEFINE_TRACE(MediaStreamComponent) {
97 visitor->trace(m_source); 113 visitor->trace(m_source);
98 } 114 }
99 115
100 } // namespace blink 116 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/mediastream/MediaStreamComponent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698