[vlc-commits] [Git][videolan/vlc][master] 13 commits: mft: use GUID values

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Mar 31 10:30:51 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
685a068e by Steve Lhomme at 2023-03-31T10:06:22+00:00
mft: use GUID values

In C++ we don't need to link with the UUID libraries

- - - - -
33431bc4 by Steve Lhomme at 2023-03-31T10:06:22+00:00
mft: simplify GUID subtype checking with WRL

- - - - -
069c582e by Steve Lhomme at 2023-03-31T10:06:22+00:00
mft: log the reason SetInputType failed

- - - - -
22b6caff by Steve Lhomme at 2023-03-31T10:06:22+00:00
mft: read the activated object directly in the object with WRL

- - - - -
3d80f037 by Steve Lhomme at 2023-03-31T10:06:22+00:00
mft: use MFSetAttributeSize to set MF_MT_FRAME_SIZE

This is the proper way according to the documentation.

- - - - -
397be91e by Steve Lhomme at 2023-03-31T10:06:22+00:00
mft: use MFSetAttributeRatio to set MF_MT_FRAME_RATE

This is the proper way according to the documentation.

- - - - -
c2a012f3 by Steve Lhomme at 2023-03-31T10:06:22+00:00
meson: link d3d11_common with uuid

Otherwise it's missing IID_IDXGIDevice used from C.

- - - - -
48dee52d by Steve Lhomme at 2023-03-31T10:06:22+00:00
meson: build the MFT plugin on Windows

- - - - -
d067627a by Steve Lhomme at 2023-03-31T10:06:22+00:00
mft: support MFVideoFormat_IYUV output

It should be identical to MFVideoFormat_I420 according to
https://learn.microsoft.com/en-us/windows/win32/directshow/yuv-video-subtypes

- - - - -
70410eed by Steve Lhomme at 2023-03-31T10:06:22+00:00
mft: simplify output setting with WRL

- - - - -
6d64aafa by Steve Lhomme at 2023-03-31T10:06:22+00:00
mft: add more useful debug/error logs

- - - - -
46f1d6f2 by Steve Lhomme at 2023-03-31T10:06:22+00:00
mft: use ORIENT_VFLIPPED for D3DFMT output

This is more readable considering the comment.

- - - - -
181e91d0 by Steve Lhomme at 2023-03-31T10:06:22+00:00
mft: use the official AV1/L8 GUID definitions

We only define them when they are missing from the mingw-w64 headers.

- - - - -


3 changed files:

- modules/codec/Makefile.am
- modules/codec/meson.build
- modules/codec/mft.cpp


Changes:

=====================================
modules/codec/Makefile.am
=====================================
@@ -611,7 +611,7 @@ endif
 libmft_plugin_la_SOURCES = codec/mft.cpp
 libmft_plugin_la_CXXFLAGS = $(AM_CXXFLAGS) $(LIBCOMCXXFLAGS)
 if HAVE_WIN32
-libmft_plugin_la_LIBADD = $(LIBCOM) -luuid -lmfuuid -lmfplat libvlc_hxxxhelper.la libd3d11_common.la
+libmft_plugin_la_LIBADD = $(LIBCOM) -luuid -lmfplat libvlc_hxxxhelper.la libd3d11_common.la
 codec_LTLIBRARIES += libmft_plugin.la
 if HAVE_WINSTORE
 libmft_plugin_la_LIBADD += -ld3d11


=====================================
modules/codec/meson.build
=====================================
@@ -632,6 +632,7 @@ if host_system == 'windows'
         dependencies: [
             cc.find_library('dxguid'),
             cc.find_library('wbemuuid'),
+            cc.find_library('uuid'),
         ]
     )
     d3d9_common_lib = static_library('d3d9_common',
@@ -643,6 +644,24 @@ if host_system == 'windows'
         pic: true,
         install: false
     )
+
+    mft_link_with = [ cc.find_library('mfplat'), d3d11_common_lib ]
+    if get_option('winstore_app')
+        mft_link_with += [ cc.find_library('d3d11') ]
+    endif
+    vlc_modules += {
+        'name' : 'mft',
+        'sources' : files(
+                'mft.cpp',
+                'hxxx_helper.c',
+                '../packetizer/hxxx_nal.c',
+                '../packetizer/hxxx_sei.c',
+                '../packetizer/h264_slice.c',
+                '../packetizer/h264_nal.c',
+                '../packetizer/hevc_nal.c'
+            ),
+        'link_with' : mft_link_with
+    }
 endif
 
 # OpenMAX IL codec


