Bug 218335 - [GStreamer] WebAudio to MediaStream support
Summary: [GStreamer] WebAudio to MediaStream support
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Philippe Normand
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-10-29 05:34 PDT by Philippe Normand
Modified: 2020-11-15 07:40 PST (History)
14 users (show)

See Also:


Attachments
Patch (22.46 KB, patch)
2020-10-29 06:21 PDT, Philippe Normand
calvaris: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Normand 2020-10-29 05:34:03 PDT
webrtc/peer-connection-createMediaStreamDestination.html from webkit.org/b/186933 is still failing.
Comment 1 Philippe Normand 2020-10-29 06:21:40 PDT
Created attachment 412638 [details]
Patch
Comment 2 Xabier Rodríguez Calvar 2020-10-30 08:38:47 PDT
Comment on attachment 412638 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=412638&action=review

> Source/WebCore/Modules/webaudio/MediaStreamAudioSourceGStreamer.cpp:40
> +    gsize size = mappedBuffer.size() / bus.numberOfChannels();

size_t

> Source/WebCore/Modules/webaudio/MediaStreamAudioSourceGStreamer.cpp:61
> +    gsize size = GST_AUDIO_INFO_BPF(&info) * bus.numberOfChannels() * numberOfFrames;

size_t

> Source/WebCore/platform/audio/gstreamer/GStreamerAudioData.h:35
> +    GStreamerAudioData(GRefPtr<GstSample>&& sample, GstAudioInfo info)

GstAudioInfo&& and move into this from the caller and into m_audioInfo

> Source/WebCore/platform/audio/gstreamer/GStreamerAudioData.h:49
> +    GstSample* getSample() { return m_sample.get(); }
> +    GstAudioInfo getAudioInfo() { return m_audioInfo; }

const GstAudioInfo& audioInfo() const

and I would also do const GRefPrt<GstSample>& sample() const;

> Source/WebCore/platform/audio/gstreamer/GStreamerAudioStreamDescription.h:33
> +    GStreamerAudioStreamDescription(GstAudioInfo info)

GstAudioInfo&& and move here and at the caller. Let's save some copy.

> Source/WebCore/platform/audio/gstreamer/GStreamerAudioStreamDescription.h:40
> +    GStreamerAudioStreamDescription(GstAudioInfo *info)
> +        : m_info(*info)

If you do the change I recommend above, you can make this const GstAudioInfo& and m_info(info), forcing a copy. I think it is cleaner.

> Source/WebCore/platform/audio/gstreamer/GStreamerAudioStreamDescription.h:97
> +    GstCaps* caps() { return m_caps.get(); }
> +    GstAudioInfo* getInfo() { return &m_info; }

const GstAudioInfo& info() const

and I would also do const GRefPtr<GstCaps>& caps() const;
Comment 3 Philippe Normand 2020-10-30 08:48:33 PDT
These changes you want will likely require updates in code unrelated with this patch, so I'd rather do this in a follow-up bug.
Comment 4 Philippe Normand 2020-11-15 07:39:34 PST
Committed r269827: <https://trac.webkit.org/changeset/269827>
Comment 5 Radar WebKit Bug Importer 2020-11-15 07:40:17 PST
<rdar://problem/71414788>