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

alan wang alan.3976 at gmail.com
Tue Sep 6 02:49:08 UTC 2016


Thank You Thiago.

Actually the flag indicates that the h264 stream has video_full_range_flag
set in it.

So my approach is, if *gstomxvideodec* detects *video_full_range_flag* is
set in *sps* of a h264 stream. I'd like *v4l2sink* could be informed. So
that I can pass some arguments through *v4l2_ioctl.*
Of course, I also did some development in *gstomxvideodec* to parse *sps*.

Thanks for your time

2016-09-05 21:52 GMT+08:00 Thiago Sousa Santos <thiagossantos at gmail.com>:

>
>
> 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/GstDeco
>> deBin: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
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160906/6caa9083/attachment-0001.html>


More information about the gstreamer-devel mailing list