About the Appsrc example appsrc-stream

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

About the Appsrc example appsrc-stream

snowmania

Hello,

 

We’re building a Gstreamer application with the following pipeline:

Appsrc à videconvert à xvimagsink

 

Appsrc will in the end be a image buffer updated at 10Hz but for now we’re just reading png images and putting them in a buffer that we want to push to appsrc.

 

We looked into this example

 https://cgit.freedesktop.org/gstreamer/gst-plugins-base/tree/tests/examples/app/appsrc-stream.c

 

And have a couple of questions.

-          What is the difference between using the function gst_app_src_push_buffer() or emitting the signal g_signal_emit_by_name (app->appsrc, "push-buffer", buffer, &ret); (l105 in the example)

-          The example uses the signal “need-data” coupled to the callback start_feed, but it’s using the push mode of appsrc, which is confusing since it sounds more like a pull than a push.

 

Thanks in advance for the help!

Claire


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: About the Appsrc example appsrc-stream

Nicolas Dufresne-5
Le jeudi 06 décembre 2018 à 10:27 +0000, Claire Mantel a écrit :

Hello,

 

We’re building a Gstreamer application with the following pipeline:

Appsrc à videconvert à xvimagsink

 

Appsrc will in the end be a image buffer updated at 10Hz but for now we’re just reading png images and putting them in a buffer that we want to push to appsrc.

 

We looked into this example

 https://cgit.freedesktop.org/gstreamer/gst-plugins-base/tree/tests/examples/app/appsrc-stream.c

 

And have a couple of questions.

-          What is the difference between using the function gst_app_src_push_buffer() or emitting the signal g_signal_emit_by_name (app->appsrc, "push-buffer", buffer, &ret); (l105 in the example)


gst_app_src_push_buffer() requires to link your application to the libgstapp library. On the other side, the buffer is passed in "transfer-full" manner (giving away your ref) which is more efficient and ensure the buffers can be written/owned by GStreamer without copies.

-          The example uses the signal “need-data” coupled to the callback start_feed, but it’s using the push mode of appsrc, which is confusing since it sounds more like a pull than a push.


need-data signal indicated that the appsrc internal queue is no longer full. Though, it's not a pull API since you don't return a buffer in that callback. Push function simply place a buffer in the queue, unless the queue is full (it is unlimited by default, so it's never full unless configured).

 

Thanks in advance for the help!

Claire

_______________________________________________
gstreamer-devel mailing list
[hidden email]

https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (201 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: About the Appsrc example appsrc-stream

snowmania

Thanks a lot for the answer.

 

One follow up question is that for now we show 10 images in a infinite loop with push_buffer. They are not shown smoothly but it seems some of them are dropped. Since the push buffer is unlimited, it would mean we don't push them fast enough to the queue?

 

Claire

 

From: gstreamer-devel <[hidden email]> On Behalf Of Nicolas Dufresne
Sent: 6. december 2018 19:52
To: Discussion of the development of and with GStreamer <[hidden email]>
Subject: Re: About the Appsrc example appsrc-stream

 

Le jeudi 06 décembre 2018 à 10:27 +0000, Claire Mantel a écrit :

Hello,

 

We’re building a Gstreamer application with the following pipeline:

Appsrc à videconvert à xvimagsink

 

Appsrc will in the end be a image buffer updated at 10Hz but for now we’re just reading png images and putting them in a buffer that we want to push to appsrc.

 

We looked into this example

 https://cgit.freedesktop.org/gstreamer/gst-plugins-base/tree/tests/examples/app/appsrc-stream.c

 

And have a couple of questions.

-          What is the difference between using the function gst_app_src_push_buffer() or emitting the signal g_signal_emit_by_name (app->appsrc, "push-buffer", buffer, &ret); (l105 in the example)

 

gst_app_src_push_buffer() requires to link your application to the libgstapp library. On the other side, the buffer is passed in "transfer-full" manner (giving away your ref) which is more efficient and ensure the buffers can be written/owned by GStreamer without copies.

 

-           

-          The example uses the signal “need-data” coupled to the callback start_feed, but it’s using the push mode of appsrc, which is confusing since it sounds more like a pull than a push.

 

need-data signal indicated that the appsrc internal queue is no longer full. Though, it's not a pull API since you don't return a buffer in that callback. Push function simply place a buffer in the queue, unless the queue is full (it is unlimited by default, so it's never full unless configured).

 

-           

 

Thanks in advance for the help!

Claire

_______________________________________________
gstreamer-devel mailing list

[hidden email]

[hidden email]

 

 

https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

 

 

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel