本文整理汇总了C#中IBaseFilter.FindPin方法的典型用法代码示例。如果您正苦于以下问题:C# IBaseFilter.FindPin方法的具体用法?C# IBaseFilter.FindPin怎么用?C# IBaseFilter.FindPin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IBaseFilter
的用法示例。
在下文中一共展示了IBaseFilter.FindPin方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddedToGraph
public override void AddedToGraph(FilgraphManager fgm) {
IGraphBuilder gb = (IGraphBuilder)fgm;
//Add the Blackmagic Decoder filter and connect it.
try {
bfDecoder = Filter.CreateBaseFilterByName("Blackmagic Design Decoder (DMO)");
gb.AddFilter(bfDecoder, "Blackmagic Design Decoder (DMO)");
IPin decoderInput;
bfDecoder.FindPin("in0", out decoderInput);
bfDecoder.FindPin("out0", out decoderOutput);
captureOutput = GetPin(filter, _PinDirection.PINDIR_OUTPUT, Pin.PIN_CATEGORY_CAPTURE, Guid.Empty, false, 0);
gb.Connect(captureOutput, decoderInput);
}
catch {
throw new ApplicationException("Failed to add the BlackMagic Decoder filter to the graph");
}
base.AddedToGraph(fgm);
}
示例2: AddDVSplitter
/// <summary>
/// Add a DV Splitter filter and connect it to the DV source. If the DV Splitter is already there, do nothing.
/// </summary>
/// <returns></returns>
private bool AddDVSplitter()
{
if ((dvSplitter != null) &&
(splitterAudioOut != null) &&
(splitterVideoOut != null))
return true;
//Add a DVSplitter and connect it.
try {
dvSplitter = Filter.CreateBaseFilterByName("DV Splitter");
iGB.AddFilter(dvSplitter, "DV Splitter");
IPin dvSplitterInput;
dvSplitter.FindPin("Input", out dvSplitterInput);
iGB.Connect(source.OutputPin, dvSplitterInput);
}
catch (COMException) {
dvSplitter = null;
splitterVideoOut = splitterAudioOut = null;
return false;
}
//Find output pins
try {
this.splitterVideoOut = Filter.GetPin(dvSplitter, _PinDirection.PINDIR_OUTPUT, Guid.Empty, Guid.Empty, true, 0);
this.splitterAudioOut = Filter.GetPin(dvSplitter, _PinDirection.PINDIR_OUTPUT, Guid.Empty, Guid.Empty, true, 1);
}
catch (COMException) {
dvSplitter = null;
splitterVideoOut = splitterAudioOut = null;
return false;
}
return true;
}
示例3: ConnectPins
void ConnectPins(IBaseFilter upFilter, string upName, IBaseFilter downFilter, string downName)
{
int hr;
IPin pin1, pin2;
PinDirection PinDirThis;
if (upName == "CapturePin")
{
pin1 = captureDevOutPin;
}
else
{
hr = upFilter.FindPin(upName, out pin1);
if (hr < 0)
Marshal.ThrowExceptionForHR(hr);
hr = pin1.QueryDirection(out PinDirThis);
if (hr < 0)
Marshal.ThrowExceptionForHR(hr);
if (PinDirThis != PinDirection.Output)
throw new Exception("Wrong upstream pin");
}
//pin1 = GetPin(upFilter, PinDirection.Output);
hr = downFilter.FindPin(downName, out pin2);
if (hr < 0)
Marshal.ThrowExceptionForHR(hr);
hr = pin2.QueryDirection(out PinDirThis);
if (hr < 0)
Marshal.ThrowExceptionForHR(hr);
if (PinDirThis != PinDirection.Input)
throw new Exception("Wrong downstream pin");
//pin2 = GetPin(downFilter, PinDirection.Input);
hr = graphBuilder.Connect(pin1, pin2);
if (hr < 0)
Marshal.ThrowExceptionForHR(hr);
}
示例4: PreviewInit
void PreviewInit()
{
m_dvdNav = (IBaseFilter)new DVDNavigator();
m_dvdCtrl = m_dvdNav as IDvdControl2;
int hr = m_dvdCtrl.SetDVDDirectory(Disk.VIDEO_TS);
DsError.ThrowExceptionForHR(hr);
m_dvdInfo = m_dvdCtrl as IDvdInfo2;
m_filterGraph = (IGraphBuilder)new FilterGraph();
hr = m_filterGraph.AddFilter(m_dvdNav, "DVD Navigator");
DsError.ThrowExceptionForHR(hr);
m_renderer = (IBaseFilter)new VideoMixingRenderer9();
IVMRFilterConfig9 filterConfig = (IVMRFilterConfig9)m_renderer;
hr = filterConfig.SetRenderingMode(VMR9Mode.Renderless);
DsError.ThrowExceptionForHR(hr);
hr = filterConfig.SetNumberOfStreams(1);
DsError.ThrowExceptionForHR(hr);
hr = m_filterGraph.AddFilter(m_renderer, "Video Mix 9");
DsError.ThrowExceptionForHR(hr);
IPin videoPin;
hr = m_dvdNav.FindPin("Video", out videoPin);
DsError.ThrowExceptionForHR(hr);
IPin audioPin;
hr = m_dvdNav.FindPin("AC3", out audioPin);
DsError.ThrowExceptionForHR(hr);
//hr = m_filterGraph.Render(videoPin);
//DsError.ThrowExceptionForHR(hr);
//hr = m_filterGraph.Render(audioPin);
//DsError.ThrowExceptionForHR(hr);
//IMediaControl mediaCtrl = (IMediaControl)m_filterGraph;
//hr = mediaCtrl.Run();
//DsError.ThrowExceptionForHR(hr);
//hr = m_dvdCtrl.SetOption(DvdOptionFlag.EnableNonblockingAPIs, true);
//DsError.ThrowExceptionForHR(hr);
//m_dvdCtrl.SetOption(DvdOptionFlag.ResetOnStop, true);
}
示例5: Connect
/// <summary>Connects together to graph filters.</summary>
/// <param name="graph">The graph on which the filters exist.</param>
/// <param name="source">The source filter.</param>
/// <param name="outPinName">The name of the output pin on the source filter.</param>
/// <param name="destination">The destination filter.</param>
/// <param name="inPinName">The name of the input pin on the destination filter.</param>
protected void Connect(IGraphBuilder graph, IBaseFilter source, string outPinName,
IBaseFilter destination, string inPinName)
{
IPin outPin = source.FindPin(outPinName);
DisposalCleanup.Add(outPin);
IPin inPin = destination.FindPin(inPinName);
DisposalCleanup.Add(inPin);
graph.Connect(outPin, inPin);
}