=====================================
modules/codec/mft.cpp
=====================================
@@ -84,11 +84,6 @@ public:
         assert(!streamStarted);
     }
 
-    const GUID* major_type = nullptr;
-    const GUID* subtype = nullptr;
-    /* Container for a dynamically constructed subtype */
-    GUID custom_subtype;
-
     // Direct3D
     vlc_video_context  *vctx_out = nullptr;
     const d3d_format_t *cfg = nullptr;
@@ -256,10 +251,22 @@ enum
 typedef struct
 {
     vlc_fourcc_t fourcc;
-    const GUID   *guid;
+    const GUID   guid;
 } pair_format_guid;
 
-DEFINE_MEDIATYPE_GUID (vlc_MFVideoFormat_AV1, FCC('AV01'));
+#if defined(__MINGW64_VERSION_MAJOR)
+# if __MINGW64_VERSION_MAJOR < 10
+// 8-bit luminance only
+// Older versions of mingw-w64 lack this GUID, but it was added in mingw-w64
+// git on 2021-07-11 (during __MINGW64_VERSION_MAJOR 10). Use a local
+// redefinition of this GUID with a custom prefix, to let the same code build
+// with both older and newer versions of mingw-w64 (and earlier git snapshots
+// with __MINGW64_VERSION_MAJOR == 10).
+DEFINE_MEDIATYPE_GUID (MFVideoFormat_L8, 50); // D3DFMT_L8
+
+DEFINE_MEDIATYPE_GUID (MFVideoFormat_AV1, FCC('AV01'));
+# endif  // __MINGW64_VERSION_MAJOR >= 0
+#endif // __MINGW64_VERSION_MAJOR
 
 /*
  * We need this table since the FOURCC used for GUID is not the same
@@ -267,37 +274,28 @@ DEFINE_MEDIATYPE_GUID (vlc_MFVideoFormat_AV1, FCC('AV01'));
  */
 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 },
-    { VLC_CODEC_WMV3, &MFVideoFormat_WMV3 },
-    { VLC_CODEC_VC1,  &MFVideoFormat_WVC1 },
-    { VLC_CODEC_AV1,  &vlc_MFVideoFormat_AV1 },
-    { 0, NULL }
+    { 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 },
+    { VLC_CODEC_WMV3, MFVideoFormat_WMV3 },
+    { VLC_CODEC_VC1,  MFVideoFormat_WVC1 },
+    { VLC_CODEC_AV1,  MFVideoFormat_AV1 },
+    { 0, GUID_NULL }
 };
 
-// 8-bit luminance only
-
-// Older versions of mingw-w64 lack this GUID, but it was added in mingw-w64
-// git on 2021-07-11 (during __MINGW64_VERSION_MAJOR 10). Use a local
-// redefinition of this GUID with a custom prefix, to let the same code build
-// with both older and newer versions of mingw-w64 (and earlier git snapshots
-// with __MINGW64_VERSION_MAJOR == 10).
-DEFINE_MEDIATYPE_GUID (vlc_MFVideoFormat_L8, 50);
-
 /*
  * Table to map MF Transform raw 3D3 output formats to native VLC FourCC
  */
 static const pair_format_guid d3d_format_table[] = {
-    { VLC_CODEC_RGB32, &MFVideoFormat_RGB32  },
-    { VLC_CODEC_RGB24, &MFVideoFormat_RGB24  },
-    { VLC_CODEC_RGBA,  &MFVideoFormat_ARGB32 },
-    { VLC_CODEC_GREY,  &vlc_MFVideoFormat_L8 },
-    { 0, NULL }
+    { VLC_CODEC_RGB32, MFVideoFormat_RGB32  },
+    { VLC_CODEC_RGB24, MFVideoFormat_RGB24  },
+    { VLC_CODEC_RGBA,  MFVideoFormat_ARGB32 },
+    { VLC_CODEC_GREY,  MFVideoFormat_L8 },
+    { 0, GUID_NULL }
 };
 
 /*
@@ -306,34 +304,34 @@ static const pair_format_guid d3d_format_table[] = {
  */
 static const pair_format_guid audio_format_table[] =
 {
-    { VLC_CODEC_MPGA, &MFAudioFormat_MPEG      },
-    { VLC_CODEC_MP3,  &MFAudioFormat_MP3       },
-    { VLC_CODEC_DTS,  &MFAudioFormat_DTS       },
-    { VLC_CODEC_MP4A, &MFAudioFormat_AAC       },
-    { VLC_CODEC_WMA2, &MFAudioFormat_WMAudioV8 },
-    { VLC_CODEC_A52,  &MFAudioFormat_Dolby_AC3 },
-    { 0, NULL }
+    { VLC_CODEC_MPGA, MFAudioFormat_MPEG      },
+    { VLC_CODEC_MP3,  MFAudioFormat_MP3       },
+    { VLC_CODEC_DTS,  MFAudioFormat_DTS       },
+    { VLC_CODEC_MP4A, MFAudioFormat_AAC       },
+    { VLC_CODEC_WMA2, MFAudioFormat_WMAudioV8 },
+    { VLC_CODEC_A52,  MFAudioFormat_Dolby_AC3 },
+    { 0, GUID_NULL }
 };
 
