GStreamer on Qt for iOS

Luis francesco.moscara at gmail.com
Mon May 24 08:44:03 UTC 2021


Great, I added the resolv library and now it compiles and creates all the
elements! Many thanks!

Now it remains the (I hope) last problem. I 'm struggling with the overlay
interface.

The error: 
*
0:00:09.823339000  4417 0x7fde43c20900 WARN              autodetect
gstautodetect.c:351:gst_auto_detect_find_best:<autovideosink0> warning:
Failed to find a usable video sink
Could not retrieve videosink!

** (...:4417): CRITICAL **: 10:23:40.058:
gst_video_overlay_set_window_handle: assertion 'overlay != NULL' failed
*

The code (simplified):

data.pipeline = gst_pipeline_new ("pipeline");
data.udpsrc = gst_element_factory_make("udpsrc", NULL);
data.rtph264depay = gst_element_factory_make("rtph264depay", NULL);
data.avdec_h264 = gst_element_factory_make("avdec_h264", NULL);
data.videoconvert = gst_element_factory_make("videoconvert", NULL);
data.videoflip = gst_element_factory_make ("videoflip", NULL);
data.queue = gst_element_factory_make("queue", NULL);
data.videosink = gst_element_factory_make ("autovideosink", NULL); // Tried
also glimagesink but didn't work

 if (!data.pipeline || !data.udpsrc || !data.rtph264depay ||
!data.avdec_h264 || !data.videoconvert || !data.videoflip || !data.queue ||
!data.videosink ) {
     qWarning() << "Not all elements could be created!";
     DisposePipeline();
     return;
}

GstCaps *caps = gst_caps_new_simple("application/x-rtp",
"payload",G_TYPE_INT,96, NULL);

g_object_set(data.udpsrc, "caps", caps, NULL);
gst_caps_unref(caps);

gst_bin_add_many (GST_BIN (data.pipeline), data.udpsrc, data.rtph264depay,
data.avdec_h264, data.videoconvert, data.videoflip, data.queue,
data.videosink, NULL);

// Link the pipeline
if (!gst_element_link_many (data.udpsrc, data.rtph264depay, data.avdec_h264,
data.videoconvert, data.videoflip,  data.queue, data.videosink, NULL)) {
            qWarning() << "Error: not all elements could be linked!";
            DisposePipeline();
            return;
}

gst_element_set_state(data.pipeline, GST_STATE_READY);

GstElement* sink = gst_bin_get_by_interface(GST_BIN(data.pipeline),
GST_TYPE_VIDEO_OVERLAY);
if (!sink) {
    qDebug() << "*Could not retrieve videosink!*";
}

gst_video_overlay_set_window_handle (GST_VIDEO_OVERLAY (sink),
window->winId());


I tried to replicate as close as possible the tutorial 3
(https://gstreamer.freedesktop.org/documentation/tutorials/ios/video.html?gi-language=c).

Any suggestions?
Thyaks for the help




--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list