Number of threads in a typical Gstreamer pipeline

Mohammad Sheraj msheraj at qti.qualcomm.com
Fri Oct 22 03:48:11 UTC 2021


Hi,

I want to improve my understanding of Gstreamer.

How many threads are there in this GStreamer pipeline?
gst-launch-1.0 autovideosrc ! queue ! fakesink

I want the total number and function of each thread.
I searched online and in the documentation (https://gstreamer.freedesktop.org/documentation/application-development/advanced/threads.html?gi-language=c#) but couldn't find a clear answer.

My knowledge is that there is a main loop thread, an event thread (not sure) and two (because of queue element) buffer threads here.
This gives a total of 4 threads for the mentioned pipeline.

Am I correct? Or is there some other mechanism?

**Experiments:**

Running the first time gives 8 threads initially.
/ # ps -T | grep "gst"
3681 root      0:00 gst-launch-1.0 autovideosrc ! queue ! fakesink
3702 root      0:00 gst-launch-1.0 autovideosrc ! queue ! fakesink
3703 root      0:00 gst-launch-1.0 autovideosrc ! queue ! fakesink
3704 root      0:00 gst-launch-1.0 autovideosrc ! queue ! fakesink
3716 root      0:00 {queue0:src} gst-launch-1.0 autovideosrc ! queue ! fakesink
3717 root      0:00 {fake-auto-video} gst-launch-1.0 autovideosrc ! queue ! fakesink
3718 root      0:00 {gmain} gst-launch-1.0 autovideosrc ! queue ! fakesink
3719 root      0:00 {pool} gst-launch-1.0 autovideosrc ! queue ! fakesink
3729 root      0:00 grep gst

After some time it becomes 7 threads

/ # ps -T | grep "gst"
3681 root      0:00 gst-launch-1.0 autovideosrc ! queue ! fakesink
3702 root      0:00 gst-launch-1.0 autovideosrc ! queue ! fakesink
3703 root      0:00 gst-launch-1.0 autovideosrc ! queue ! fakesink
3704 root      0:00 gst-launch-1.0 autovideosrc ! queue ! fakesink
3716 root      0:00 {queue0:src} gst-launch-1.0 autovideosrc ! queue ! fakesink
3717 root      0:02 {fake-auto-video} gst-launch-1.0 autovideosrc ! queue ! fakesink
3718 root      0:00 {gmain} gst-launch-1.0 autovideosrc ! queue ! fakesink
3731 root      0:00 grep gst

I did `strace -p 3681` and so on and found

3681:
ppoll([{fd=3, events=POLLIN}, {fd=9, events=POLLIN}], 2, NULL, NULL, 0
3702:
ioctl(11, BINDER_WRITE_READ
3703
ioctl(11, BINDER_WRITE_READ
3704:
ioctl(11, BINDER_WRITE_READ
3716:
...
futex(0x5580a842a8, FUTEX_WAIT_PRIVATE, 11083, NULL) = 0
3717:
...
ppoll([{fd=6, events=POLLIN|POLLPRI|POLLERR|POLLHUP|POLLNVAL}], 1, {tv_sec=0, tv_nsec=31373754}, NULL, 8) = 0 (Timeout)
futex(0x5580a842a8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x5580a84290, FUTEX_WAKE_PRIVATE, 1) = 1
3718:
ppoll([{fd=5, events=POLLIN}], 1, NULL, NULL, 0

What does this mean?

Thanks and Regards,

Mohammad Sheraj
Connected Smart Systems (CSS)
Qualcomm

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20211022/3eba9bb7/attachment.htm>


More information about the gstreamer-devel mailing list