Set max-threads on avdec_h264 which is inside of decodebin

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


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,
            if (avdec && args_has_argument(job->args,
"avdec_h264.max-threads")) {
                int threads = args_to_int(args_get_value(job->args,
                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?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gstreamer-devel mailing list