F
franklei
Unregistered / Unconfirmed
GUEST, unregistred user!
我用delphi中的纪录模拟c中的远程结构体指针接收传回来的数据有报错!
C中的定义如下:
typedef enum {
STREAM_VIDEO_ONLY,
STREAM_AUDIO_ONLY,
STREAM_VIDEO_AUDIO,
STREAM_UNKNOWN,
} media_stream_type_t;
typedef enum {
VIDEO_ALG_MPEG4,
VIDEO_ALG_H263,
VIDEO_ALG_UNKNOWN,
} media_video_algorithm_t;
typedef enum {
AUDIO_ALG_G711,
AUDIO_ALG_G729,
AUDIO_ALG_UNKNOWN,
} media_audio_algorithm_t;
typedef struct _FileInfoStruct
{
media_stream_type_t streamType;
struct
{
media_video_algorithm_t videoAlg;
int frameRate;
int srcWidth;
int srcHeight;
}video;
struct
{
media_audio_algorithm_t audioAlg;
}audio;
}FileInfoStruct;
调用动态库中的函数如下:
BOOL GetFileInfo(LPSTR lpFilename,FileInfoStruct* pFileInfo);
//把lpFilename文件的信息读出存储到pFileInfo结构中来
我用delphi实现如下:
type media_video_algorithm_t
= (VIDEO_ALG_MPEG4,
VIDEO_ALG_H263,
VIDEO_ALG_UNKNOWN);
type media_audio_algorithm_t
= (AUDIO_ALG_G711,
AUDIO_ALG_G729,
AUDIO_ALG_UNKNOWN);
type media_stream_type_t
= (STREAM_VIDEO_ONLY,
STREAM_AUDIO_ONLY,
STREAM_VIDEO_AUDIO,
STREAM_UNKNOWN);
type mpvideo = record
videoAlg : media_video_algorithm_t;
frameRate:integer;
srcWidth:integer;
srcHeight:integer;
end;
type mpaudio = record
audioAlg: media_audio_algorithm_t;
end;
type MPFileInfoStruct = record
streamType: integer;
video : mpvideo;
audio : mpaudio;
end;
var
fileInfor: MPFileInfoStruct
/...
GetFileInfo(pCur.filename,fileInfo); ×××
/...
我这样实现运行到×××出老是报错,而在VC中实现就没有任何问题,
我怀疑是结构定义错误,望高手指教错误之处!◎
C中的定义如下:
typedef enum {
STREAM_VIDEO_ONLY,
STREAM_AUDIO_ONLY,
STREAM_VIDEO_AUDIO,
STREAM_UNKNOWN,
} media_stream_type_t;
typedef enum {
VIDEO_ALG_MPEG4,
VIDEO_ALG_H263,
VIDEO_ALG_UNKNOWN,
} media_video_algorithm_t;
typedef enum {
AUDIO_ALG_G711,
AUDIO_ALG_G729,
AUDIO_ALG_UNKNOWN,
} media_audio_algorithm_t;
typedef struct _FileInfoStruct
{
media_stream_type_t streamType;
struct
{
media_video_algorithm_t videoAlg;
int frameRate;
int srcWidth;
int srcHeight;
}video;
struct
{
media_audio_algorithm_t audioAlg;
}audio;
}FileInfoStruct;
调用动态库中的函数如下:
BOOL GetFileInfo(LPSTR lpFilename,FileInfoStruct* pFileInfo);
//把lpFilename文件的信息读出存储到pFileInfo结构中来
我用delphi实现如下:
type media_video_algorithm_t
= (VIDEO_ALG_MPEG4,
VIDEO_ALG_H263,
VIDEO_ALG_UNKNOWN);
type media_audio_algorithm_t
= (AUDIO_ALG_G711,
AUDIO_ALG_G729,
AUDIO_ALG_UNKNOWN);
type media_stream_type_t
= (STREAM_VIDEO_ONLY,
STREAM_AUDIO_ONLY,
STREAM_VIDEO_AUDIO,
STREAM_UNKNOWN);
type mpvideo = record
videoAlg : media_video_algorithm_t;
frameRate:integer;
srcWidth:integer;
srcHeight:integer;
end;
type mpaudio = record
audioAlg: media_audio_algorithm_t;
end;
type MPFileInfoStruct = record
streamType: integer;
video : mpvideo;
audio : mpaudio;
end;
var
fileInfor: MPFileInfoStruct
/...
GetFileInfo(pCur.filename,fileInfo); ×××
/...
我这样实现运行到×××出老是报错,而在VC中实现就没有任何问题,
我怀疑是结构定义错误,望高手指教错误之处!◎