Set max-threads on avdec_h264 which is inside of decodebin

Alex Bolotin alexbolotsin at gmail.com
Tue Apr 19 17:39:19 UTC 2016


Hi,

I had a problem to set up variable on avdec_h264 which is in decodebin and
appears after pipeline being started. I'm using GST 1.6.4.

Some kind guy told me to set it up in a bus watcher. So in my bus watcher
function I have such piece of code:
        if (new_state == GST_STATE_READY) {
            GstElement* avdec = get_pipeline_element(pipeline,
"avdec_h264");
            if (avdec && args_has_argument(job->args,
"avdec_h264.max-threads")) {
                int threads = args_to_int(args_get_value(job->args,
"avdec_h264.max-threads"));
                g_object_set(avdec, "max-threads", threads, NULL);
            }
        }

But I have an issue some of started instances consumes more memory, but
usually after restart they're ok on mem. So I've checked thread number on
those tasks and found out that max-threads doesn't always apply before
starting the stream, at least it ignores max-threads.

Ie 1st run has 45 threads and consumes 660mb, after restart - 23 threads
and 280mb.

So I believe it's some kind of a race condition. Since GST heavy
multithreaded framework, I find it most likely reason.

How I can avoid it?

Thx,
AlexBhpp
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160419/70650a14/attachment-0001.html>


More information about the gstreamer-devel mailing list