Bug 233826

Summary: [GStreamer] Fill in client-name property on audio sinks
Product: WebKit Reporter: Philippe Normand <pnormand>
Component: PlatformAssignee: Philippe Normand <pnormand>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply, calvaris, cgarcia, eric.carlson, ews-watchlist, glenn, gustavo, jer.noble, menard, philipj, sergio, vjaquez, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Philippe Normand 2021-12-03 10:24:27 PST
SSIA
Comment 1 Philippe Normand 2021-12-06 06:40:41 PST
Created attachment 446036 [details]
Patch
Comment 2 Philippe Normand 2021-12-06 06:42:56 PST
Comment on attachment 446036 [details]
Patch

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

> Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp:458
> +    }), role.releaseImpl().leakRef());

Hm, this is not looking good... i'll revisit this part.
Comment 3 Xabier Rodríguez Calvar 2021-12-07 07:27:06 PST
Comment on attachment 446036 [details]
Patch

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

> Source/WebCore/platform/audio/gstreamer/AudioDestinationGStreamer.cpp:145
> -        g_signal_connect(audioSink.get(), "child-added", G_CALLBACK(autoAudioSinkChildAddedCallback), nullptr);
> +        g_signal_connect(audioSink.get(), "child-added", G_CALLBACK(+[](GstChildProxy*, GObject* object, gchar*, gpointer) {
> +            if (GST_IS_AUDIO_BASE_SINK(object))
> +                g_object_set(GST_AUDIO_BASE_SINK(object), "buffer-time", static_cast<gint64>(100000), nullptr);
> +        }), nullptr);

Please, mention this drive-by reorganization on the changelog.

>> Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp:458
>> +    }), role.releaseImpl().leakRef());
> 
> Hm, this is not looking good... i'll revisit this part.

Definitely looking not good. I guess you'll have to g_strdup and use g_signal_connect_data to provide the GClosureNotify to destroy it.

> Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h:310
> +GstElement* createAutoAudioSink(String role);
> +GstElement* createPlatformAudioSink(const char* role);

Why don't you use const String& for both?
Comment 4 Philippe Normand 2021-12-08 09:46:05 PST
Created attachment 446378 [details]
Patch
Comment 5 EWS 2021-12-08 12:21:56 PST
Committed r286676 (244982@main): <https://commits.webkit.org/244982@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 446378 [details].
Comment 6 Radar WebKit Bug Importer 2021-12-08 12:23:21 PST
<rdar://problem/86224065>