framedsource.h

来自「rtsp协议的主要实现代码.对开发流媒体」· C头文件 代码 · 共 45 行

H
45
字号
// FramedSource.h: interface for the FramedSource class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_FRAMEDSOURCE_H__8187FE74_331C_48A6_8F53_0CA579F1B304__INCLUDED_)
#define AFX_FRAMEDSOURCE_H__8187FE74_331C_48A6_8F53_0CA579F1B304__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "winsock.h"

class FramedSource  
{
public:
	FramedSource();
	virtual ~FramedSource();

	typedef void (afterGettingFunc)(void* clientData, unsigned frameSize,
		unsigned numTruncatedBytes,
		struct timeval presentationTime,
		unsigned durationInMicroseconds);
	void getNextFrame(unsigned char* to, unsigned maxSize,afterGettingFunc* afterGettingFunc,
		void* afterGettingClientData);
	virtual void doGetNextFrame() = 0;
	// called by getNextFrame()

	virtual unsigned char GetPayloadFormatCode() = 0;
	void afterGetting(FramedSource* source);
protected:
	// The following variables are typically accessed/set by doGetNextFrame()
	unsigned char* fTo; // in
	unsigned fMaxSize; // in
	unsigned fFrameSize; // out
	unsigned fNumTruncatedBytes; // out
	struct timeval fPresentationTime; // out
	unsigned fDurationInMicroseconds; // out

	afterGettingFunc* fAfterGettingFunc;
	void* fAfterGettingClientData;
	Boolean fIsCurrentlyAwaitingData;
};

#endif // !defined(AFX_FRAMEDSOURCE_H__8187FE74_331C_48A6_8F53_0CA579F1B304__INCLUDED_)

⌨️ 快捷键说明

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