Title: [237802] trunk/Source/WebCore
- Revision
- 237802
- Author
- [email protected]
- Date
- 2018-11-05 07:32:03 -0800 (Mon, 05 Nov 2018)
Log Message
RealtimeOutgoingAudioSource subclasses should observe its source when fully constructed
https://bugs.webkit.org/show_bug.cgi?id=191241
Reviewed by Eric Carlson.
Moving the logic to observe the audio source to the point where the
RealtimeOutgoingAudioSource subclass is fully initialized.
Covered by existing tests.
* platform/mediastream/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
(WebCore::RealtimeOutgoingAudioSource::observeSource):
* platform/mediastream/RealtimeOutgoingAudioSource.h:
* platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
(WebCore::RealtimeOutgoingAudioSourceLibWebRTC::RealtimeOutgoingAudioSourceLibWebRTC):
* platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
(WebCore::RealtimeOutgoingAudioSourceCocoa::RealtimeOutgoingAudioSourceCocoa):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (237801 => 237802)
--- trunk/Source/WebCore/ChangeLog 2018-11-05 15:09:54 UTC (rev 237801)
+++ trunk/Source/WebCore/ChangeLog 2018-11-05 15:32:03 UTC (rev 237802)
@@ -1,3 +1,23 @@
+2018-11-05 Youenn Fablet <[email protected]>
+
+ RealtimeOutgoingAudioSource subclasses should observe its source when fully constructed
+ https://bugs.webkit.org/show_bug.cgi?id=191241
+
+ Reviewed by Eric Carlson.
+
+ Moving the logic to observe the audio source to the point where the
+ RealtimeOutgoingAudioSource subclass is fully initialized.
+ Covered by existing tests.
+
+ * platform/mediastream/RealtimeOutgoingAudioSource.cpp:
+ (WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
+ (WebCore::RealtimeOutgoingAudioSource::observeSource):
+ * platform/mediastream/RealtimeOutgoingAudioSource.h:
+ * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
+ (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::RealtimeOutgoingAudioSourceLibWebRTC):
+ * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
+ (WebCore::RealtimeOutgoingAudioSourceCocoa::RealtimeOutgoingAudioSourceCocoa):
+
2018-11-05 Thibault Saunier <[email protected]>
[GStreamer][WebRTC] Add webrtcencoder bin to cleanup and refactor the way we set encoders
Modified: trunk/Source/WebCore/platform/mediastream/RealtimeOutgoingAudioSource.cpp (237801 => 237802)
--- trunk/Source/WebCore/platform/mediastream/RealtimeOutgoingAudioSource.cpp 2018-11-05 15:09:54 UTC (rev 237801)
+++ trunk/Source/WebCore/platform/mediastream/RealtimeOutgoingAudioSource.cpp 2018-11-05 15:32:03 UTC (rev 237802)
@@ -36,9 +36,13 @@
namespace WebCore {
-RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource(Ref<MediaStreamTrackPrivate>&& audioSource)
- : m_audioSource(WTFMove(audioSource))
+RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource(Ref<MediaStreamTrackPrivate>&& source)
+ : m_audioSource(WTFMove(source))
{
+}
+
+void RealtimeOutgoingAudioSource::observeSource()
+{
m_audioSource->addObserver(*this);
initializeConverter();
}
Modified: trunk/Source/WebCore/platform/mediastream/RealtimeOutgoingAudioSource.h (237801 => 237802)
--- trunk/Source/WebCore/platform/mediastream/RealtimeOutgoingAudioSource.h 2018-11-05 15:09:54 UTC (rev 237801)
+++ trunk/Source/WebCore/platform/mediastream/RealtimeOutgoingAudioSource.h 2018-11-05 15:32:03 UTC (rev 237802)
@@ -64,6 +64,8 @@
protected:
explicit RealtimeOutgoingAudioSource(Ref<MediaStreamTrackPrivate>&&);
+ void observeSource();
+
virtual void pullAudioData() { }
bool isSilenced() const { return m_muted || !m_enabled; }
Modified: trunk/Source/WebCore/platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp (237801 => 237802)
--- trunk/Source/WebCore/platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp 2018-11-05 15:09:54 UTC (rev 237801)
+++ trunk/Source/WebCore/platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp 2018-11-05 15:32:03 UTC (rev 237802)
@@ -34,6 +34,7 @@
{
m_adapter = adoptGRef(gst_adapter_new()),
m_sampleConverter = nullptr;
+ observeSource();
}
RealtimeOutgoingAudioSourceLibWebRTC::~RealtimeOutgoingAudioSourceLibWebRTC()
Modified: trunk/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp (237801 => 237802)
--- trunk/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp 2018-11-05 15:09:54 UTC (rev 237801)
+++ trunk/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp 2018-11-05 15:32:03 UTC (rev 237802)
@@ -47,6 +47,7 @@
: RealtimeOutgoingAudioSource(WTFMove(audioSource))
, m_sampleConverter(AudioSampleDataSource::create(LibWebRTCAudioFormat::sampleRate * 2))
{
+ observeSource();
}
Ref<RealtimeOutgoingAudioSource> RealtimeOutgoingAudioSource::create(Ref<MediaStreamTrackPrivate>&& audioSource)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes