主管叫我看tcpmp播放器,下面几行代码1月没看懂,求求你了,
2017-01-02 23:47
260 查看
主管叫我看tcpmp播放器,找出解码代码的接口!!
该如何去找关于音视频解码部分接口呢?
它是由14个项目组成的,其中主工程是一个叫player的,里面代码如下:
#include "../common/common.h"
static const tchar_t ProgramName[] = T("TCPMP");
static const tchar_t ProgramVersion[] =
#include "../version"
;
#ifndef STRICT
#define STRICT
#endif
#include <windows.h>
#if defined(TARGET_WINCE)
#define TWIN(a) L ## a
extern int ProgramId;
#else
#define TWIN(a) a
static int ProgramId = 0;
#endif
// don't want to use common.dll, but don't want to collide with DLL import function either
#define tcscpy_s _tcscpy_s
#if !defined(NO_PLUGINS) || defined(NDEBUG)
static void tcscpy_s(tchar_t* Out,int OutLen,const tchar_t* In)
{
if (OutLen>0)
{
int n = min((int)tcslen(In),OutLen-1);
memcpy(Out,In,n*sizeof(tchar_t));
Out
= 0;
}
}
#endif
#ifdef NDEBUG
static BOOL CALLBACK EnumWindowsProc(HWND Wnd,LPARAM Param)
{
HWND* p = (HWND*)Param;
if (GetWindow(Wnd,GW_OWNER) == *p)
{
*p = Wnd;
return 0;
}
return 1;
}
static bool_t FindRunning(const tchar_t* CmdLine)
{
HWND Wnd;
tchar_t ClassName[32];
int n = tcslen(ProgramName);
tcscpy_s(ClassName,TSIZEOF(ClassName),ProgramName);
tcscpy_s(ClassName+n,TSIZEOF(ClassName)-n,T("_Win"));
Wnd = FindWindow(ClassName, NULL);
if (Wnd)
{
HWND WndMain = Wnd;
while (!IsWindowEnabled(Wnd))
{
HWND Last = Wnd;
EnumWindows(EnumWindowsProc,(LPARAM)&Wnd);
if (Wnd == Last)
break;
}
SetForegroundWindow(Wnd);
if (CmdLine && CmdLine[0])
{
COPYDATASTRUCT Data;
Data.dwData = 0;
Data.cbData = (tcslen(CmdLine)+1)*sizeof(tchar_t);
Data.lpData = (PVOID)CmdLine;
SendMessage(WndMain,WM_COPYDATA,(WPARAM)WndMain,(LPARAM)&Data);
}
return 1;
}
return 0;
}
#endif
#ifdef NO_PLUGINS
extern void Main(const tchar_t* Name,const tchar_t* Version,int Id,const tchar_t* CmdLine);
#else
static HANDLE Load(const tchar_t* Name)
{
HANDLE Module;
tchar_t Path[MAXPATH];
tchar_t *s;
GetModuleFileName(NULL,Path,MAXPATH);
s = tcsrchr(Path,'\\');
if (s) s[1]=0;
tcscpy_s(Path+tcslen(Path),TSIZEOF(Path)-tcslen(Path),Name);
Module = LoadLibrary(Path);
if (!Module)
Module = LoadLibrary(Name);
return Module;
}
#endif
#if !defined(TARGET_WINCE) && defined(UNICODE)
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hParent,LPSTR CmdA,int CmdShow)
{
WCHAR Cmd[2048];
mbstowcs(Cmd,CmdA,sizeof(Cmd)/sizeof(WCHAR)); //!!!
#else
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hParent,TCHAR* Cmd,int CmdShow)
{
#endif
#ifndef NDEBUG
// DLLTest(); // just to help debugging plugins. comment out if not needed
Context();
#endif
#if defined(TARGET_WINCE) && defined(ARM)
if (ProgramId == 2)
{
OSVERSIONINFO Ver;
Ver.dwOSVersionInfoSize = sizeof(Ver);
GetVersionEx(&Ver);
if (Ver.dwMajorVersion*100 + Ver.dwMinorVersion >= 421)
{
// old shell menu not supported after WM2003SE
MessageBox(NULL,T("This ARM_CE2 version of the player is not compatible with this device. Please install ARM_CE3 version."),NULL,MB_OK|MB_ICONERROR);
return 1;
}
}
#endif
#ifdef NDEBUG
if (!FindRunning(Cmd))
{
HANDLE Handle = CreateMutex(NULL,FALSE,ProgramName);
if (GetLastError() != ERROR_ALREADY_EXISTS)
#endif
{
#ifndef NO_PLUGINS
HMODULE Module;
SetCursor(LoadCursor(NULL, IDC_WAIT));
Module = Load(T("interface.plg"));
if (Module)
{
void (*Main)(const tchar_t* Name,const tchar_t* Version,int Id,const tchar_t* CmdLine);
*(FARPROC*)&Main = GetProcAddress(Module,TWIN("Main"));
if (!Main)
*(FARPROC*)&Main = GetProcAddress(Module,TWIN("_Main@16"));
if (Main)
Main(ProgramName,ProgramVersion,ProgramId,Cmd);
FreeLibrary(Module);
}
#else
Main(ProgramName,ProgramVersion,ProgramId,Cmd);
#endif
#ifdef NDEBUG
CloseHandle(Handle);
#endif
SetCursor(LoadCursor(NULL, IDC_ARROW));
}
#ifdef NDEBUG
}
#endif
return 0;
}
该如何去找关于音视频解码部分接口呢?
它是由14个项目组成的,其中主工程是一个叫player的,里面代码如下:
#include "../common/common.h"
static const tchar_t ProgramName[] = T("TCPMP");
static const tchar_t ProgramVersion[] =
#include "../version"
;
#ifndef STRICT
#define STRICT
#endif
#include <windows.h>
#if defined(TARGET_WINCE)
#define TWIN(a) L ## a
extern int ProgramId;
#else
#define TWIN(a) a
static int ProgramId = 0;
#endif
// don't want to use common.dll, but don't want to collide with DLL import function either
#define tcscpy_s _tcscpy_s
#if !defined(NO_PLUGINS) || defined(NDEBUG)
static void tcscpy_s(tchar_t* Out,int OutLen,const tchar_t* In)
{
if (OutLen>0)
{
int n = min((int)tcslen(In),OutLen-1);
memcpy(Out,In,n*sizeof(tchar_t));
Out
= 0;
}
}
#endif
#ifdef NDEBUG
static BOOL CALLBACK EnumWindowsProc(HWND Wnd,LPARAM Param)
{
HWND* p = (HWND*)Param;
if (GetWindow(Wnd,GW_OWNER) == *p)
{
*p = Wnd;
return 0;
}
return 1;
}
static bool_t FindRunning(const tchar_t* CmdLine)
{
HWND Wnd;
tchar_t ClassName[32];
int n = tcslen(ProgramName);
tcscpy_s(ClassName,TSIZEOF(ClassName),ProgramName);
tcscpy_s(ClassName+n,TSIZEOF(ClassName)-n,T("_Win"));
Wnd = FindWindow(ClassName, NULL);
if (Wnd)
{
HWND WndMain = Wnd;
while (!IsWindowEnabled(Wnd))
{
HWND Last = Wnd;
EnumWindows(EnumWindowsProc,(LPARAM)&Wnd);
if (Wnd == Last)
break;
}
SetForegroundWindow(Wnd);
if (CmdLine && CmdLine[0])
{
COPYDATASTRUCT Data;
Data.dwData = 0;
Data.cbData = (tcslen(CmdLine)+1)*sizeof(tchar_t);
Data.lpData = (PVOID)CmdLine;
SendMessage(WndMain,WM_COPYDATA,(WPARAM)WndMain,(LPARAM)&Data);
}
return 1;
}
return 0;
}
#endif
#ifdef NO_PLUGINS
extern void Main(const tchar_t* Name,const tchar_t* Version,int Id,const tchar_t* CmdLine);
#else
static HANDLE Load(const tchar_t* Name)
{
HANDLE Module;
tchar_t Path[MAXPATH];
tchar_t *s;
GetModuleFileName(NULL,Path,MAXPATH);
s = tcsrchr(Path,'\\');
if (s) s[1]=0;
tcscpy_s(Path+tcslen(Path),TSIZEOF(Path)-tcslen(Path),Name);
Module = LoadLibrary(Path);
if (!Module)
Module = LoadLibrary(Name);
return Module;
}
#endif
#if !defined(TARGET_WINCE) && defined(UNICODE)
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hParent,LPSTR CmdA,int CmdShow)
{
WCHAR Cmd[2048];
mbstowcs(Cmd,CmdA,sizeof(Cmd)/sizeof(WCHAR)); //!!!
#else
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hParent,TCHAR* Cmd,int CmdShow)
{
#endif
#ifndef NDEBUG
// DLLTest(); // just to help debugging plugins. comment out if not needed
Context();
#endif
#if defined(TARGET_WINCE) && defined(ARM)
if (ProgramId == 2)
{
OSVERSIONINFO Ver;
Ver.dwOSVersionInfoSize = sizeof(Ver);
GetVersionEx(&Ver);
if (Ver.dwMajorVersion*100 + Ver.dwMinorVersion >= 421)
{
// old shell menu not supported after WM2003SE
MessageBox(NULL,T("This ARM_CE2 version of the player is not compatible with this device. Please install ARM_CE3 version."),NULL,MB_OK|MB_ICONERROR);
return 1;
}
}
#endif
#ifdef NDEBUG
if (!FindRunning(Cmd))
{
HANDLE Handle = CreateMutex(NULL,FALSE,ProgramName);
if (GetLastError() != ERROR_ALREADY_EXISTS)
#endif
{
#ifndef NO_PLUGINS
HMODULE Module;
SetCursor(LoadCursor(NULL, IDC_WAIT));
Module = Load(T("interface.plg"));
if (Module)
{
void (*Main)(const tchar_t* Name,const tchar_t* Version,int Id,const tchar_t* CmdLine);
*(FARPROC*)&Main = GetProcAddress(Module,TWIN("Main"));
if (!Main)
*(FARPROC*)&Main = GetProcAddress(Module,TWIN("_Main@16"));
if (Main)
Main(ProgramName,ProgramVersion,ProgramId,Cmd);
FreeLibrary(Module);
}
#else
Main(ProgramName,ProgramVersion,ProgramId,Cmd);
#endif
#ifdef NDEBUG
CloseHandle(Handle);
#endif
SetCursor(LoadCursor(NULL, IDC_ARROW));
}
#ifdef NDEBUG
}
#endif
return 0;
}
相关文章推荐
- 几行代码的播放器源代码――是真的能播放的
- 几行代码的播放器源代码——是真的能播放的
- (转)下面的代码实现从SQL Server数据库提取图片并显示在DataGrid的功能。
- 几行代码DOWN掉WIN2000,WINXP(收藏)
- 一段小巧的播放器代码
- 几行代码轻松搞定网页的简繁转换
- 一个控件几行代码实现换肤(可支持菜单)
- 在线播放器代码大全
- 下面是几段C#发送邮件相关的代码,我也懒得说明了,就这么个意思。
- 各种播放器代码
- 几行代码轻松搞定网页的简繁转换
- 用vb编一个计算器,需要用到数组,看看下面的代码,欢迎来找碴!
- 通过下面代码可以解决从表单得到的数据是乱码的问题
- 在线播放器代码大全!
- 下面是一个POST过程的核心代码
- 各种播放器代码
- VC实现的avi,mid,mp3,asf,wma播放器核心代码
- 各种播放器代码
- 在线播放器代码大全
- .net下面的常用代码。(不断更新)