Hello,
I want to decode a MKV file, i do it with three filters:
- A Matroska Splitter Filter (Input Pin = Null, Output Pin = Video)
- Video Decoder DMO (Input Pin = in0, Output Pin = out0)
- Video Renderer (Input Pin = VMR Input0, Output Pin = null)
The video can be played when the graph is running, but when i run the code
hr = pGraph.ConnectDirect(GetPin(pAXISMatroskaSplitterFilter, "Video"), GetPin(pAXISH264VideoDecoderDMO, "in0"), null); the i get:
Where GetPin is:
static IPin GetPin(IBaseFilter filter, string pinname) {
IEnumPins epins;
int hr = filter.EnumPins(out epins);
checkHR(hr, "Can't enumerate pins");
IntPtr fetched = Marshal.AllocCoTaskMem(4);
IPin[] pins = new IPin[1];
While (epins.Next(1, pinsm fetched) == 0){
PinInfo pinfo;
pins[0].QueryPinInfo(out pinfo);
bool found = (pinfo.name == pinname);
DsUtil.FreePinInfo(pinfo);
if (found)
return pins[0];
}
checkHR(-1, "Pin not Found");
return null;
}
I think the problem is on the DMO object, i dont know why the Video Decoder DMO epins.Next(1, pinsm fetched)=1 (because it has 2 pins and ithe first time i get epins.Next(1, pinsm fetched) = 1), goes straight to checkHR(-1, "Pin not Found"); it seems that the DMO cannot be read.
Is that the problem?? How can i fix it??
The exception message is:
Building Graph...
Pin not Found
COM Error:System.Runtime.InteropServices.COMException (0xFFFFFFFF): Excepción de HRESULT: 0xFFFFFFFF
en System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
en System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
en DirectShowLib.DsError.ThrowExceptionForHR(Int32 hr)
en pruebaMKV.Form1.checkHR(Int32 hr, String msg) en C:\Proyectos\pruebaMKV\pruebaMKV\Form1.cs:línea 33
en pruebaMKV.Form1.GetPin(IBaseFilter filter, String pinname) en C:\Proyectos\pruebaMKV\pruebaMKV\Form1.cs:línea 147
en pruebaMKV.Form1.BuildGraph(IGraphBuilder pGraph, String srcFile1) en C:\Proyectos\pruebaMKV\pruebaMKV\Form1.cs:línea 66
en pruebaMKV.Form1.vMain() en C:\Proyectos\pruebaMKV\pruebaMKV\Form1.cs:línea 85
Thanks for your help!!