Skip to content

Commit 7aab71b

Browse files
committed
[GStreamer] Switch setGstElementGLContext to ASCIILiteral
https://bugs.webkit.org/show_bug.cgi?id=290049 Reviewed by Philippe Normand. * Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp: (webKitGLVideoSinkChangeState): * Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp: (WebCore::setGstElementGLContext): * Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h: * Source/WebCore/platform/graphics/gstreamer/GStreamerVideoFrameConverter.cpp: (WebCore::GStreamerVideoFrameConverter::Pipeline::run): Canonical link: https://commits.webkit.org/292373@main Signed-off-by: Xabier Rodriguez Calvar <calvaris@igalia.com>
1 parent 7d70961 commit 7aab71b

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,10 @@ static GstStateChangeReturn webKitGLVideoSinkChangeState(GstElement* element, Gs
131131
case GST_STATE_CHANGE_NULL_TO_READY:
132132
case GST_STATE_CHANGE_READY_TO_READY:
133133
case GST_STATE_CHANGE_READY_TO_PAUSED: {
134-
if (!setGstElementGLContext(element, GST_GL_DISPLAY_CONTEXT_TYPE))
134+
static ASCIILiteral gstGlDisplayContextyType = ASCIILiteral::fromLiteralUnsafe(GST_GL_DISPLAY_CONTEXT_TYPE);
135+
if (!setGstElementGLContext(element, gstGlDisplayContextyType))
135136
return GST_STATE_CHANGE_FAILURE;
136-
if (!setGstElementGLContext(element, "gst.gl.app_context"))
137+
if (!setGstElementGLContext(element, "gst.gl.app_context"_s))
137138
return GST_STATE_CHANGE_FAILURE;
138139
break;
139140
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1866,11 +1866,11 @@ static std::optional<GRefPtr<GstContext>> requestGLContext(const char* contextTy
18661866
return std::nullopt;
18671867
}
18681868

1869-
bool setGstElementGLContext(GstElement* element, const char* contextType)
1869+
bool setGstElementGLContext(GstElement* element, ASCIILiteral contextType)
18701870
{
1871-
GRefPtr<GstContext> oldContext = adoptGRef(gst_element_get_context(element, contextType));
1871+
GRefPtr<GstContext> oldContext = adoptGRef(gst_element_get_context(element, contextType.characters()));
18721872
if (!oldContext) {
1873-
auto newContext = requestGLContext(contextType);
1873+
auto newContext = requestGLContext(contextType.characters());
18741874
if (!newContext)
18751875
return false;
18761876
gst_element_set_context(element, newContext->get());

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ WARN_UNUSED_RETURN GRefPtr<GstCaps> buildDMABufCaps();
356356
#endif
357357

358358
#if USE(GSTREAMER_GL)
359-
bool setGstElementGLContext(GstElement*, const char* contextType);
359+
bool setGstElementGLContext(GstElement*, ASCIILiteral contextType);
360360
#endif
361361

362362
} // namespace WebCore

0 commit comments

Comments
 (0)