本文整理汇总了C#中IMediaSeeking.GetCapabilities方法的典型用法代码示例。如果您正苦于以下问题:C# IMediaSeeking.GetCapabilities方法的具体用法?C# IMediaSeeking.GetCapabilities怎么用?C# IMediaSeeking.GetCapabilities使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMediaSeeking
的用法示例。
在下文中一共展示了IMediaSeeking.GetCapabilities方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateGraph
private void CreateGraph()
{
graphBuilder = (IGraphBuilder)new FilterGraph();
graphBuilder.RenderFile(tempFileName, null);
mediaControl = (IMediaControl)graphBuilder;
mediaSeeking = (IMediaSeeking)graphBuilder;
mediaEvent = (IMediaEventEx)graphBuilder;
//var filter = new MpqFileSourceFilter(File);
//DsError.ThrowExceptionForHR(graphBuilder.AddFilter(filter, filter.Name));
//DsError.ThrowExceptionForHR(graphBuilder.Render(filter.OutputPin));
mediaSeeking.GetCapabilities(out seekingCapabilities);
mediaSeeking.SetTimeFormat(TimeFormat.MediaTime);
mediaEvent.SetNotifyWindow(Handle, WM_GRAPHNOTIFY, IntPtr.Zero);
}
示例2: CanGetPositionAndDuration
/// <summary>Determines whether the specified IMediaSeeking can be used to retrieve duration and current position.</summary>
/// <param name="seeking">The interface to check.</param>
/// <returns>true if it can be used to retrieve duration and current position; false, otherwise.</returns>
private static bool CanGetPositionAndDuration(IMediaSeeking seeking)
{
if (seeking == null) return false;
AMSeekingSeekingCapabilities caps;
int hr = 0;
hr = seeking.GetCapabilities(out caps);
DsError.ThrowExceptionForHR(hr);
if ((caps & AMSeekingSeekingCapabilities.CanGetDuration) != AMSeekingSeekingCapabilities.CanGetDuration) return false;
if ((caps & AMSeekingSeekingCapabilities.CanGetCurrentPos) != AMSeekingSeekingCapabilities.CanGetCurrentPos) return false;
return true;
}
示例3: CanGetPositionAndDuration
/// <summary>Determines whether the specified IMediaSeeking can be used to retrieve duration and current position.</summary>
/// <param name="seeking">The interface to check.</param>
/// <returns>true if it can be used to retrieve duration and current position; false, otherwise.</returns>
private static bool CanGetPositionAndDuration(IMediaSeeking seeking)
{
if (seeking == null) return false;
SeekingCapabilities caps = seeking.GetCapabilities();
if ((caps & SeekingCapabilities.CanGetDuration) != SeekingCapabilities.CanGetDuration) return false;
if ((caps & SeekingCapabilities.CanGetCurrentPos) != SeekingCapabilities.CanGetCurrentPos) return false;
return true;
}