-static const GUID *FormatToGUID(const pair_format_guid table[], vlc_fourcc_t fourcc)
+static const GUID & FormatToGUID(const pair_format_guid table[], vlc_fourcc_t fourcc)
 {
     for (int i = 0; table[i].fourcc; ++i)
         if (table[i].fourcc == fourcc)
             return table[i].guid;
 
-    return NULL;
+    return GUID_NULL;
 }
 
 static vlc_fourcc_t GUIDToFormat(const pair_format_guid table[], const GUID & guid)
 {
     for (int i = 0; table[i].fourcc; ++i)
-        if (IsEqualGUID(*table[i].guid, guid))
+        if (table[i].guid == guid)
             return table[i].fourcc;
 
     return 0;
 }
 
-static int SetInputType(decoder_t *p_dec, DWORD stream_id, ComPtr<IMFMediaType> & result)
+static int SetInputType(decoder_t *p_dec, DWORD stream_id, const GUID & mSubtype, ComPtr<IMFMediaType> & result)
 {
     mft_dec_sys_t *p_sys = static_cast<mft_dec_sys_t*>(p_dec->p_sys);
     HRESULT hr;
@@ -343,13 +341,11 @@ static int SetInputType(decoder_t *p_dec, DWORD stream_id, ComPtr<IMFMediaType>
     ComPtr<IMFMediaType> input_media_type;
 
     /* Search a suitable input type for the MFT. */
-    int input_type_index = 0;
-    bool found = false;
-    for (int i = 0; !found; ++i)
+    for (int i = 0;; ++i)
     {
-        hr = p_sys->mft->GetInputAvailableType(stream_id, i, &input_media_type);
+        hr = p_sys->mft->GetInputAvailableType(stream_id, i, input_media_type.ReleaseAndGetAddressOf());
         if (hr == MF_E_NO_MORE_TYPES)
-            break;
+            goto error;
         else if (hr == MF_E_TRANSFORM_TYPE_NOT_SET)
         {
             /* The output type must be set before setting the input type for this MFT. */
@@ -363,27 +359,15 @@ static int SetInputType(decoder_t *p_dec, DWORD stream_id, ComPtr<IMFMediaType>
         if (FAILED(hr))
             goto error;
 
-        if (IsEqualGUID(subtype, *p_sys->subtype))
-            found = true;
-
-        if (found)
-            input_type_index = i;
-
-        input_media_type.Reset();
+        if (subtype == mSubtype)
+            break;
     }
-    if (!found)
-        goto error;
-
-    hr = p_sys->mft->GetInputAvailableType(stream_id, input_type_index, &input_media_type);
-    if (FAILED(hr))
-        goto error;
 
     if (p_dec->fmt_in->i_cat == VIDEO_ES)
     {
         UINT64 width = p_dec->fmt_in->video.i_width;
         UINT64 height = p_dec->fmt_in->video.i_height;
-        UINT64 frame_size = (width << 32) | height;
-        hr = input_media_type->SetUINT64(MF_MT_FRAME_SIZE, frame_size);
+        hr = MFSetAttributeSize(input_media_type.Get(), MF_MT_FRAME_SIZE, width, height);
         if (FAILED(hr))
             goto error;
 
@@ -391,15 +375,14 @@ static int SetInputType(decoder_t *p_dec, DWORD stream_id, ComPtr<IMFMediaType>
         UINT64 frame_ratio_num = p_dec->fmt_in->video.i_frame_rate;
         UINT64 frame_ratio_dem = p_dec->fmt_in->video.i_frame_rate_base;
         if(frame_ratio_num && frame_ratio_dem) {
-            UINT64 frame_rate = (frame_ratio_num << 32) | frame_ratio_dem;
-            hr = input_media_type->SetUINT64(MF_MT_FRAME_RATE, frame_rate);
+            hr = MFSetAttributeRatio(input_media_type.Get(), MF_MT_FRAME_RATE, frame_ratio_num, frame_ratio_dem);
             if(FAILED(hr))
                 goto error;
         }
     }
     else
     {
-        hr = input_media_type->SetUINT32(MF_MT_ORIGINAL_WAVE_FORMAT_TAG, p_sys->subtype->Data1);
+        hr = input_media_type->SetUINT32(MF_MT_ORIGINAL_WAVE_FORMAT_TAG, mSubtype.Data1);
         if (FAILED(hr))
             goto error;
         if (p_dec->fmt_in->audio.i_rate)
@@ -460,7 +443,7 @@ static int SetInputType(decoder_t *p_dec, DWORD stream_id, ComPtr<IMFMediaType>
     return VLC_SUCCESS;
 
 error:
-    msg_Err(p_dec, "Error in SetInputType()");
+    msg_Err(p_dec, "Error in SetInputType(). (hr=0x%lX)", hr);
     return VLC_EGENERIC;
 }
 
@@ -476,13 +459,22 @@ static int SetOutputType(decoder_t *p_dec, DWORD stream_id)
      * preference thus we will use the first one unless YV12/I420 is
      * available for video or float32 for audio.
      */
+    GUID subtype;
     int output_type_index = -1;
-    bool found = false;
-    for (int i = 0; !found; ++i)
+    for (int i = 0; output_type_index == -1; ++i)
     {
-        hr = p_sys->mft->GetOutputAvailableType(stream_id, i, &output_media_type);
+        hr = p_sys->mft->GetOutputAvailableType(stream_id, i, output_media_type.ReleaseAndGetAddressOf());
         if (hr == MF_E_NO_MORE_TYPES)
+        {
+            /*
+            * It's not an error if we don't find the output type we were
+            * looking for, in this case we use the first available type.
+            */
+            /* No output format found we prefer, just pick the first one preferred
+            * by the MFT */
+            output_type_index = 0;
             break;
+        }
         else if (hr == MF_E_TRANSFORM_TYPE_NOT_SET)
         {
             /* The input type must be set before setting the output type for this MFT. */
@@ -491,19 +483,19 @@ static int SetOutputType(decoder_t *p_dec, DWORD stream_id)
         else if (FAILED(hr))
             goto error;
 
-        GUID subtype;
         hr = output_media_type->GetGUID(MF_MT_SUBTYPE, &subtype);
         if (FAILED(hr))
             goto error;
 
         if (p_dec->fmt_in->i_cat == VIDEO_ES)
         {
-            if (IsEqualGUID(subtype, MFVideoFormat_NV12) || IsEqualGUID(subtype, MFVideoFormat_YV12) || IsEqualGUID(subtype, MFVideoFormat_I420))
-                found = true;
+            if (subtype == MFVideoFormat_NV12 || subtype == MFVideoFormat_YV12
+             || subtype == MFVideoFormat_I420 || subtype == MFVideoFormat_IYUV)
+                output_type_index = i;
             /* Transform might offer output in a D3DFMT proprietary FCC. If we can
              * use it, fall back to it in case we do not find YV12 or I420 */
             else if(output_type_index < 0 && GUIDToFormat(d3d_format_table, subtype) > 0)
-                    output_type_index = i;
+                output_type_index = i;
         }
         else
         {
@@ -511,36 +503,25 @@ static int SetOutputType(decoder_t *p_dec, DWORD stream_id)
             hr = output_media_type->GetUINT32(MF_MT_AUDIO_BITS_PER_SAMPLE, &bits_per_sample);
             if (FAILED(hr))
                 continue;
-            if (bits_per_sample == 32 && IsEqualGUID(subtype, MFAudioFormat_Float))
-                found = true;
+            if (bits_per_sample == 32 && subtype == MFAudioFormat_Float)
+                output_type_index = i;
         }
-
-        if (found)
-            output_type_index = i;
-
-        output_media_type.Reset();
     }
-    /*
-     * It's not an error if we don't find the output type we were
-     * looking for, in this case we use the first available type.
-     */
-    if(output_type_index < 0)
-        /* No output format found we prefer, just pick the first one preferred
-         * by the MFT */
-        output_type_index = 0;
 
-    hr = p_sys->mft->GetOutputAvailableType(stream_id, output_type_index, &output_media_type);
+    hr = p_sys->mft->GetOutputAvailableType(stream_id, output_type_index, output_media_type.ReleaseAndGetAddressOf());
     if (FAILED(hr))
         goto error;
 
-    hr = p_sys->mft->SetOutputType(stream_id, output_media_type.Get(), 0);
+    hr = output_media_type->GetGUID(MF_MT_SUBTYPE, &subtype);
     if (FAILED(hr))
         goto error;
 
-    GUID subtype;
-    hr = output_media_type->GetGUID(MF_MT_SUBTYPE, &subtype);
+    hr = p_sys->mft->SetOutputType(stream_id, output_media_type.Get(), 0);
     if (FAILED(hr))
+    {
+        msg_Err(p_dec, "Failed to set the output. (hr=0x%lX)", hr);
         goto error;
+    }
 
     if (p_dec->fmt_in->i_cat == VIDEO_ES)
     {
@@ -550,8 +531,10 @@ static int SetOutputType(decoder_t *p_dec, DWORD stream_id)
         vlc_fourcc_t fcc = GUIDToFormat(d3d_format_table, subtype);
         if(fcc) {
             /* D3D formats are upside down */
-            p_dec->fmt_out.video.orientation = ORIENT_BOTTOM_LEFT;
+            p_dec->fmt_out.video.orientation = ORIENT_VFLIPPED;
         } else {
+            if (subtype == MFVideoFormat_IYUV)
+                subtype = MFVideoFormat_I420;
             fcc = vlc_fourcc_GetCodec(p_dec->fmt_in->i_cat, subtype.Data1);
         }
 
@@ -761,7 +744,7 @@ static int ProcessInputStream(decoder_t *p_dec, DWORD stream_id, block_t *p_bloc
     return VLC_SUCCESS;
 
 error:
-    msg_Err(p_dec, "Error in ProcessInputStream(). (hr=0x%lX)\n", hr);
+    msg_Err(p_dec, "Error in ProcessInputStream(). (hr=0x%lX)", hr);
     block_ChainRelease(p_xps_blocks);
     return VLC_EGENERIC;
 }
@@ -1336,7 +1319,7 @@ static int SetD3D11(decoder_t *p_dec, d3d11_device_t *d3d_dev)
     return VLC_SUCCESS;
 }
 
-static int InitializeMFT(decoder_t *p_dec)
+static int InitializeMFT(decoder_t *p_dec, const GUID & mSubtype)
 {
     mft_dec_sys_t *p_sys = static_cast<mft_dec_sys_t*>(p_dec->p_sys);
     HRESULT hr;
@@ -1389,7 +1372,7 @@ static int InitializeMFT(decoder_t *p_dec)
     else if (FAILED(hr))
         goto error;
 
-    if (SetInputType(p_dec, p_sys->input_stream_id, p_sys->input_type))
+    if (SetInputType(p_dec, p_sys->input_stream_id, mSubtype, p_sys->input_type))
         goto error;
 
     if (attributes.Get() && p_dec->fmt_in->i_cat == VIDEO_ES)
@@ -1430,7 +1413,7 @@ static int InitializeMFT(decoder_t *p_dec)
      * SetInputType, try again after setting the output type.
      */
     if (p_sys->input_type.Get() == nullptr)
-        if (SetInputType(p_dec, p_sys->input_stream_id, p_sys->input_type) || p_sys->input_type.Get() == nullptr)
+        if (SetInputType(p_dec, p_sys->input_stream_id, mSubtype, p_sys->input_type) || p_sys->input_type.Get() == nullptr)
             goto error;
 
     /* This event is required for asynchronous MFTs, optional otherwise. */
@@ -1511,31 +1494,30 @@ static int FindMFT(decoder_t *p_dec)
 
     /* Try to create a MFT using MFTEnumEx. */
     GUID category;
+    MFT_REGISTER_TYPE_INFO input_type;
     if (p_dec->fmt_in->i_cat == VIDEO_ES)
     {
         category = MFT_CATEGORY_VIDEO_DECODER;
-        p_sys->major_type = &MFMediaType_Video;
-        p_sys->subtype = FormatToGUID(video_format_table, p_dec->fmt_in->i_codec);
-        if(!p_sys->subtype) {
+        input_type.guidMajorType = MFMediaType_Video;
+        input_type.guidSubtype = FormatToGUID(video_format_table, p_dec->fmt_in->i_codec);
+        if(input_type.guidSubtype == GUID_NULL) {
             /* Codec is not well known. Construct a MF transform subtype from the fourcc */
-            p_sys->custom_subtype = MFVideoFormat_Base;
-            p_sys->custom_subtype.Data1 = p_dec->fmt_in->i_codec;
-            p_sys->subtype = &p_sys->custom_subtype;
+            input_type.guidSubtype = MFVideoFormat_Base;
+            input_type.guidSubtype.Data1 = p_dec->fmt_in->i_codec;
         }
     }
     else
     {
         category = MFT_CATEGORY_AUDIO_DECODER;
-        p_sys->major_type = &MFMediaType_Audio;
-        p_sys->subtype = FormatToGUID(audio_format_table, p_dec->fmt_in->i_codec);
+        input_type.guidMajorType = MFMediaType_Audio;
+        input_type.guidSubtype  = FormatToGUID(audio_format_table, p_dec->fmt_in->i_codec);
     }
-    if (!p_sys->subtype)
+    if (input_type.guidSubtype == GUID_NULL)
         return VLC_EGENERIC;
 
     UINT32 flags = MFT_ENUM_FLAG_SORTANDFILTER | MFT_ENUM_FLAG_LOCALMFT
                  | MFT_ENUM_FLAG_SYNCMFT | MFT_ENUM_FLAG_ASYNCMFT
                  | MFT_ENUM_FLAG_HARDWARE;
-    MFT_REGISTER_TYPE_INFO input_type = { *p_sys->major_type, *p_sys->subtype };
     IMFActivate **activate_objects = NULL;
     UINT32 activate_objects_count = 0;
     hr = MFTEnumEx(category, flags, &input_type, NULL, &activate_objects, &activate_objects_count);
@@ -1546,16 +1528,14 @@ static int FindMFT(decoder_t *p_dec)
     if (activate_objects_count == 0)
         return VLC_EGENERIC;
 
-    void *pv;
     for (UINT32 i = 0; i < activate_objects_count; ++i)
     {
-        hr = activate_objects[i]->ActivateObject(__uuidof(p_sys->mft.Get()), &pv);
+        hr = activate_objects[i]->ActivateObject(IID_PPV_ARGS(p_sys->mft.ReleaseAndGetAddressOf()));
         activate_objects[i]->Release();
         if (FAILED(hr))
             continue;
-        p_sys->mft = static_cast<IMFTransform *>(pv);
 
-        if (InitializeMFT(p_dec) == VLC_SUCCESS)
+        if (InitializeMFT(p_dec, input_type.guidSubtype) == VLC_SUCCESS)
         {
             for (++i; i < activate_objects_count; ++i)
                 activate_objects[i]->Release();
@@ -1625,7 +1605,7 @@ static int Open(vlc_object_t *p_this)
 
     if (FindMFT(p_dec))
     {
-        msg_Err(p_dec, "Could not find suitable MFT decoder");
+        msg_Err(p_dec, "Could not find suitable MFT decoder for %4.4s", (char*)&p_dec->fmt_in->i_codec);
         goto error;
     }
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/5f717bd82777a585aa303993c41e7ea7c79c37bd...181e91d00132d57205936d1cd6844b08756b0b4c

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/5f717bd82777a585aa303993c41e7ea7c79c37bd...181e91d00132d57205936d1cd6844b08756b0b4c
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