?? globaldefs.h
字號(hào):
//
// defines.h
//
#ifndef __H_defines__
#define __H_defines__
//-----------------------------------------------------------------------------
// Miscellaneous helper functions
//-----------------------------------------------------------------------------
#define SAFE_DELETE(p) { if(p) { delete (p); (p)=NULL; } }
#define SAFE_DELETE_ARRAY(p) { if(p) { delete[] (p); (p)=NULL; } }
#define SAFE_RELEASE(p) { if(p) { (p)->Release(); (p)=NULL; } }
static const GUID CLSID_MYFILESOURCEFILTER =
{0xe436ebb5, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70};
static const GUID CLSID_MYOGGFILESOURCEFILTER =
{0x6d3688ce, 0x3e9d, 0x42f4, 0x92, 0xca, 0x8a, 0x11, 0x11, 0x9d, 0x25, 0xcd};
static const GUID CLSID_MYOGGSPLITTER =
{0x9ff48807, 0xe133, 0x40aa, 0x82, 0x6f, 0x9b, 0x29, 0x59, 0xe5, 0x23, 0x2d};
static const GUID CLSID_MYMPEGSPLITTER =
{0x336475d0, 0x942a, 0x11ce, 0xa8, 0x70, 0x00, 0xaa, 0x00, 0x2f, 0xea, 0xb5};
static const GUID CLSID_MYAVISPLITTER =
{0x1b544c20, 0xfd0b, 0x11ce, 0x8c, 0x63, 0x00, 0xaa, 0x00, 0x44, 0xb5, 0x1e};
static const GUID CLSID_MYREALSPLITTER =
{0xe21be468, 0x5c18, 0x43eb, 0xb0, 0xcc, 0xdb, 0x93, 0xa8, 0x47, 0xd7, 0x69};
static const GUID CLSID_MYINFINITEPIN=
{0xF8388A40, 0xD5BB, 0x11D0, 0xBE, 0x5A, 0x00, 0x80, 0xC7, 0x06, 0x56, 0x8E};
static const GUID CLSID_MYREALAUDIODECOM =
{0x941a4793,0xa705,0x4312,0x8d,0xfc,0xc1,0x1c,0xa0,0x5f,0x39,0x7e};
static const GUID CLSID_MYMP3DECOM =
{0x38be3000,0xdbf4,0x11d0,0x86,0x0e,0x00,0xa0,0x24,0xcf,0xef,0x6d};
// File types we support currently
const long FT_MPEG1 = 0;
const long FT_MPEG2 = 1;
const long FT_AVI = 2;
const long FT_MP3 = 3;
const long FT_REAL = 4;
const long FT_OGG = 5;
#define WM_ModifyFilterGraph (WM_USER+123)
// Message definitions
const long msg_CommandReceived = 'vod0' + 1;
const long msg_NewSocketAccepted = 'vod0' + 2;
const long msg_FilterGraphError = 'vod0' + 3;
const long msg_MediaTypeReceived = 'vod0' + 4;
const WORD SERVER_CONTROLL_PORT = 10080;
const WORD SERVER_VIDEO_PORT = 10081;
const WORD SERVER_AUDIO_PORT = 10086;
const long MAX_COMMAND_SIZE = 300;
const long PACK_SIZE = 2048;
// UDP commands
typedef enum
{
Cmd_RequestTCPDisconnect=0,
Cmd_RequestProgramList,
Cmd_ProgramList,
Cmd_RequestPlay, // Media playing control
Cmd_RequestPause,
Cmd_RequestResume,
Cmd_RequestStop,
Cmd_Error,
Cmd_SetProgress,
} Net_Command;
// struct Request_ProgramList
struct Program_List
{
char file_path[200];
long pid;
long file_type;
long file_size;
void my_hton(void)
{
pid = htonl(pid);
file_type = htonl(file_type);
file_size = htonl(file_size);
};
void my_ntoh(void)
{
pid = ntohl(pid);
file_type = ntohl(file_type);
file_size = ntohl(file_size);
};
};
// We should specify the program id when control the media playing
struct Media_Control
{
long program_id;
void my_hton(void)
{
program_id = htonl(program_id);
};
void my_ntoh(void)
{
program_id = ntohl(program_id);
};
};
struct Media_Progress
{
int program_Progress;
void my_hton(void)
{
program_Progress = htonl(program_Progress);
};
void my_ntoh(void)
{
program_Progress = ntohl(program_Progress);
};
};
struct Pack_Header
{
long pack_type;
long pack_size;
void my_hton(void)
{
pack_type = htonl(pack_type);
pack_size = htonl(pack_size);
};
void my_ntoh(void)
{
pack_type = ntohl(pack_type);
pack_size = ntohl(pack_size);
};
};
struct Pack_GUID
{
GUID majortype;
GUID subtype;
GUID formattype;
};
// TCP pack types
const long PT_AudioMediaType = 10001;
const long PT_VideoMediaType = 10002;
const long PT_Payload = 10003;
const long PT_SampleLength = 10004;
#endif // __H_defines__
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -