diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-11-03 16:11:47 +0000 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-11-03 18:15:51 +0100 |
commit | af9b546cf5eef3df417e225c8ad87283ab51e1bb (patch) | |
tree | 74889c5ea14b1391be4414abfea6d9281390fa86 /avmedia | |
parent | cef555e9a43b2cf1f46763b768973f89c5c1b053 (diff) |
avoid the neeed to escape url passed to gstreamer
Change-Id: I13d0cee911a3c9af99b494dde16b8d51f78d954a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158889
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'avmedia')
-rw-r--r-- | avmedia/source/gstreamer/gstframegrabber.cxx | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/avmedia/source/gstreamer/gstframegrabber.cxx b/avmedia/source/gstreamer/gstframegrabber.cxx index a3b4b3aef5e1..7a6575123318 100644 --- a/avmedia/source/gstreamer/gstframegrabber.cxx +++ b/avmedia/source/gstreamer/gstframegrabber.cxx @@ -50,10 +50,9 @@ void FrameGrabber::disposePipeline() FrameGrabber::FrameGrabber( std::u16string_view rURL ) { - gchar *pPipelineStr = g_strdup_printf( - "uridecodebin uri=\"%s\" ! videoconvert ! videoscale ! appsink " - "name=sink caps=\"video/x-raw,format=RGB,pixel-aspect-ratio=1/1\"", - OUStringToOString( rURL, RTL_TEXTENCODING_UTF8 ).getStr() ); + const char pPipelineStr[] = + "uridecodebin name=source ! videoconvert ! videoscale ! appsink " + "name=sink caps=\"video/x-raw,format=RGB,pixel-aspect-ratio=1/1\""; GError *pError = nullptr; mpPipeline = gst_parse_launch( pPipelineStr, &pError ); @@ -64,6 +63,12 @@ FrameGrabber::FrameGrabber( std::u16string_view rURL ) } if( mpPipeline ) { + + if (GstElement *pUriDecode = gst_bin_get_by_name(GST_BIN(mpPipeline), "source")) + g_object_set(pUriDecode, "uri", OUStringToOString(rURL, RTL_TEXTENCODING_UTF8).getStr(), nullptr); + else + g_warning("Missing 'source' element in gstreamer pipeline"); + // pre-roll switch( gst_element_set_state( mpPipeline, GST_STATE_PAUSED ) ) { case GST_STATE_CHANGE_FAILURE: |