[vlc-commits] [Git][videolan/vlc][master] mft: use NV12 source when the original is not supported

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sun Dec 17 15:27:20 UTC 2023



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
cdf486f2 by Steve Lhomme at 2023-12-17T14:30:31+00:00
mft: use NV12 source when the original is not supported

We may try to pick a more fitting format for 10-bit or non-4:2:0 source but that will do for now.

- - - - -


1 changed file:

- modules/codec/mft.cpp


Changes:

=====================================
modules/codec/mft.cpp
=====================================
@@ -2290,9 +2290,12 @@ static int OpenMFTVideoEncoder(vlc_object_t *p_this)
     hr = MFTypeFromChroma(p_enc->fmt_in.video.i_chroma, p_enc->vctx_in, input_type);
     if (FAILED(hr))
     {
-        msg_Dbg(p_this, "Input codec %4.4s not supported by MediaFoundation",
+        msg_Dbg(p_this, "Input chroma %4.4s not supported by MediaFoundation, forcing NV12",
                 (char*)&p_enc->fmt_in.i_codec);
-        goto error;
+        p_enc->fmt_in.video.i_chroma = VLC_CODEC_NV12;
+        p_enc->fmt_in.i_codec = p_enc->fmt_in.video.i_chroma;
+        hr = MFTypeFromChroma(p_enc->fmt_in.video.i_chroma, nullptr, input_type);
+        assert(SUCCEEDED(hr));
     }
 
     hr = MFTypeFromCodec(MFMediaType_Video, p_enc->fmt_out.i_codec, output_type);



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/cdf486f249313206940f0d39a6ca655b2b50c16c

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/cdf486f249313206940f0d39a6ca655b2b50c16c
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list