Skip to content

Commit 3b4cffd

Browse files
committed
[GStreamer] Change isGStreamerPluginAvailable to ASCIILiteral
https://bugs.webkit.org/show_bug.cgi?id=289942 Reviewed by Philippe Normand. * Source/WebCore/Modules/mediastream/gstreamer/GStreamerPeerConnectionBackend.cpp: (WebCore::createGStreamerPeerConnectionBackend): * Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp: (webKitGLVideoSinkProbePlatform): * Source/WebCore/platform/graphics/gstreamer/GStreamerAudioMixer.cpp: (WebCore::GStreamerAudioMixer::isAvailable): * Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp: (WebCore::isGStreamerPluginAvailable): * Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h: * Source/WebCore/platform/graphics/gstreamer/TextCombinerGStreamer.cpp: (webKitTextCombinerHandleCaps): (webkitTextCombinerNew): * Source/WebCore/platform/mediarecorder/MediaRecorderPrivateGStreamer.cpp: (WebCore::MediaRecorderPrivateBackend::containerProfile): Canonical link: https://commits.webkit.org/292299@main Signed-off-by: Xabier Rodriguez Calvar <calvaris@igalia.com>
1 parent a6e4e27 commit 3b4cffd

8 files changed

Lines changed: 11 additions & 11 deletions

File tree

Source/WebCore/Modules/mediastream/gstreamer/GStreamerPeerConnectionBackend.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static std::unique_ptr<PeerConnectionBackend> createGStreamerPeerConnectionBacke
7676
std::call_once(debugRegisteredFlag, [] {
7777
GST_DEBUG_CATEGORY_INIT(webkit_webrtc_pc_backend_debug, "webkitwebrtcpeerconnection", 0, "WebKit WebRTC PeerConnection");
7878
});
79-
if (!isGStreamerPluginAvailable("webrtc")) {
79+
if (!isGStreamerPluginAvailable("webrtc"_s)) {
8080
WTFLogAlways("GstWebRTC plugin not found. Make sure to install gst-plugins-bad >= 1.20 with the webrtc plugin enabled.");
8181
return nullptr;
8282
}

Source/WebCore/platform/graphics/gstreamer/DMABufVideoSinkGStreamer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ bool webKitDMABufVideoSinkIsEnabled()
195195

196196
bool webKitDMABufVideoSinkProbePlatform()
197197
{
198-
return webkitGstCheckVersion(1, 20, 0) && isGStreamerPluginAvailable("app");
198+
return webkitGstCheckVersion(1, 20, 0) && isGStreamerPluginAvailable("app"_s);
199199
}
200200

201201
void webKitDMABufVideoSinkSetMediaPlayerPrivate(WebKitDMABufVideoSink* sink, MediaPlayerPrivateGStreamer* player)

Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ bool webKitGLVideoSinkProbePlatform()
195195
return false;
196196
}
197197

198-
return isGStreamerPluginAvailable("app") && isGStreamerPluginAvailable("opengl");
198+
return isGStreamerPluginAvailable("app"_s) && isGStreamerPluginAvailable("opengl"_s);
199199
}
200200

201201
#undef GST_CAT_DEFAULT

Source/WebCore/platform/graphics/gstreamer/GStreamerAudioMixer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ GST_DEBUG_CATEGORY_STATIC(webkit_media_gst_audio_mixer_debug);
3232

3333
bool GStreamerAudioMixer::isAvailable()
3434
{
35-
return isGStreamerPluginAvailable("inter") && isGStreamerPluginAvailable("audiomixer");
35+
return isGStreamerPluginAvailable("inter"_s) && isGStreamerPluginAvailable("audiomixer"_s);
3636
}
3737

3838
GStreamerAudioMixer& GStreamerAudioMixer::singleton()

Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -935,11 +935,11 @@ Vector<uint8_t> GstMappedBuffer::createVector() const
935935
return std::span<const uint8_t> { data(), size() };
936936
}
937937

938-
bool isGStreamerPluginAvailable(const char* name)
938+
bool isGStreamerPluginAvailable(ASCIILiteral name)
939939
{
940-
GRefPtr<GstPlugin> plugin = adoptGRef(gst_registry_find_plugin(gst_registry_get(), name));
940+
GRefPtr<GstPlugin> plugin = adoptGRef(gst_registry_find_plugin(gst_registry_get(), name.characters()));
941941
if (!plugin)
942-
GST_WARNING("Plugin %s not found. Please check your GStreamer installation", name);
942+
GST_WARNING("Plugin %s not found. Please check your GStreamer installation", name.characters());
943943
return plugin;
944944
}
945945

Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ void disconnectSimpleBusMessageCallback(GstElement*);
269269

270270
enum class GstVideoDecoderPlatform { ImxVPU, Video4Linux, OpenMAX };
271271

272-
bool isGStreamerPluginAvailable(const char* name);
272+
bool isGStreamerPluginAvailable(ASCIILiteral name);
273273
bool gstElementFactoryEquals(GstElement*, ASCIILiteral name);
274274

275275
GstElement* createAutoAudioSink(const String& role);

Source/WebCore/platform/graphics/gstreamer/TextCombinerGStreamer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ void webKitTextCombinerHandleCaps(WebKitTextCombiner* combiner, GstPad* pad, con
8787
gst_pad_link(srcPad.get(), internalPad.get());
8888
} // Else: pipeline is already correct.
8989
} else if (gst_caps_can_intersect(cea608Caps.get(), caps)) {
90-
if (!isGStreamerPluginAvailable("rsclosedcaption") || !isGStreamerPluginAvailable("closedcaption")) {
90+
if (!isGStreamerPluginAvailable("rsclosedcaption"_s) || !isGStreamerPluginAvailable("closedcaption"_s)) {
9191
WTFLogAlways("GStreamer closedcaption plugins are missing. Please install gst-plugins-bad and gst-plugins-rs");
9292
return;
9393
}
@@ -218,7 +218,7 @@ static void webkit_text_combiner_class_init(WebKitTextCombinerClass* klass)
218218
GstElement* webkitTextCombinerNew()
219219
{
220220
// The combiner relies on webvttenc, fail early if it's not there.
221-
if (!isGStreamerPluginAvailable("subenc")) {
221+
if (!isGStreamerPluginAvailable("subenc"_s)) {
222222
WTFLogAlways("WebKit wasn't able to find a WebVTT encoder. Subtitles handling will be degraded unless gst-plugins-bad is installed.");
223223
return nullptr;
224224
}

Source/WebCore/platform/mediarecorder/MediaRecorderPrivateGStreamer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ GRefPtr<GstEncodingContainerProfile> MediaRecorderPrivateBackend::containerProfi
271271
if (scanner.isContentTypeSupported(GStreamerRegistryScanner::Configuration::Encoding, contentType, { }) == MediaPlayerEnums::SupportsType::IsNotSupported)
272272
return nullptr;
273273

274-
auto mp4Variant = isGStreamerPluginAvailable("fmp4") ? "iso-fragmented"_s : "iso"_s;
274+
auto mp4Variant = isGStreamerPluginAvailable("fmp4"_s) ? "iso-fragmented"_s : "iso"_s;
275275
StringBuilder containerCapsDescriptionBuilder;
276276
auto containerType = contentType.containerType();
277277
if (containerType.endsWith("mp4"_s))

0 commit comments

Comments
 (0)