[vlc-devel] [PATCH] video_output: use vout_GetDevice for filters
Steve Lhomme
robux4 at ycbcr.xyz
Mon Jun 29 13:01:02 CEST 2020
In any case, I don't think this is right as it stands.
vout_GetDevice() is an internal API that creates the decoder device AND
holds a reference to it. So on creation it has 2 reference. The filter
would only receive one.
The creation reference is kept *internally* in the input resources. So
if you want to create a decoder device you should get it and release it
from the input resources.
On 2020-06-29 12:55, Steve Lhomme wrote:
> What's the use case ? Software decoding and inserting a GPU filter ?
>
> On 2020-06-02 12:45, Alexandre Janniaux wrote:
>> It has the exact same effect, except that it will create the decoder
>> device if it has not been created instead of returning NULL.
>> ---
>> src/video_output/video_output.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/video_output/video_output.c
>> b/src/video_output/video_output.c
>> index 480dfe75f37..e927823d4cd 100644
>> --- a/src/video_output/video_output.c
>> +++ b/src/video_output/video_output.c
>> @@ -973,7 +973,7 @@ static vlc_decoder_device *
>> VoutHoldDecoderDevice(vlc_object_t *o, void *sys)
>> {
>> VLC_UNUSED(o);
>> vout_thread_t *vout = sys;
>> - return vout->p->dec_device ? vlc_decoder_device_Hold(
>> vout->p->dec_device ) : NULL;
>> + return vout_GetDevice(vout);
>> }
>
> If so you should rename the function to VoutGetDecoderDevice. But then
> you'd also need to rename filter_video_callbacks.hold_device and the
> related functions (filter_chain_HoldDecoderDevice,
> filter_HoldDecoderDevice, filter_HoldDecoderDeviceType).
>
> It seems whatever GPU filter using a decoder device will likely want the
> same feature if it's used with a CPU decoder.
>
>> static const struct filter_video_callbacks vout_video_cbs = {
>> --
>> 2.26.2
>>
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
>>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
More information about the vlc-devel
mailing list