What's it the right way to communicate between elements (gstomxvideodec and gstv4l2sink)

Thiago Sousa Santos thiagossantos at gmail.com
Mon Sep 5 13:52:26 UTC 2016


On Mon, Sep 5, 2016 at 10:31 AM, alan wang <alan.3976 at gmail.com> wrote:

> Hello
>
> I have a requirement that when dealing with h264 stream If some flag is
> detected in the stream. The v4l2sink should be noticed.
>
> The work flow is like:
> gstomxvideodec.c--->handle_frame-->[certain flag detected]--->notify--->
> gstv4l2sink.c
>

It depends on the kind of information you want to pass onwards. Usually,
you have 3 choices:

1) If it is a format change: use a caps event
2) If it is some event in the middle of the stream (like a metadata change)
you can use a custom GstEvent to notify downstream.
3) If is a flag that indicates some particular information for a frame, you
can attach a buffer meta to a GstBuffer.

If you provide more details on what this flag is and how it is used we
could try to guide you better on how to do it.

>
> Below is what I've done in gstomxvideodec.c:gst_omx_video_dec_handle_frame
>
>
>     caps =
>         gst_caps_new_full (gst_structure_new ("flag",
>         "flag", G_TYPE_INT, 1, NULL), NULL);
>
>     if (!gst_pad_push_event (GST_VIDEO_DECODER_SINK_PAD(decoder),
>                 gst_event_new_caps (caps))) {
>       return GST_FLOW_ERROR;
>     }
>
> I was hoping, above code would invoke gstv4l2sink.c:gst_v4l2sink_set_caps.
> Then I can extract the caps and do I have to do.
>
> But all I got is error message says:
>
> (gst-launch-1.0:7180): GStreamer-WARNING **: pad
> omxh264dec-omxh264dec0:sink pushing caps event in wrong direction
> 0:00:01.210275279  7180 0xb5c01920 WARN                 qtdemux
> qtdemux.c:5307:gst_qtdemux_loop:<qtdemux0> error: streaming stopped,
> reason error
> ERROR: from element /GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstQTDemux:qtdemux0:
> GStreamer encountered a general stream error.
>
>
> It seems that, the event caps is sent to qtdemux not to v4l2sink as I
> expected.
>
> So what is the right way to communicate between gstomxvidedec and v4l2sink
> ?
>
> Thank You for your time.
>
> Alan
>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>


-- 
Thiago Sousa Santos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160905/8ed2d7f0/attachment.html>


More information about the gstreamer-devel mailing list