Summary: | [WPE][GTK] Implement WebAudioSourceProviderGStreamer to allow bridging MediaStream and the WebAudio APIs | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Thibault Saunier <tsaunier> | ||||||
Component: | WebRTC | Assignee: | Thibault Saunier <tsaunier> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | alex, commit-queue, pnormand, webkit-bug-importer, youennf | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=218335 | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 187064 | ||||||||
Attachments: |
|
Description
Thibault Saunier
2018-06-22 10:56:19 PDT
Created attachment 356726 [details]
Patch
Comment on attachment 356726 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=356726&action=review > Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:138 > + if (m_pipeline) > + gst_element_set_state(m_pipeline.get(), GST_STATE_NULL); Needs ifdef guards > Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:241 > + if (m_pipeline) > + gst_element_set_state(m_pipeline.get(), GST_STATE_PLAYING); Ditto > Source/WebCore/platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp:45 > GstElement* source = GStreamerCapturer::createSource(); No need for this variable anymore > Source/WebCore/platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:40 > +static const double Tau = 2 * M_PI; > +static const double BipBopDuration = 0.07; > +static const double BipBopVolume = 0.5; > +static const double BipFrequency = 1500; > +static const double BopFrequency = 500; > +static const double HumFrequency = 150; > +static const double HumVolume = 0.1; I think we usually name static constants like s_fooBar :) > Source/WebCore/platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:119 > + addHum(BipBopVolume, BopFrequency, rate, 0, static_cast<float*>(m_bipBopBuffer.data() + bopStart), bipBopSampleCount); shouldn't the 0 here be bopStart? Created attachment 356735 [details]
Patch
(In reply to Philippe Normand from comment #2) > Comment on attachment 356726 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=356726&action=review > > > Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:138 > > + if (m_pipeline) > > + gst_element_set_state(m_pipeline.get(), GST_STATE_NULL); > > Needs ifdef guards > > > Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:241 > > + if (m_pipeline) > > + gst_element_set_state(m_pipeline.get(), GST_STATE_PLAYING); > > Ditto I am just gonna remove the ifdefing of the varible, it won't be used in some cases but to me it is better than ifdefing all around. > > Source/WebCore/platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp:45 > > GstElement* source = GStreamerCapturer::createSource(); > > No need for this variable anymore The whole override is not needed anymore, removed :-) > > Source/WebCore/platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:40 > > +static const double Tau = 2 * M_PI; > > +static const double BipBopDuration = 0.07; > > +static const double BipBopVolume = 0.5; > > +static const double BipFrequency = 1500; > > +static const double BopFrequency = 500; > > +static const double HumFrequency = 150; > > +static const double HumVolume = 0.1; > > I think we usually name static constants like s_fooBar :) Done. > > Source/WebCore/platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:119 > > + addHum(BipBopVolume, BopFrequency, rate, 0, static_cast<float*>(m_bipBopBuffer.data() + bopStart), bipBopSampleCount); > > shouldn't the 0 here be bopStart? Nop, we already offset the data. So the start param of addHum() is basically useless then? (In reply to Philippe Normand from comment #5) > So the start param of addHum() is basically useless then? .... > Source/WebCore/platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:85 > + addHum(s_HumVolume, s_HumFrequency, sampleRate(), m_samplesRendered, (float*)map.data(), bipBopCount); It is used here. Comment on attachment 356735 [details]
Patch
OK then!
Comment on attachment 356735 [details] Patch Clearing flags on attachment: 356735 Committed r238951: <https://trac.webkit.org/changeset/238951> All reviewed patches have been landed. Closing bug. |