《DirectShow实务精选》把您的FilterQQSource例子改写了一下,在Render出错了???
估计是CheckMediaType(), GetMediaType()除了问题, 因为是推模式的源Filter,所以不能去Render MPEG1的文件,所以我改成了AVi,但是还是不行,麻烦给指导指导!!!
谢谢啦。。。
代码如下
//
#include <atlbase.h>//CComptr模板定义
#include <streams.h>//DS接口,基类接口
#include <qedit.h>
#include <wmsdk.h>
#include <dshowasf.h>
//////////////////////////////////////////////////////////////////////////
#include <streams.h>
//
#include <streams.h> // quartz, includes windows
#include "stdio.h"
#pragma warning(disable: 4511 4512)
#include <measure.h> // performance measurement (MSR_)
#include <initguid.h>
#if (1100 > _MSC_VER)
#include <olectlid.h>
#else
#include <olectl.h>
#endif
//
//////////////////////////////////////////////////////////////////////////
DEFINE_GUID(CLSID_QQSourceXX,
0x1f201828, 0x4385, 0x4178, 0xa0, 0xf0, 0x8c, 0x45, 0x81, 0x62, 0x2, 0x87);
// {76C90120-D6E9-4cdd-8163-466B950BB133}
DEFINE_GUID(CLSID_QQSourcePropXX,
0xb4daedaa, 0x8182, 0x488d, 0xbb, 0x4e, 0x32, 0xf9, 0xa5, 0x88, 0x49, 0xee);
// {8C2172BD-442A-467b-8DF5-E02454A0AEC1}
DEFINE_GUID(IID_IQQSourcexx,
0x134d4289, 0xb361, 0x43d0, 0xaa, 0x2c, 0xd4, 0x45, 0xf, 0xab, 0xab, 0xbc);
//
class CQQOutPin;
class CFilterQQSource : public CSource
, public IFileSourceFilter
{
private:
CFilterQQSource(LPUNKNOWN lpunk, HRESULT *phr);
~CFilterQQSource();
public:
// The only allowed way to create Bouncing balls!
static CUnknown * WINAPI CreateInstance(LPUNKNOWN lpunk, HRESULT *phr);
DECLARE_IUNKNOWN;
// Basic COM - used here to reveal our own interfaces
STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void ** ppv);
// you need to supply these to access the pins from the enumerator
// and for default Stop and Pause/Run activation.
virtual int GetPinCount();
virtual CBasePin *GetPin(int n);
STDMETHODIMP FindPin(LPCWSTR Id, IPin ** ppPin);
// --- ISpecifyPropertyPages methods ---
STDMETHODIMP GetPages(CAUUID *pPages);
估计是CheckMediaType(), GetMediaType()除了问题, 因为是推模式的源Filter,所以不能去Render MPEG1的文件,所以我改成了AVi,但是还是不行,麻烦给指导指导!!!
谢谢啦。。。
代码如下
//
#include <atlbase.h>//CComptr模板定义
#include <streams.h>//DS接口,基类接口
#include <qedit.h>
#include <wmsdk.h>
#include <dshowasf.h>
//////////////////////////////////////////////////////////////////////////
#include <streams.h>
//
#include <streams.h> // quartz, includes windows
#include "stdio.h"
#pragma warning(disable: 4511 4512)
#include <measure.h> // performance measurement (MSR_)
#include <initguid.h>
#if (1100 > _MSC_VER)
#include <olectlid.h>
#else
#include <olectl.h>
#endif
//
//////////////////////////////////////////////////////////////////////////
DEFINE_GUID(CLSID_QQSourceXX,
0x1f201828, 0x4385, 0x4178, 0xa0, 0xf0, 0x8c, 0x45, 0x81, 0x62, 0x2, 0x87);
// {76C90120-D6E9-4cdd-8163-466B950BB133}
DEFINE_GUID(CLSID_QQSourcePropXX,
0xb4daedaa, 0x8182, 0x488d, 0xbb, 0x4e, 0x32, 0xf9, 0xa5, 0x88, 0x49, 0xee);
// {8C2172BD-442A-467b-8DF5-E02454A0AEC1}
DEFINE_GUID(IID_IQQSourcexx,
0x134d4289, 0xb361, 0x43d0, 0xaa, 0x2c, 0xd4, 0x45, 0xf, 0xab, 0xab, 0xbc);
//
class CQQOutPin;
class CFilterQQSource : public CSource
, public IFileSourceFilter
{
private:
CFilterQQSource(LPUNKNOWN lpunk, HRESULT *phr);
~CFilterQQSource();
public:
// The only allowed way to create Bouncing balls!
static CUnknown * WINAPI CreateInstance(LPUNKNOWN lpunk, HRESULT *phr);
DECLARE_IUNKNOWN;
// Basic COM - used here to reveal our own interfaces
STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void ** ppv);
// you need to supply these to access the pins from the enumerator
// and for default Stop and Pause/Run activation.
virtual int GetPinCount();
virtual CBasePin *GetPin(int n);
STDMETHODIMP FindPin(LPCWSTR Id, IPin ** ppPin);
// --- ISpecifyPropertyPages methods ---
STDMETHODIMP GetPages(CAUUID *pPages);