How to set property of dynamic child of decodebin

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

How to set property of dynamic child of decodebin

vipcxj
I want to write a application use nvcodec to decode the video. I use decodebin to make it support multi media type. I want to provide the cuda context myself instead using the default one.
I know I can use the NEED_CONTEXT message to provide the context. But then I found it not work. Because the default property cuda-device-id of many nvcodec element are 0. Which means they only accept the cuda context of device 0. This is so annoyed. So I must set the child property cuda-device-id to -1 before they refuse my context. So I need a method to set the property of dynamic child of decodebin just after they are created by decodebin.
I know I can use GstChildProxy interface to set the property of child of decodebin. But if the child has not been created, will this operation still success? And it seems that I need know the name of child if I use GstChildProxy interface. This also doesn't fit my usage scenario, it's precisely because I don't know which decoder is supposed to be used that I use decodebin, and now I have to specify the decoder's name, so wouldn't that be the opposite of the original purpose. I also know I can modify the element factory by using autoplug-sort signal. But I don't know how to set the property of element by factory.
Reply | Threaded
Open this post in threaded view
|

Re: How to set property of dynamic child of decodebin

vipcxj
I found cuda-device-id is readonly~ What a tragedy