当前位置: 首页>>代码示例>>C#>>正文


C# IMediaSeeking.GetCapabilities方法代码示例

本文整理汇总了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);
 }
开发者ID:sgraf812,项目名称:crystalmpq,代码行数:14,代码来源:MediaPlayer.cs

示例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;
        }
开发者ID:spokanedj,项目名称:remotepotato,代码行数:15,代码来源:DSFileWriter.cs

示例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;
 }
开发者ID:rickbassham,项目名称:videobrowser,代码行数:11,代码来源:Converter.cs


注:本文中的IMediaSeeking.GetCapabilities方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。