<html><head></head><body style="zoom: 0%;"><div dir="auto">Hi,<br><br></div>
<div dir="auto">I agree, though I am trying to play 4K 12bits videos so the fallback to CPU decoding does not help much.<br><br></div>
<div dir="auto">I'm fine with adding some sort of "if forced" condition to this commit but I'm not sure how to detect it. Can you point me in the right direction ?</div>
<div class="gmail_quote" >On Apr 7, 2020, at 07:56, Steve Lhomme <<a href="mailto:robux4@ycbcr.xyz" target="_blank">robux4@ycbcr.xyz</a>> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="blue">On the other hand we may use this "delayed" behavior if nvdec is the <br>forced decoder. But that's not how most people are going to use it.<br><br>On 2020-04-07 7:52, Steve Lhomme wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> I don't think this is correct. If we can't tell the video format during <br> Open, there is no way to tell if we will be able to decode the stream or <br> not. So we may be selected as the decoder but in the end we can't decode <br> the video. At this point it's too late to fallback to a more suitable <br> decoder (libavcodec).<br> <br> That's a drawback of the nvdec decoder until we can restart decoders <br> without losing data for the next decoder (if that ever happens). That's <br> also a reason why nvdec can have a higher priority than libavcodec, <br> because it will fallback properly.<br> <br> On 2020-04-06 15:02, quentin.chateau@deepskycorp.com wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"> From: Quentin Chateau <quentin.chateau@deepskycorp.com><br><br> When the chroma and depth is unknown to the hxxx_helper,<br> fallback to the common 4:2:0 8bits format as initial value.<br> The decoder may change these values later on.<br> ---<br>   modules/hw/nvdec/nvdec.c | 20 ++++++++++++--------<br>   1 file changed, 12 insertions(+), 8 deletions(-)<br><br> diff --git a/modules/hw/nvdec/nvdec.c b/modules/hw/nvdec/nvdec.c<br> index e3aeff2355..ca28522d32 100644<br> --- a/modules/hw/nvdec/nvdec.c<br> +++ b/modules/hw/nvdec/nvdec.c<br> @@ -923,15 +923,19 @@ static int OpenDecoder(vlc_object_t *p_this)<br>       // try different output<br>       if (p_sys->b_is_hxxx)<br>       {<br> -        uint8_t i_chroma_idc, i_depth_chroma;<br> -        result = hxxx_helper_get_chroma_chroma(&p_sys->hh, <br> &i_chroma_idc,<br> -                                            &i_depth_luma, <br> &i_depth_chroma);<br> -        if (result != VLC_SUCCESS) {<br> -            if (p_sys->b_is_hxxx)<br> -                hxxx_helper_clean(&p_sys->hh);<br> -            return VLC_EGENERIC;<br> +        uint8_t hxxx_chroma_idc, hxxx_depth_chroma, hxxx_depth_luma;<br> +        result = hxxx_helper_get_chroma_chroma(&p_sys->hh, <br> &hxxx_chroma_idc,<br> +                                            &hxxx_depth_luma, <br> &hxxx_depth_chroma);<br> +        if (result == VLC_SUCCESS)<br> +        {<br> +            i_depth_luma = hxxx_depth_luma;<br> +            cudaChroma = MapChomaIDC(hxxx_chroma_idc);<br> +        }<br> +        else<br> +        {<br> +            cudaChroma = cudaVideoChromaFormat_420;<br> +            i_depth_luma = 8;<br>           }<br> -        cudaChroma = MapChomaIDC(i_chroma_idc);<br>           unsigned i_w, i_h, i_vw, i_vh;<br>           result = hxxx_helper_get_current_picture_size(&p_sys->hh, <br> &i_w, &i_h, &i_vw, &i_vh);<br> -- <br> 2.17.1<br><br><hr><br> vlc-devel mailing list<br> To unsubscribe or modify your subscription options:<br> <a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a></blockquote><br><hr><br> vlc-devel mailing list<br> To unsubscribe or modify your subscription options:<br> <a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></blockquote><hr><br>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a></pre></blockquote></div></body></html>