Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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. | |
|
Guido Urdaneta
2016/12/01 15:23:24
nit: File a bug about these?
pbos
2016/12/01 17:16:33
Done, using the same bug since some properties are
| |
| 69 return clonedComponent; | |
| 70 } | |
| 71 | |
| 58 void MediaStreamComponent::dispose() { | 72 void MediaStreamComponent::dispose() { |
| 59 m_trackData.reset(); | 73 m_trackData.reset(); |
| 60 } | 74 } |
| 61 | 75 |
| 62 void MediaStreamComponent::AudioSourceProviderImpl::wrap( | 76 void MediaStreamComponent::AudioSourceProviderImpl::wrap( |
| 63 WebAudioSourceProvider* provider) { | 77 WebAudioSourceProvider* provider) { |
| 64 MutexLocker locker(m_provideInputLock); | 78 MutexLocker locker(m_provideInputLock); |
| 65 m_webAudioSourceProvider = provider; | 79 m_webAudioSourceProvider = provider; |
| 66 } | 80 } |
| 67 | 81 |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 91 webAudioData[i] = bus->channel(i)->mutableData(); | 105 webAudioData[i] = bus->channel(i)->mutableData(); |
| 92 | 106 |
| 93 m_webAudioSourceProvider->provideInput(webAudioData, framesToProcess); | 107 m_webAudioSourceProvider->provideInput(webAudioData, framesToProcess); |
| 94 } | 108 } |
| 95 | 109 |
| 96 DEFINE_TRACE(MediaStreamComponent) { | 110 DEFINE_TRACE(MediaStreamComponent) { |
| 97 visitor->trace(m_source); | 111 visitor->trace(m_source); |
| 98 } | 112 } |
| 99 | 113 |
| 100 } // namespace blink | 114 } // namespace blink |
| OLD | NEW |