Set max-threads on avdec_h264 which is inside of decodebin

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Set max-threads on avdec_h264 which is inside of decodebin

Alex Bolotin
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

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