⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 amr_filter.h

📁 MONOGRAM AMR Encoder v1.0.0.0
💻 H
字号:
//-----------------------------------------------------------------------------
//
//	Monogram AMR Encoder
//
//	Base on the 3GPP source codes for AMR
//
//	Author : Igor Janos
//
//-----------------------------------------------------------------------------
#pragma once


//-----------------------------------------------------------------------------
//
//	CAMREncoder
//
//-----------------------------------------------------------------------------

class CAMREncoder : 
	public CTransformFilter,
	public ISpecifyPropertyPages,
	public IMonogramAMREncoder
{
protected:

	CCritSec		lock_info;
	AMR_INFO		info;
	Resample		resample;
	void			*encoder;
	int				dtx;
	int				mode;

	// temporary buffer
	REFERENCE_TIME	rtStart;
	bool			has_start;
	int16			*resampled_samples;
	int				resampled_count;

public:

	// constructor & destructor
	CAMREncoder(LPUNKNOWN pUnk, HRESULT *phr);
	virtual ~CAMREncoder();
	static CUnknown *WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *phr);

	DECLARE_IUNKNOWN;
	STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);

    // ISpecifyPropertyPages interface
    STDMETHODIMP GetPages(CAUUID *pPages);

	// Pure virtual methods
	virtual HRESULT CheckInputType(const CMediaType *mtIn);
	virtual HRESULT CheckTransform(const CMediaType *mtIn, const CMediaType *mtOut);
	virtual HRESULT DecideBufferSize(IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *pProp);
	virtual HRESULT GetMediaType(int iPosition, CMediaType *pmt);
	virtual HRESULT SetMediaType(PIN_DIRECTION direction, const CMediaType *pmt);
	virtual HRESULT BreakConnect(PIN_DIRECTION dir);

	// iny proces transformovania samplov
	virtual HRESULT Receive(IMediaSample *pSample);
	virtual HRESULT GetDeliveryBuffer(IMediaSample **sample);
	HRESULT Encode(int16 *samples, int count);

	// filter states
    virtual HRESULT StartStreaming();
	virtual HRESULT EndFlush();

	// IMonogramAMREncoder
	STDMETHODIMP GetInfo(AMR_INFO *info);
	STDMETHODIMP GetMode(int *mode);
	STDMETHODIMP SetMode(int mode);

	// open/close encoder
	int OpenEncoder();
	int CloseEncoder();
};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -