Infognition forum
February 11, 2012, 06:09:37 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Last GraphEditPlus version: 1.4.0   Last Video Enhancer version: 1.9.7
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: GetPin not working properly?? [SOLVED]  (Read 962 times)
cgillopez
Newbie
*

Karma: +1/-0
Posts: 7


View Profile
« on: March 10, 2010, 12:58:50 PM »

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
Code:
hr = pGraph.ConnectDirect(GetPin(pAXISMatroskaSplitterFilter, "Video"), GetPin(pAXISH264VideoDecoderDMO, "in0"), null); the i get:

Where GetPin is:
Code:
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!!
« Last Edit: March 11, 2010, 07:01:06 PM by cgillopez » Logged
cgillopez
Newbie
*

Karma: +1/-0
Posts: 7


View Profile
« Reply #1 on: March 11, 2010, 07:00:48 PM »

I was right... the problem was the DMO decoder. It needs a wrapper to work:

dmoFilter = (IBaseFilter)new DMOWrapperFilter();
dmoWrapperFilter = (IDMOWrapperFilter)dmoFilter;
hr = dmoWrapperFilter.Init(CLSID_AXISH264VideoDecoderDMO, DirectShowLib.DMO.DMOCategory.VideoDecoder);
DMOError.ThrowExceptionForHR(hr);

And the pin connection is with the wrapper, in the msdn i read:

"GraphEdit: In GraphEdit, the DMO Wrapper filter does not appear under its own name. Instead, each registered DMO is listed under the appropriate filter category. When you add a DMO through the Insert Filters dialog, GraphEdit creates the DMO Wrapper filter and configures it to use that DMO."
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!