📄 avitypes.h
字号:
// $Header: /Mux_Demux_SDK/libAvi/src/aviTypes.h 7 8/04/03 5:02p Raider $
//
// Copyright (c) 2003 DivXNetworks, Inc. http://www.divxnetworks.com
// All rights reserved.
//
// This software is the confidential and proprietary information of DivxNetworks
// Inc. ("Confidential Information"). You shall not disclose such Confidential
// Information and shall use it only in accordance with the terms of the license
// agreement you entered into with DivXNetworks, Inc.
#ifndef AVITYPES_H
#define AVITYPES_H
/* <<< @: 5010-xxx.HoJune_Byun 06/01/24 : Test Purpose for DIVX 6.0 Only */
#define _USE_DIVX6_TEST 0
#define RIFF_MAX_NUM 10//20
#define MRIF_MAX_NUM 10//20
/* <<< @: 5010-xxx.HoJune_Byun 06/01/24 : Test Purpose for DIVX 6.0 Only */
/* <<< @: 5010-xxx.HoJune_Byun 06/01/24 : Test Purpose for AVI Extenion 2.0 Only */
#define _USE_AVI_EXTENSION_TEST 1
/* <<< @: 5010-xxx.HoJune_Byun 06/01/24 : Test Purpose for AVI Extenion 2.0 Only */
//gaoping 20060401
#include "DRIVER/FS/Fs_api.h"
#if 0
#include "headers.h"
#endif
/* <<< @: 5010-xxx.HoJune_Byun 05/11/24 : Inactivate unused code */
#if 0
#define int8_t char
#define uint8_t unsigned char
#define int16_t short
#define uint16_t unsigned short
#define int32_t int
#define uint32_t unsigned int
#define int64_t double
#define uint64_t double
#endif/* 0 */
/* <<< @: 5010-xxx.HoJune_Byun 05/11/24 : Inactivate unused code */
#define LIBAVI_FILE \
FILE
#define LIBAVI_SIZE_T \
size_t
#define LIBAVI_FILEOFFSET_T \
long
#define LIBAVI_FOPEN(name, mode) \
fopen(name, mode)
#define LIBAVI_FCLOSE(fp) \
fclose(fp)
#define LIBAVI_FWRITE(a, bsize, n, fp) \
fwrite(a, bsize, n, fp)
#define LIBAVI_FREAD(a, bsize, n, fp) \
fread(a, bsize, n, fp)
#define LIBAVI_FPUTC(c, fp) \
fputc(c, fp)
#define LIBAVI_FGETC(fp) \
fgetc(fp)
#define LIBAVI_FEOF(fp) \
feof(fp)
#define LIBAVI_FERROR(fp) \
ferror(fp)
#define LIBAVI_FSEEK(fp, offset, origin) \
fseek(fp, offset, origin)
#if 0
#define LIBAVI_SEEK_CUR SEEK_CUR
#define LIBAVI_SEEK_SET SEEK_SET
#define LIBAVI_SEEK_END SEEK_END
#endif
#define LIBAVI_FTELL(fp) \
ftell(fp)
/* fourcc.h */
typedef unsigned int fourCC_t;
/* Header.h */
/**** Main AVI header (avih) ****/
typedef struct AVI_header_avih_s {
#if 0
// int32_t dwMicroSecPerFrame; /* set to 0 ? */
INT dwMicroSecPerFrame; /* set to 0 ? */
// int32_t dwMaxBytesPerSec; /* maximum transfer rate */
INT dwMaxBytesPerSec; /* maximum transfer rate */
// int32_t dwPaddingGranularity; /* pad to multiples of this size, normally 2K */
INT dwPaddingGranularity; /* pad to multiples of this size, normally 2K */
// int32_t dwFlags;
INT dwFlags;
// int32_t dwTotalFrames; /* number of frames in first RIFF 'AVI ' chunk */
INT dwTotalFrames; /* number of frames in first RIFF 'AVI ' chunk */
// int32_t dwInitialFrames;
INT dwInitialFrames;
// int32_t dwStreams;
INT dwStreams;
// int32_t dwSuggestedBufferSize;
INT dwSuggestedBufferSize;
// int32_t dwWidth;
INT dwWidth;
// int32_t dwHeight;
INT dwHeight;
// int32_t dwReserved[4];
INT dwReserved[4];
#else
INT dwMicroSecPerFrame; /* set to 0 ? */
INT dwMaxBytesPerSec; /* maximum transfer rate */
INT dwPaddingGranularity; /* pad to multiples of this size, normally 2K */
INT dwFlags;
INT dwTotalFrames; /* number of frames in first RIFF 'AVI ' chunk */
INT dwInitialFrames;
INT dwStreams;
INT dwSuggestedBufferSize;
INT dwWidth;
INT dwHeight;
INT dwReserved[4];
#endif/* 0 */
} AVI_header_avih_t;
/**** Stream header (strh) ****/
typedef struct AVI_header_strh_s {
#if 0
int present;
fourCC_t fccType;
fourCC_t fccHandler;
// int32_t dwFlags; /* Contains AVITF_* flags */
INT dwFlags; /* Contains AVITF_* flags */
// int16_t wPriority;
SHORT wPriority;
// int16_t wLanguage;
SHORT wLanguage;
// int32_t dwInitialFrames;
INT dwInitialFrames;
// int32_t dwScale;
INT dwScale;
// int32_t dwRate; /* dwRate / dwScale == samples/second */
INT dwRate; /* dwRate / dwScale == samples/second */
// int32_t dwStart;
INT dwStart;
// int32_t dwLength; /* In units above... */
INT dwLength; /* In units above... */
// int32_t dwSuggestedBufferSize;
INT dwSuggestedBufferSize;
// int32_t dwQuality;
INT dwQuality;
// int32_t dwSampleSize;
INT dwSampleSize;
// int16_t rcFrame_left;
SHORT rcFrame_left;
// int16_t rcFrame_top;
SHORT rcFrame_top;
// int16_t rcFrame_right;
SHORT rcFrame_right;
// int16_t rcFrame_bottom;
SHORT rcFrame_bottom;
#else
INT present;
fourCC_t fccType;
fourCC_t fccHandler;
INT dwFlags; /* Contains AVITF_* flags */
SHORT wPriority;
SHORT wLanguage;
INT dwInitialFrames;
INT dwScale;
INT dwRate; /* dwRate / dwScale == samples/second */
INT dwStart;
INT dwLength; /* In units above... */
INT dwSuggestedBufferSize;
INT dwQuality;
INT dwSampleSize;
SHORT rcFrame_left;
SHORT rcFrame_top;
SHORT rcFrame_right;
SHORT rcFrame_bottom;
#endif/* 0 */
} AVI_header_strh_t;
/**** Stream format for video (strf) ****/
typedef struct AVI_header_strf_video_s {
#if 0
int32_t biSize;
int32_t biWidth;
int32_t biHeight;
int16_t biPlanes;
int16_t biBitCount;
uint32_t biCompression;
int32_t biSizeImage;
int32_t biXPelsPerMeter;
int32_t biYPelsPerMeter;
int32_t biClrUsed;
int32_t biClrImportant;
#else
INT biSize;
INT biWidth;
INT biHeight;
SHORT biPlanes;
SHORT biBitCount;
UINT biCompression;
INT biSizeImage;
INT biXPelsPerMeter;
INT biYPelsPerMeter;
INT biClrUsed;
INT biClrImportant;
#endif/* 0 */
} AVI_header_strf_video_t;
typedef struct AVI_header_strd_drm_info_s
{
// drm version number.
INT version;
INT drm_size;/* 2224 Bytes*/
// encrpyted drm info. AdpTartgetHeader
UCHAR *drm_info;
int drm_offset;
} AVI_header_strd_drm_info_t;
typedef struct AVI_header_strf_caption_s {
#if 0
uint16_t wCodePage;
uint16_t wCountryCode;
uint16_t wLanquageCode;
uint16_t wDialect;
#else
UINT16 wCodePage;
UINT16 wCountryCode;
UINT16 wLanquageCode;
UINT16 wDialect;
#endif/* 0 */
} AVI_header_strf_caption_t;
typedef struct AVI_header_strf_chapter_s {
UINT16 wCodePage;
UINT16 wCountryCode;
UINT16 wLanquageCode;
UINT16 wDialect;
} AVI_header_strf_chapter_t;
/**** Stream format for audio (stra) ****/
#define AVI_STRF_MAX_EXTRA 64
typedef struct AVI_header_strf_audio_s {
#if 0
BYTE2 wFormatTag; /* format type */
int16_t nChannels; /* number of channels (i.e. mono, stereo...) */
int32_t nSamplesPerSec; /* sample rate */
int32_t nAvgBytesPerSec; /* for buffer estimation */
int16_t nBlockAlign; /* block size of data */
int16_t wBitsPerSample; /* number of bits per sample of mono data */
int16_t cbSize; /* the count in bytes of the size of extra information (after cbSize) */
// #define AVI_STRF_MAX_EXTRA 64
// uint8_t extra[AVI_STRF_MAX_EXTRA]; /* any extra information, e.g. mp3 needs this */
UCHAR extra[AVI_STRF_MAX_EXTRA]; /* any extra information, e.g. mp3 needs this */
#else
BYTE2 wFormatTag; /* format type */
INT16 nChannels; /* number of channels (i.e. mono, stereo...) */
INT nSamplesPerSec; /* sample rate */
INT nAvgBytesPerSec; /* for buffer estimation */
INT16 nBlockAlign; /* block size of data */
INT16 wBitsPerSample; /* number of bits per sample of mono data */
INT16 cbSize; /* the count in bytes of the size of extra information (after cbSize) */
// #define AVI_STRF_MAX_EXTRA 64
// uint8_t extra[AVI_STRF_MAX_EXTRA]; /* any extra information, e.g. mp3 needs this */
UCHAR extra[AVI_STRF_MAX_EXTRA]; /* any extra information, e.g. mp3 needs this */
#endif/* 0 */
} AVI_header_strf_audio_t;
/* <<< @: 5010-xxx.HoJune_Byun 05/11/24 : Inactivate unused code */
#if 0
/* extra data required in 'strf' for MPEG Layer 3 audio */
/* this corresponds to MPEGLAYER3WAVEFORMAT in the Microsoft libraries */
typedef struct AVI_header_strf_mp3_s {
#if 0
uint16_t wID;
uint32_t fdwFlags;
int16_t nBlockSize;
int16_t nFramesPerBlock;
int16_t nCodecDelay;
#else
USHORT wID;
UINT fdwFlags;
SHORT nBlockSize;
SHORT nFramesPerBlock;
SHORT nCodecDelay;
#endif/* 0 */
} AVI_header_strf_mp3_t;
#endif/* 0 */
/* <<< @: 5010-xxx.HoJune_Byun 05/11/24 : Inactivate unused code */
#ifndef STRN_VIDEO_NAME
#define STRN_VIDEO_NAME "Video"
#define STRN_AUDIO_NAME "Audio"
#define STRN_TEXT_CAPTION_NAME "Subtitle"
#define STRN_BITMAP_CAPTION_NAME "Subtitle"
#define STRN_CHAPTER_NAME "Chapter"
#endif
typedef struct AVI_header_strn_s {
SHORT streamNameSize; /* the number of bytes in the streamName, this is not to be read or written */
UCHAR *streamName; /* null terminated string */
} AVI_header_strn_t;
/* here are some flags pertaining to the above structure */
#define MPEGLAYER3_ID_UNKNOWN 0
#define MPEGLAYER3_ID_MPEG 1
#define MPEGLAYER3_ID_CONSTANTFRAMESIZE 2
#define MPEGLAYER3_FLAG_PADDING_ISO 0x00000000
#define MPEGLAYER3_FLAG_PADDING_ON 0x00000001
#define MPEGLAYER3_FLAG_PADDING_OFF 0x00000002
#define MAX_AVI_TRACKS 40//DQA5098 disc have 33 entries
#define MAX_AVI_WRONG_TRACK_NUM MAX_AVI_TRACKS
typedef struct caption_info_s {
AVI_header_strf_caption_t text_info;
INT streamNameSize;
CHAR *streamName;
} caption_info_t;
typedef struct chapter_info_s {
AVI_header_strf_chapter_t text_info;
INT streamNameSize;
CHAR *streamName;
} chapter_info_t;
/* <<< @: 5010-xxx.HoJune_Byun 06/01/02 : LIST 'DXDT' MTDA Chunk */
typedef struct chunk_info_s {
int has;
int version;
int size;
char *info;
} chunk_info_t;
typedef struct dmnu_info_s {
chunk_info_t menu;
} dmnu_info_t;
typedef struct dxdt_info_s {
chunk_info_t mtda;
} dxdt_info_t;
/* <<< @: 5010-xxx.HoJune_Byun 06/01/02 : LIST 'DXDT' MTDA Chunk */
/* <<< @: 5010-xxx.HoJune_Byun 05/11/24 : Inactivate unused code */
#if 0
typedef struct aviout_handle_s {
INT junk;
} aviout_handle_t;
#endif/* 0 */
/* <<< @: 5010-xxx.HoJune_Byun 05/11/24 : Inactivate unused code */
/* audio_info.h */
typedef struct audio_info_s {
/* The following fields are from 'strh' */
UINT dwInitialFrames;
UINT dwScale;
UINT dwRate;
UINT dwStart;
/* <<< @: 5010-xxx.JaeYoul_Kim 051212 : need length value to calculate last alloc pts*/
UINT dwLength; //jy last
UINT dwSuggestedBufferSize;
/* >>> @: 5010-xxx.JaeYoul_Kim 051212 */
UINT dwSampleSize;
/* This field becomes 'strf' */
AVI_header_strf_audio_t wfx;
INT streamNameSize;
CHAR *streamName;
/* 2005/11/07 : Park,HeeSang - Start */
INT TrackIndex; /* for DEMUX */
/* 2005/11/07 : Park,HeeSang - End */
/* <<< @: 5010-xxx.Park,HeeSang - Start : 05/11/15 : */
// int Cur_audio_track; /* Indicate current audio track No */
INT Stream_track; /* Indicate current stream track No */
/* <<< @: 5010-xxx.Park,HeeSang - End : 05/11/15 : */
BOOL AudioCodecInvalid;
} audio_info_t;
/* audio_info.h */
/* avi_error.h */
typedef enum
{
WORKED = 0,
DIDNT_WORK,
NEVER_HAD_A_CHANCE,
END_OF_FILE,
MAX_FILESIZE_REACHED
}avi_error_t;
/* avi_error.h */
#define AVI_FS_MAGIC 0x3f18a370
#define AVI_FS_DEBUG 1
#define LIBAVI_SEEK_CUR SEEK_CUR
#define LIBAVI_SEEK_SET SEEK_SET
#define LIBAVI_SEEK_END SEEK_END
typedef struct avi_fs_entry_st {
UINT fe_Magic;
FS_File_t fe_FileHandle;
UINT fe_CurOffset;
// ULLONG fe_CurOffset;
char *fe_pCacheBuf;
UINT fe_CacheValidSize;
UINT fe_CacheOffset;
UINT fe_CacheSize;
BOOL fe_CacheValid;
} AVI_FILE_st;
/* avi_fs.h*/
/* chunk_type.h */
typedef enum {
CHUNK_TYPE_UNKNOWN,
CHUNK_TYPE_AUDIO,
CHUNK_TYPE_UNCOMPRESSED,
CHUNK_TYPE_VIDEO,
CHUNK_TYPE_DRM,
CHUNK_TEXT_TYPE_CAPTION,
CHUNK_BITMAP_TYPE_CAPTION,
CHUNK_TYPE_CHAPTER,
CHUNK_TYPE_LIST,
CHUNK_TYPE_JUNK,
CHUNK_TYPE_RESERVED,
CHUNK_TYPE_STANDARD_INDEX,
CHUNK_TYPE_METADATA,
CHUNK_TYPE_INDEX_INDEX, /* Index for 'ix##' in AVI 2.0 */
CHUNK_TYPE_NONE
} chunk_type_t;
/* chunk_type.h */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -