有时希望在某个时候丢掉一部分包,如(音频、视频),我写了一个filter,专门是用来丢包的,声明见下面的文件。
但是在使用过程中,视频还在关闭流再打开流时,还是会有一个关闭前的画面,然后闪到开启后的画面,不知大家有没有更好的解决方法
filter我会传在我的资源里面。
#pragma once
/*#undef INITGUID*/
//stdarg.h, stdlib.h, wtypes.h.
#ifdef __cplusplus
extern "C" {
#endif
// The CLSID used by the minimal, in-place, null filter
// DO NOT REUSE IT. Run uuidgen.exe to create a new one.
// {08af6540-4f21-11cf-aacb-0020af0b99a3}
DEFINE_GUID(CLSID_StreamX,
0x6aaceafd, 0x6371, 0x4e65, 0x85, 0x11, 0x9e, 0xae, 0x83, 0xac, 0xf2, 0x94);
// {F13325C7-1605-4f7f-8F78-AD30DD6344B3}
DEFINE_GUID(CLSID_StreamXProp,
0xf13325c7, 0x1605, 0x4f7f, 0x8f, 0x78, 0xad, 0x30, 0xdd, 0x63, 0x44, 0xb3);
// {51EDC64F-01A2-4383-89E8-A51057878A0D}
DEFINE_GUID(IID_IPassThrough,
0x51edc64f, 0x1a2, 0x4383, 0x89, 0xe8, 0xa5, 0x10, 0x57, 0x87, 0x8a, 0xd);
//DT is a macro to help debug app by dump useful info,
//it works for debug and release version.
//usage:
//DT(_T("work ok in line %d"),m_nLine);
//define following line to enable DT
DECLARE_INTERFACE_(IPassThrough, IUnknown)
{
STDMETHOD(put_Pass) (THIS_
bool bPass /* [in] */ // the media type selected
) PURE;
STDMETHOD(get_Pass) (THIS_
bool *bPass /* [in] */ // the media type selected
) PURE;
};
#ifdef __cplusplus
}
#endif