appsink to appsrc issue

Ádám Balázs broothy at gmail.com
Wed Jul 20 12:50:27 UTC 2022


Hi,

I have the following pipelines:
gst_parse_launch(R"(udpsrc port=4000 !
application/x-rtp,payload=96,encoding-name=OPUS ! queue ! rtpopusdepay !
appsink name=appsink)", nullptr)}
and
gst_parse_launch(R"(appsrc name=appsrc caps="audio/x-opus" ! queue !
opusdec ! autoaudiosink)", nullptr)}

For the appsink in the first pipeline I set "emit-signals", true and
connect "new-sample" to a callback that pushes the buffer into a queue.

For the appsrc in the second pipeline I connect callbacks to its "need-data"
and "enough-data" signals. Those callbacks set or reset the g_main_loop's
idle function to a function that reads a buffer from the queue (filled by
the appsink of the first pipeline) and pushes it to appsrc with
"push-buffer".

Unfortunately the second pipeline fails as soon as the first buffer is
pushed to it with the following log:
0:00:00.045154855 57060 0x55a09f976700 INFO               GST_EVENT
gstevent.c:900:gst_event_new_segment: creating segment event bytes segment
start=0, offset=0, stop=-1, rate=1.000000, applied_rate=1.000000,
flags=0x00, time=0, base=0, position 0, duration -1
0:00:00.045165391 57060 0x55a09f976700 INFO                 basesrc
gstbasesrc.c:2962:gst_base_src_loop:<appsrc> marking pending DISCONT
0:00:00.045180104 57060 0x55a09f976700 WARN                 basesrc
gstbasesrc.c:3072:gst_base_src_loop:<appsrc> error: Internal data stream
error.
0:00:00.045183271 57060 0x55a09f976700 WARN                 basesrc
gstbasesrc.c:3072:gst_base_src_loop:<appsrc> error: streaming stopped,
reason not-negotiated (-4)
0:00:00.045196292 57060 0x55a09f976700 INFO        GST_ERROR_SYSTEM
gstelement.c:2140:gst_element_message_full_with_details:<appsrc> posting
message: Internal data stream error.
0:00:00.045212868 57060 0x55a09f976700 INFO        GST_ERROR_SYSTEM
gstelement.c:2167:gst_element_message_full_with_details:<appsrc> posted
error message: Internal data stream error.
0:00:00.045225606 57060 0x55a09f976700 INFO                    task
gsttask.c:312:gst_task_func:<appsrc:src> Task going to paused

Without the appsink -> appsrc detour (if I chain the elements into one
pipeline) everything works. If I remove the opusdec and autoaudiosink from
the end of the second pipeline and I replace it with another appsink it
sees the data and the pipeline works well.

Is there any trick I should do to be able to feed opusdec from an appsrc?

Thanks a lot,
Adam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20220720/4ef53d99/attachment.htm>


More information about the gstreamer-devel mailing list