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

📄 tvstreamsink.h

📁 mysee网络直播源代码Mysee Lite是Mysee独立研发的网络视频流媒体播放系统。在应有了P2P技术和一系列先进流媒体技术之后
💻 H
字号:
/*
*  Openmysee
*
*  This program is free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 2 of the License, or
*  (at your option) any later version.
*
*  This program is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with this program; if not, write to the Free Software
*  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*
*/
#ifndef __TV_STREAM_SINK_H__
#define __TV_STREAM_SINK_H__

#include "tvsourceconfig.h"
#include "CaptureServer.h"

class CTVStreamSinkInputPin;

class CTVStreamSink : public CBaseFilter,
	                  public IFileSinkFilter,
					  public ITVSourceConfig
{
	friend class CTVStreamSinkInputPin;
	
private:
	CTVStreamSinkInputPin *m_pVideoPin;  // A simple rendered input pin
	CTVStreamSinkInputPin *m_pAudioPin; 

    static CCritSec m_Lock;				// Main renderer critical section

	LPWSTR   m_pFileName;
	CaptureServer cs;

	int		m_iIsStop;				//判断是否全部结束
	int		m_iState;				//0为运行,1为停止(全部文件转化完成为停止)。-1为发生意外错误停止(用户点击Stop为意外停止)

private:
    CTVStreamSink(LPUNKNOWN pUnk, CCritSec *pLock, HRESULT *pHr);
    virtual ~CTVStreamSink();

public:
	DECLARE_IUNKNOWN
	// initializator for class factory
    static CUnknown * WINAPI CreateInstance(LPUNKNOWN punk, HRESULT *pHr);

private:
    // Overriden to say what interfaces we support where
    STDMETHOD(NonDelegatingQueryInterface)(REFIID riid, void ** ppv);

public:
	// overrides from CBaseFilter
	int GetPinCount();
    CBasePin *GetPin(int n);	
	STDMETHOD(Run)(REFERENCE_TIME tStart);
    STDMETHOD(Pause)();
    STDMETHOD(Stop)();

	// Implements the IFileSinkFilter interface
    STDMETHOD(SetFileName)(LPCOLESTR pszFileName,const AM_MEDIA_TYPE *pmt);
    STDMETHOD(GetCurFile)(LPOLESTR * ppszFileName,AM_MEDIA_TYPE *pmt);

	// interface ITVSourceConfig
	STDMETHODIMP_(float) GetCompressedSpeed();
	STDMETHODIMP_(LONGLONG) GetTotalBytes();
	STDMETHODIMP_(void) SetAudioOrVideoOnly(BOOL isAudio);
	STDMETHODIMP_(void) SetParentWindow(HWND handle);
	STDMETHODIMP_(BOOL) Login(int userID, char* pass);
	STDMETHODIMP_(int) CheckPassword();
	STDMETHODIMP_(void) SetProgramStorePath(LPCTSTR path);
	STDMETHODIMP_(void) SetChannelName(LPCTSTR astrChannelName);
	STDMETHODIMP_(void) GetZZLState(int* apiState);
    STDMETHODIMP_(bool) EndOfStream();

public:
	HRESULT WriteFormatTypeHeader(CMediaType *pmt, BOOL isAudio);
private:
	//创建调试信息(日志)
	bool CreateDebugInfo();
};

#endif// __TV_STREAM_SINK_H__

⌨️ 快捷键说明

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