Надо спрочно перевести этот сишный хидер на VB или PB
- Код: Выделить всё
// Copyright (C) 2004 Canopus Co., Ltd. All rights reserved.
#ifndef _M4CCTRL_H_
#define _M4CCTRL_H_
// --- return code
#define M4C_SUCCESS 0
#define M4C_FAILURE 1 // Unspecified error
#define M4C_FAIL_OPEN_FILE 2 // file open failure
#define M4C_FAIL_READ_FILE 3 // file read failure
#define M4C_FAIL_WRITE_FILE 4 // file write failure
#define M4C_FAIL_ALLOC_FAILURE 5 // alloc failure
#define M4C_FAIL_BADPARAM 6 // Invalid parameter
#define M4C_FAIL_UNSUPPORTED 7 // unsupported
#define M4C_FAIL_DEMUXERROR 8 // incorrect stream format
#define M4C_END_OF_STREAM -1 // The end of stream has been reached
// --- convert mode
#define M4C_CM_FILE 0
#define M4C_CM_MEMORY 1
// --- status code
#define M4C_SC_NOTREADY 0 // not initialized
#define M4C_SC_READY 1
#define M4C_SC_RUNNING 2
#define M4C_SC_STOPPING 3
#define M4C_SC_COMPLETE 4
#define M4C_SC_ERROR_STOP 5
// --- stream type
#define M4C_ST_UNKNOWN 0
#define M4C_ST_PROGRAMSTREAM 1
#define M4C_ST_TRANSPORTSTREAM 2 // not supported
// --- video type
#define M4C_VT_UNKNOWN 0
#define M4C_VT_MPEG1 1 // not supported
#define M4C_VT_MPEG2 2 // not supported
#define M4C_VT_MPEG4 4
// --- audio type
#define M4C_AT_UNKNOWN 0
#define M4C_AT_MPEG1_LAYER1 1
#define M4C_AT_MPEG1_LAYER2 2
#define M4C_AT_MPEG1_LAYER3 3 // not supported
#define M4C_AT_AC3 4 // not supported
#define M4C_AT_LPCM 5 // not supported
// convert status
typedef struct {
int nStatusCode;
//#define M4C_SC_NOTREADY 0
//#define M4C_SC_READY 1
//#define M4C_SC_RUNNING 2
//#define M4C_SC_STOPPING 3
//#define M4C_SC_COMPLETE 4
//#define M4C_SC_ERROR_STOP 5
LONGLONG llPosition;
LONGLONG llTotalSize;
} M4C_STATUS, *PM4C_STATUS;
// source media file information.
typedef struct {
int StreamType;
//#define M4C_ST_UNKNOWN 0
//#define M4C_ST_PROGRAMSTREAM 1
//#define M4C_ST_TRANSPORTSTREAM 2
LONGLONG llStreamLen;
LONGLONG llFileLen;
int VideoType;
//#define M4C_VT_UNKNOWN 0
//#define M4C_VT_MPEG1 1
//#define M4C_VT_MPEG2 2
//#define M4C_VT_MPEG4 4
DWORD dwVideoWidth;
DWORD dwVideoHeigh;
DWORD dwVideoBitrate;
float fVideoFrameRate;
int AudioType;
//#define M4C_AT_UNKNOWN 0
//#define M4C_AT_MPEG1_LAYER1 1
//#define M4C_AT_MPEG1_LAYER2 2
//#define M4C_AT_MPEG1_LAYER3 3
//#define M4C_AT_AC3 4
//#define M4C_AT_LPCM 5
DWORD dwAudioBitrate;
DWORD dwAudioSamplingRate;
DWORD dwAudioChannelNumber;
} MEDIA_INFO, *PMEDIA_INFO;
typedef int (CALLBACK* M4C_CONVERT_CALLBACK)(HANDLE hHandle, LONGLONG llOffset, LPBYTE pbBuff, DWORD cbBuff, LPDWORD pcbReadBytes, DWORD dwParam);
typedef VOID (CALLBACK* M4C_STATUS_CALLBACK)(HANDLE hHandle, DWORD dwStatus, DWORD dwParam);
typedef struct {
int nRetCode;
LPCTSTR pszMP4FileName;
int nConvertMode;
//#define M4C_CM_FILE 0
//#define M4C_CM_MEMORY 1
union {
struct _convert_memory {
DWORD dwParam;
M4C_CONVERT_CALLBACK ConvertCallback;
LONGLONG llSetupBytes;
} ConvertMemoryInfo;
struct _convert_file {
LPCTSTR pszConvertFileName;
} ConvertFileInfo;
};
} M4C_OPEN_PARAM;
///////////////////////////////////////////////////////////////////////
//
#define M4CAPI(ret) __declspec(dllexport) ret _stdcall
#if defined(__cplusplus)
extern "C" {
#endif
M4CAPI(HANDLE) M4C_Open(M4C_OPEN_PARAM* pOpenParam);
M4CAPI(int) M4C_Close(HANDLE hHandle);
M4CAPI(int) M4C_StartConvert(HANDLE hHandle);
M4CAPI(int) M4C_StopConvert(HANDLE hHandle);
M4CAPI(int) M4C_GetMediaInfo(HANDLE hHandle, PMEDIA_INFO* ppMediaInfo);
M4CAPI(int) M4C_GetStatus(HANDLE hHandle, PM4C_STATUS* ppStatus);
M4CAPI(int) M4C_SetStatusCallback(HANDLE hHandle, M4C_STATUS_CALLBACK pCallback, DWORD dwParam);
#if defined(__cplusplus)
}
#endif
#endif //#ifndef _M4CCTRL_H_