IMediaSeeking
这是一个很重要的接口,它能支持实现大多数的VCR操作。
主要实现的功能:
1) 定位到数据流中的一个绝对位置
2) 返回数据流的持续时间
3) 返回数据流中的当前播放位置
4) 回放。
2) 返回数据流的持续时间
3) 返回数据流中的当前播放位置
4) 回放。
Seeking能力描述:
typedef enum AM_SEEKING_SeekingCapabilities {
AM_SEEKING_CanSeekAbsolute = 0x1,
AM_SEEKING_CanSeekForwards = 0x2,
AM_SEEKING_CanSeekBackwards = 0x4,
AM_SEEKING_CanGetCurrentPos = 0x8,
AM_SEEKING_CanGetStopPos = 0x10,
AM_SEEKING_CanGetDuration = 0x20,
AM_SEEKING_CanPlayBackwards = 0x40,
AM_SEEKING_CanDoSegments = 0x80,
AM_SEEKING_Source = 0x100
} AM_SEEKING_SEEKING_CAPABILITIES;
AM_SEEKING_CanSeekAbsolute = 0x1,
AM_SEEKING_CanSeekForwards = 0x2,
AM_SEEKING_CanSeekBackwards = 0x4,
AM_SEEKING_CanGetCurrentPos = 0x8,
AM_SEEKING_CanGetStopPos = 0x10,
AM_SEEKING_CanGetDuration = 0x20,
AM_SEEKING_CanPlayBackwards = 0x40,
AM_SEEKING_CanDoSegments = 0x80,
AM_SEEKING_Source = 0x100
} AM_SEEKING_SEEKING_CAPABILITIES;
判断能力:
DWORD dwCap = 0;
HRESULT hr = pSeek->GetCapabilities(&dwCap);
if (AM_SEEKING_CanSeekAbsolute & dwCap)
{
// Graph can seek to absolute positions.
}
HRESULT hr = pSeek->GetCapabilities(&dwCap);
if (AM_SEEKING_CanSeekAbsolute & dwCap)
{
// Graph can seek to absolute positions.
}
当前位置和停止位置
设置回放速率
设置时间格式