探索源过滤器的搜索功能与DirectX媒体对象
1. 源过滤器的搜索功能
1.1 CPushPin类概述
CPushPin继承自CSourceStream和CSourceSeeking。CSourceSeeking使得源过滤器的输出引脚能够处理和响应搜索命令。对于PushSource过滤器而言,搜索命令会使帧计数倒回或快进到新的值。由于该过滤器支持按帧搜索,即可以定位到合法范围内的任意帧,因此需要实现一些其他方法。以下是实现搜索功能的基本方法代码:
void CPushPin::UpdateFromSeek()
{
if (ThreadExists()) // Filter is active?
{
DeliverBeginFlush();
// Shut down the thread and stop pushing data.
Stop();
DeliverEndFlush();
// Restart the thread and start pushing data again.
Pause();
// We'll set the discontinuity flag on the next sample.
}
}
HRESULT CPushPin::OnThreadStartPlay()
{
m_bDiscontinuity = TRUE; // Set the discontinuity flag on the next sample
// Send a N
超级会员免费看
订阅专栏 解锁全文
79

被折叠的 条评论
为什么被折叠?



