[vlc-commits] [Git][videolan/vlc][master] 3 commits: mft: support NV12 output

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sun Jul 11 08:50:33 UTC 2021



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


Commits:
a8e36de0 by Steve Lhomme at 2021-07-11T08:28:14+00:00
mft: support NV12 output

That's the preferred output format for most codec and also with better DXGI
display support.

- - - - -
459beede by Steve Lhomme at 2021-07-11T08:28:14+00:00
mft: fix compilation warning

And remove a useless cast from void*

- - - - -
ac4cd934 by Steve Lhomme at 2021-07-11T08:28:14+00:00
mft: add support for MPEG-1 and MPEG-2 video decoding

- - - - -


1 changed file:

- modules/codec/mft.c


Changes:

=====================================
modules/codec/mft.c
=====================================
@@ -177,6 +177,9 @@ typedef struct
 static const pair_format_guid video_format_table[] =
 {
     { VLC_CODEC_H264, &MFVideoFormat_H264 },
+    { VLC_CODEC_MPGV, &MFVideoFormat_MPEG2 },
+    { VLC_CODEC_MP2V, &MFVideoFormat_MPEG2 },
+    { VLC_CODEC_MP1V, &MFVideoFormat_MPG1 },
     { VLC_CODEC_MJPG, &MFVideoFormat_MJPG },
     { VLC_CODEC_WMV1, &MFVideoFormat_WMV1 },
     { VLC_CODEC_WMV2, &MFVideoFormat_WMV2 },
@@ -410,7 +413,7 @@ static int SetOutputType(decoder_t *p_dec, DWORD stream_id, IMFMediaType **resul
 
         if (p_dec->fmt_in.i_cat == VIDEO_ES)
         {
-            if (IsEqualGUID(&subtype, &MFVideoFormat_YV12) || IsEqualGUID(&subtype, &MFVideoFormat_I420))
+            if (IsEqualGUID(&subtype, &MFVideoFormat_NV12) || IsEqualGUID(&subtype, &MFVideoFormat_YV12) || IsEqualGUID(&subtype, &MFVideoFormat_I420))
                 found = true;
             /* Transform might offer output in a D3DFMT propietary FCC. If we can
              * use it, fall back to it in case we do not find YV12 or I420 */
@@ -516,6 +519,7 @@ static int AllocateInputSample(decoder_t *p_dec, DWORD stream_id, IMFSample** re
     *result = NULL;
 
     IMFSample *input_sample = NULL;
+    IMFMediaBuffer *input_media_buffer = NULL;
 
     MFT_INPUT_STREAM_INFO input_info;
     hr = IMFTransform_GetInputStreamInfo(p_sys->mft, stream_id, &input_info);
@@ -526,7 +530,6 @@ static int AllocateInputSample(decoder_t *p_dec, DWORD stream_id, IMFSample** re
     if (FAILED(hr))
         goto error;
 
-    IMFMediaBuffer *input_media_buffer = NULL;
     DWORD allocation_size = __MAX(input_info.cbSize, size);
     hr = mf->fptr_MFCreateMemoryBuffer(allocation_size, &input_media_buffer);
     if (FAILED(hr))
@@ -1029,7 +1032,7 @@ static int InitializeMFT(decoder_t *p_dec)
 
         if (p_dec->fmt_in.i_extra)
         {
-            if (h264_isavcC((uint8_t*)p_dec->fmt_in.p_extra, p_dec->fmt_in.i_extra))
+            if (h264_isavcC(p_dec->fmt_in.p_extra, p_dec->fmt_in.i_extra))
             {
                 size_t i_buf;
                 uint8_t *buf = h264_avcC_to_AnnexB_NAL(p_dec->fmt_in.p_extra,



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/8be3b627143e5ba816edc6ecb6585d30a08afede...ac4cd934035e400b9aa468df74158e45fb9cce10

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/8be3b627143e5ba816edc6ecb6585d30a08afede...ac4cd934035e400b9aa468df74158e45fb9cce10
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list