Nous utilisons le wrapper .NET SharpDX
pour que Mediafoundation
décode une vidéo MP4 en une texture DirectX9
. Cela fonctionne bien, sauf qu'il se bloque sur certaines cartes NVIDIA
par exemple le 940MX
. Par exemple, la même machine avec une carte graphique Intel HD décode bien le flux vidéo.Mediafoundation ne peut pas décoder la vidéo sur certaines cartes NVIDIA
Malheureusement, nous ne pouvons pas obtenir d'autres détails qu'une erreur E_FAIL/Unspecified de SharpDX
. Même avec la couche de débogage activée. Des idées pour savoir pourquoi il se bloque?
VideoMediaType outputVideoFormat;
MediaFactory.CreateVideoMediaTypeFromSubtype(mFormatYv12Guid, out outputVideoFormat);
if (outputVideoFormat == null)
{
Trace.WriteLine("Error: create output video format failed.");
return false;
}
outputVideoFormat.Set(MediaTypeAttributeKeys.Subtype, mFormatYv12Guid);
outputVideoFormat.Set(MediaTypeAttributeKeys.FrameSize, size);
sourceReader.SetCurrentMediaType(mVideoStreamIndex, outputVideoFormat);
outputVideoFormat.Dispose();
IntPtr transformPointer = sourceReader.GetServiceForStream(mVideoStreamIndex, Guid.Empty, typeof(Transform).GUID);
if (transformPointer.ToInt64() <= 0)
{
Trace.WriteLine("Error: videoDecoderPointer is null");
return false;
}
Transform videoDecoder = new Transform(transformPointer);
// crashing here with E_FAIL/Unspecified error
videoDecoder.ProcessMessage(TMessageType.SetD3DManager, deviceManager.NativePointer);
videoDecoder.Dispose();
Voici comment vous pouvez trouver: https://msdn.microsoft.com/fr-fr/library/windows/desktop/ff685370%28v=vs.85%29.aspx – Soonts