Oribi

Netherlands
17 Posts |
Posted - Jan 29 2014 : 06:21:29
|
The "Video Processing Project" (http://sourceforge.net/projects/videoprocessing/) contains a Rotate Filter which can be used to rotate images.
When I test this filter using GraphEdt everything works great, however when I add to the filter to the graph created by ImageEn the image appears to be corrupted (it is rotated though).
I currently use the following code to test this:
ImageEn.IO.DShowParams.SetVideoInput(0, 0, w, h, f); ImageEn.IO.DShowParams.EnableSampleGrabber := true; ImageEn.IO.DShowParams.Connect; ImageEn.IO.DShowParams.SaveGraph('y:\graph1.grf');
// Get the Source Output Pin and the input Pin it is connected to SourceFilter := ImageEn.IO.DShowParams.CurVideoInput; SrcPinOut := GetPin(SourceFilter, IEPINDIR_OUTPUT); SrcPinOut.ConnectedTo(DstPinIn);
// Break the existing link SrcPinOut.Disconnect; DstPinIn.Disconnect;
// Add the rotate filter RotateFilter := CreateComObject(CLSID_RotateFilter) as IIEBaseFilter; ImageEn.IO.DShowParams.Graph.AddFilter(RotateFilter, 'RotateFilter');
// Get the in- and outputpin of the rotate filter RotateFilterIn := GetPin(RotateFilter, IEPINDIR_INPUT); RotateFilterOut := GetPin(RotateFilter, IEPINDIR_OUTPUT);
// Place the Rotate Filter between the source // and the original linked filter ImageEn.IO.DShowParams.Graph.Connect(SrcPinOut, RotateFilterIn); ImageEn.IO.DShowParams.Graph.Connect(RotateFilterOut, DstPinIn);
// Rotate 180 degrees if RotateFilter.QueryInterface(ISettingsInterface, FilterSettings) = S_OK then FilterSettings.SetParameter('rotationmode', '2');
// Save the new graph (for inspection using GraphEdt) ImageEn.IO.DShowParams.SaveGraph('y:\graph2.grf'); ImageEn.IO.DShowParams.Run;
Does anyone know what I'm doing wrong?

 |
 |
|