#pragma once

#define		MEDIA_STATUS_EMPTY					0
#define		MEDIA_STATUS_PAUSE					1
#define		MEDIA_STATUS_PLAY					2
#define		MEDIA_STATUS_STOP					3

#define		MEDIA_NEXT_STATUS_EMPTY				0
#define		MEDIA_NEXT_STATUS_OPENED			1

#define		AUDIO_VOLUMN_LEFT					1
#define		AUDIO_VOLUMN_RIGHT					2

#define		INVALIDMEDIA		0	
#define		MPEG1VCD			1
#define		MPEG1SYSTEM			2
#define		MPEG1VIDEO			3
#define		MPEG2PROGRAM		11
#define		REALMEDIA			21
#define		WINDOWSMEDIAVIDEO	31
#define		MPEG4VIDEO			41
#define		ASFVIDEO			51
#define		AVIVIDEO			61

#define		NORMALPCM			1
#define		DOLBYAC3			100
#define		DVDLPCM				101
#define		MPEG1AUDIO			111
#define		MPEG1AUDIOPAYLOAD	112
#define		MPEG1LAYER3			113
#define		MPEG2AUDIO			121
#define		REALMEDIAAUDIO		131

#define		HD_VIDEO_WIDTH		1920
#define		HD_VIDEO_HEIGHT		1080

#define		VIDEO_OVERLAY_MEDIA_OVER_CAPTURE			01
#define		VIDEO_OVERLAY_CAPTURE_OVER_MEDIA			02
#define		VIDEO_OVERLAY_MATTING_PROCESS				03

#define		AUDIO_PLAYBACK_AUTO_MODE					01
#define		AUDIO_PLAYBACK_MANUAL_MODE					02

#define		AUDIO_PLAYBACK_CAPTURE_SOURCE				01
#define		AUDIO_PLAYBACK_MEDIA_SOURCE					02
//EFFECT DEFINE			
#define		CAPTURE_TRANSFORM_TO_CAPTURE_MODE			01 //same cap channel
#define		CAPTURE_TRANSFORM_TO_PLAYBACK_MODE			02 //cap playback

//ENCODER
#define		RECORDER_FILE_TYPE_MPEG				1						
#define		RECORDER_FILE_TYPE_AVI				2
#define		FMT_YUV420							0
#define		FMT_YUV422							1
#define		VIDEO_ASPECT_RATIO_4_3				1
#define		VIDEO_ASPECT_RATIO_16_9				2

#define		VIDEO_MATTING_NORMAL_MODE			0
#define		VIDEO_MATTING_FOREGROUND_MODE		1
#define		VIDEO_MATTING_BACKGROUND_MODE		2
#define		VIDEO_MATTING_SYMMETRY_MODE			3

#define		VIDEO_MATTING_BLUE_BACKGROUND		0
#define		VIDEO_MATTING_GREEN_BACKGROUND		1

#define		TRANSFORM_EFFECT_NO							00
#define		TRANSFORM_EFFECT_FADE_IN_OUT				10

//TS DEF
#define		TS_DATA_RAW			0//采集的数据，不做任何处理
#define		TS_DATA_FILTER			1//采集的数据经过过滤，选择特定节目流

#define		TS_MAX_SERVICE_NUMBER				60	
#define		TS_MAX_SERVICE_NAME_LEN				32

#define		TS_SEARCH_PROGRAM_NULL				0
#define		TS_SEARCH_PROGRAM_ING				1
#define		TS_SEARCH_PROGRAM_OK				2
#define		TS_SEARCH_PROGRAM_ERROR				255

#define		TS_STREAM_TYPE_MEPG2				0
#define		TS_STREAM_TYPE_H264					10


struct MEDIA_TIME_CODE
{
	UINT uiHour;
	UINT uiMinute;
	UINT uiSecond;
	UINT uiFrame;
};

struct MEDIA_FILE_INFORMATION
{
	ULONG ulTimeDuration;

	UINT uiVideoWidth;
	UINT uiVideoHeight;
	FLOAT fVideoFrameRate;
	FLOAT fVideoAvgTimePerFrame;
	UINT uiAudioType;
	UINT uiVideoType;
	UINT uiDvdAudioNumber;
	UINT uiDvdSubPictureNumber;
	UINT uiDemultiNumber;
};

struct MOSAIC_RECTANGLE
{
	//整块范围
	UINT uiStartX;
	UINT uiStartY;
	UINT uiWidth;
	UINT uiHeight;
	//子块的大小，0-255
	UINT uiParticleSize;
};
typedef struct RECORDER_ENCODER_PARAM
{
	UINT uiFileType;
	UINT uiBitRate;//1 ~ 15000
	UINT uiPixelFormat;
	UINT uiVideoAspect;
}RECORDER_ENCODER_PARAM;

//TS
typedef struct  
{

	short pid;
	unsigned char es_num;
	struct  
	{
		unsigned char stream_type;
		unsigned short elementary_pid;
		unsigned char reserved;
	} es_info[30];

	INT nServiceId;
	UCHAR  aServiceName[TS_MAX_SERVICE_NAME_LEN];
}TS_SERVICE_INFO;
typedef struct  
{
	INT nMaxServiceInfoNum;//valid serviceinfo num
	TS_SERVICE_INFO  aServiceInfo[TS_MAX_SERVICE_NUMBER];
}TS_SERVICE_DESCRIBE_TABLE;
typedef struct  
{
	TS_SERVICE_DESCRIBE_TABLE sdtServiceTable;	
	DOUBLE dbMinRate;
	DOUBLE dbMaxRate;
	DOUBLE dbCurRate;
}TS_PROGRAM_INFO;

//用户选择的ts节目列表
typedef struct  
{
	INT nProgramId;//
	LPCTSTR szRecorderFileName;
}RECORDER_PROGRAM_INFO;
typedef struct  
{
	INT nProgramNum;//总共的节目数量。
	RECORDER_PROGRAM_INFO aProgramList[TS_MAX_SERVICE_NUMBER];
}RECORDER_PROGRAM_LIST;
typedef struct
{
	UINT uiStreamType;
	UINT uiMuxarRte;//kbps					//总码率
	LPCTSTR strProviderName;			//提供商名称
	LPCTSTR strServiceName;			//服务名称
}TS_ENCODER_PARAM;

//VIDEO MATTING
typedef struct VIDEO_MATTING_PARAM
{
	INT maxk;
	INT mink;
	INT x1;
	INT x2;
	INT y1;
	INT y2;
	INT mattingMode;//state
	INT backgroudColor;
	INT keyValueAdjustment;
	
	//扣像后微调值
	INT rAdjust;
	INT gAdjust;
	INT bAdjust;
	
	int edgewith;
	int edgequality;
	int edgecolore;
	//噪声调整
	INT noiseAdjust;

	//特效处理
	LPCTSTR tgafilename1;//与字幕tga文件合成，保存特效
	LPCTSTR tgafilename2;//备用
	INT tem1;//备用
	INT tem2;//备用
	INT tem3;//备用
	INT tem4;//备用
}VIDEO_MATTING_PARAM;
