⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qtprivate.h

📁 这个库实现了录象功能
💻 H
📖 第 1 页 / 共 3 页
字号:
  uint32_t dwLength;  } quicktime_avih_t;typedef struct  {  uint32_t  biSize;  /* sizeof(BITMAPINFOHEADER) */  uint32_t  biWidth;  uint32_t  biHeight;  uint16_t  biPlanes; /* unused */  uint16_t  biBitCount;  char biCompression[5]; /* fourcc of image */  uint32_t  biSizeImage;   /* size of image. For uncompressed images */                           /* ( biCompression 0 or 3 ) can be zero.  */  uint32_t  biXPelsPerMeter; /* unused */  uint32_t  biYPelsPerMeter; /* unused */  uint32_t  biClrUsed;       /* valid only for palettized images. */  /* Number of colors in palette. */  uint32_t  biClrImportant;  /* Additional stuff */  int ext_size;  uint8_t * ext_data;  } quicktime_BITMAPINFOHEADER_t;typedef struct  {  uint32_t v1;  uint16_t v2;  uint16_t v3;  uint8_t  v4[8];  } quicktime_GUID_t;typedef enum  {    LQT_WAVEFORMAT_WAVEFORMAT,    LQT_WAVEFORMAT_PCMWAVEFORMAT,    LQT_WAVEFORMAT_WAVEFORMATEX,    LQT_WAVEFORMAT_WAVEFORMATEXTENSIBLE,  } quicktime_WAVEFORMAT_type_t;typedef struct  {  quicktime_WAVEFORMAT_type_t type;  struct    {    struct      {      uint16_t  wFormatTag;     /* value that identifies compression format */      uint16_t  nChannels;      uint32_t  nSamplesPerSec;      uint32_t  nAvgBytesPerSec;      uint16_t  nBlockAlign;    /* size of a data sample */      } WAVEFORMAT;    struct      {      uint16_t  wBitsPerSample;      } PCMWAVEFORMAT;    struct      {      uint16_t  cbSize;         /* size of format-specific data */      uint8_t * ext_data;      int       ext_size; /* Can be different from cbSize for WAVEFORMATEXTENSIBLE */      } WAVEFORMATEX;    struct      {      union        {        uint16_t wValidBitsPerSample;        uint16_t wSamplesPerBlock;        uint16_t wReserved;        } Samples;      uint32_t    dwChannelMask;      quicktime_GUID_t SubFormat;      } WAVEFORMATEXTENSIBLE;    } f;  } quicktime_WAVEFORMAT_t;typedef union  {  quicktime_BITMAPINFOHEADER_t bh;  quicktime_WAVEFORMAT_t       wf;  } quicktime_strf_t;struct quicktime_strl_s{        quicktime_atom_t atom;/* Super index for reading */        quicktime_indx_t indx;     /* strh stuff */                int64_t  strh_offset;        int64_t  end_pos;        quicktime_strh_t strh;        /* Format */        quicktime_strf_t strf;        /* The next ones will be used for generating index tables           with the lowest possible error */        int64_t total_bytes;        int64_t total_samples;        int64_t total_blocks;        uint32_t size; /* The size after the strl was first written *//* Tag for writer with NULL termination: 00wb, 00dc   Not available in reader.*/        char tag[5];/* Flags for reader.  Not available in writer. */        int is_audio;        int is_video;/* Notify reader the super indexes are valid */        int have_indx;};typedef struct{        int64_t avih_offset;        quicktime_avih_t avih;        quicktime_atom_t atom;        int64_t total_frames_offset;                                                                                                                     /* AVI equivalent for each trak.  Use file->moov.total_tracks *//* Need it for super indexes during reading. */        quicktime_strl_t *strl[MAXTRACKS];} quicktime_hdrl_t;typedef struct{        char tag[5];        uint32_t flags;/* Start of 8 byte chunk header relative to start of the 'movi' string */        int32_t offset;/* Size of chunk less the 8 byte header */        int32_t size;} quicktime_idx1table_t;typedef struct  {  char * IARL; // Archival Location. Indicates where the subject of the file is archived.  char * IART; // Artist. Lists the artist of the original subject of the file. For example, "Michaelangelo."  char * ICMS; // Commissioned. Lists the name of the person or organization that commissioned the subject of               // the file. For example, "Pope Julian II."  char * ICMT; // Comments. Provides general comments about the file or the subject of the file. If the               // comment is several sentences long, end each sentence with a period. Do not include newline               // characters.  char * ICOP; // Copyright. Records the copyright information for the file. For example,               // "Copyright Encyclopedia International 1991." If there are multiple copyrights, separate them               // by a semicolon followed by a space.  char * ICRD; // Creation date. Specifies the date the subject of the file was created. List dates in               // year-month-day format, padding one-digit months and days with a zero on the left. For example,               // "1553-05-03" for May 3, 1553.  char * ICRP; // Cropped. Describes whether an image has been cropped and, if so, how it was cropped. For example,               // "lower right corner."  char * IDIM; // Dimensions. Specifies the size of the original subject of the file. For example,               // "8.5 in h, 11 in w."  char * IDPI; // Dots Per Inch. Stores dots per inch setting of the digitizer used to produce the file, such as               // "300."  char * IENG; // Engineer. Stores the name of the engineer who worked on the file. If there are multiple engineers,               // separate the names by a semicolon and a blank. For example, "Smith, John; Adams, Joe."  char * IGNR; // Genre. Describes the original work, such as, "landscape," "portrait," "still life," etc.  char * IKEY; // Keywords. Provides a list of keywords that refer to the file or subject of the file. Separate               // multiple keywords with a semicolon and a blank. For example, "Seattle; aerial view; scenery."  char * ILGT; // Lightness. Describes the changes in lightness settings on the digitizer required to produce the               // file. Note that the format of this information depends on hardware used.  char * IMED; // Medium. Describes the original subject of the file, such as, "computer image," "drawing,"               // "lithograph," and so forth.  char * INAM; // Name. Stores the title of the subject of the file, such as, "Seattle From Above."  char * IPLT; // Palette Setting. Specifies the number of colors requested when digitizing an image, such as "256."  char * IPRD; // Product. Specifies the name of the title the file was originally intended for, such as               // "Encyclopedia of Pacific Northwest Geography."  char * ISBJ; // Subject. Describes the conbittents of the file, such as "Aerial view of Seattle."  char * ISFT; // Software. Identifies the name of the software package used to create the file, such as               // "Microsoft WaveEdit."  char * ISHP; // Sharpness. Identifies the changes in sharpness for the digitizer required to produce the file               // (the format depends on the hardware used).  char * ISRC; // Source. Identifies the name of the person or organization who supplied the original subject of the               // file. For example, "Trey Research."  char * ISRF; // Source Form. Identifies the original form of the material that was digitized, such as "slide,"               // "paper," "map," and so forth. This is not necessarily the same as IMED.  char * ITCH; // Technician. Identifies the technician who digitized the subject file. For example, "Smith, John."  } quicktime_riffinfo_t;typedef struct{        quicktime_atom_t atom;        quicktime_idx1table_t *table;        int table_size;        int table_allocation;} quicktime_idx1_t;                                                                                                                     typedef struct{        quicktime_atom_t atom;        quicktime_movi_t movi;        quicktime_hdrl_t hdrl;        quicktime_riffinfo_t info;/* Full index */        quicktime_idx1_t idx1;/* Notify reader the idx1 table is valid */        int have_idx1;        int have_hdrl;        int have_info;} quicktime_riff_t;/* table of pointers to every track */typedef struct{	quicktime_trak_t *track; /* real quicktime track corresponding to this table */	int channels;        int samplerate;        /* number of audio channels in the track */        lqt_channel_t * channel_setup;        int64_t current_position;   /* current sample in output file */	int64_t current_chunk;      /* current chunk in output file */        /* Last position if set by the codec. If last position and current position           differ, the codec knows, that a seek happened since the last decode call */        int64_t last_position;	void *codec;        int eof; /* This is set to 1 by the core if one tries to read beyond EOF *//* Another API enhancement: Codecs only deliver samples in the format specified by   sample_format. The usual decode() functions will convert them to int16_t or float */           lqt_sample_format_t sample_format; /* Set by the codec */        uint8_t * sample_buffer;        int sample_buffer_alloc;  /* Allocated size in SAMPLES of the sample buffer *//* VBR stuff */        int vbr_num_frames; /* Frames written since start of chunk */        int64_t vbr_frame_start;        int64_t vbr_frames_written;        /* The total samples are calculated while initializing, but they MIGHT           be changed by the faad decoder, in the case resampling happens. */        int64_t total_samples;/* WAV ID: Taken from the codec_info and saved here for writing the AVI header */        int wav_id;        int compatibility_flags; /* Taken from codec info */} quicktime_audio_map_t;typedef struct{	quicktime_trak_t *track;	quicktime_trak_t *timecode_track;	long current_position;   /* current frame in output file */	long current_chunk;      /* current chunk in output file */	void *codec;/* Timestamp of the NEXT frame decoded. Unit is the timescale of the track *//* For Encoding: Timestamp of the LAST encoded frame */        int64_t timestamp;/* For codecs with B-frames: Timestamp of the just written frame */        int has_b_frames; /* Probably needed for encoding only */        int64_t coded_timestamp; /* Set by the codec during encoding */        int64_t stts_index;        int64_t stts_count;        int stream_cmodel;  /* Colormodel, which is read/written natively by the codec  */        int stream_row_span, stream_row_span_uv;        int io_cmodel;      /* Colormodel, which is used by the encode/decode functions */        int io_row_span, io_row_span_uv;        /* This is used by the core to do implicit colorspace conversion and scaling (NOT recommended!!) */        uint8_t ** temp_frame;        lqt_chroma_placement_t chroma_placement;        lqt_interlace_mode_t interlace_mode;        int compatibility_flags; /* Taken from codec info */// Timecode stuff        uint32_t encode_timecode;        int has_encode_timecode;	long current_timecode_chunk;      /* current chunk in output file *//* Timestamp of the last encoded timecode */        int64_t timecode_timestamp;/* For decoding, *all* timecodes are read here. * For encoding, this contains a small buffer such that we don't   start a new chunk for each timecode. */        int timecodes_alloc;        int num_timecodes;        uint32_t * timecodes;        int timecodes_written;  } quicktime_video_map_t;/* Text track */typedef struct  {  quicktime_trak_t *track;  int is_chapter_track; /* For encoding only */  int current_position;    lqt_charset_converter_t * cnv;  char * text_buffer;  int text_buffer_alloc;  int initialized; /* For encoding only */  int64_t current_chunk;    } quicktime_text_map_t;/* obji */typedef struct{    int version;    int revision;    int movieType;    int viewStateCount;    int defaultViewState;    int mouseDownViewState;    long viewDuration;    long columns;    long rows;    float mouseMotionScale;    float minPan;    float maxPan;    float defaultPan;    float minTilt;    float maxTilt;    float defaultTilt;    float minFOV;    float FOV;    float defaultFOV;    float defaultViewCenterH;    float defaultViewCenterV;    float viewRate;    float frameRate;    long animSettings;    long controlSettings;} quicktime_obji_t;/* pdat */typedef struct{    int version;    int revision;    long imageRefTrackIndex;    long hotSpotRefTrackIndex;    float minPan;    float maxPan;    float defaultPan;    float minTilt;    float maxTilt;    float defaultTilt;    float minFOV;    float maxFOV;    float defaultFOV;    long imageSizeX;    long imageSizeY;    int imageNumFramesX;    int imageNumFramesY;    long hotSpotSizeX;    long hotSpotSizeY;    int hotSpotNumFramesX;    int hotSpotNumFramesY;    long flags;    char panoType[4];    long reserved;} quicktime_pdat_t;/* pHdr */typedef struct{    unsigned long    nodeID;    float        defHPan;    float        defVPan;    float        defZoom;    // constraints for this node; use zero for default    float        minHPan;    float        minVPan;    float        minZoom;    float        maxHPan;    float        maxVPan;    float        maxZoom;    long        reserved1;        // must be zero    long        reserved2;        // must be zero    long        nameStrOffset;        // offset into string table atom    long        commentStrOffset;    // offset into string table atom} quicktime_pHdr_t;/* qtvr node */typedef struct{    	int node_type;	int64_t node_start; /* start frame */ 	int64_t node_size; /* size of node in frames */	quicktime_ndhd_t ndhd;	quicktime_obji_t obji;	quicktime_pdat_t pdat;} quicktime_qtvr_node_t;/* file descriptor passed to all routines */struct quicktime_s{	FILE *stream;	int64_t total_length;        int encoding_started;	quicktime_mdat_t mdat;	quicktime_moov_t moov;        quicktime_ftyp_t ftyp;        int has_ftyp;        lqt_file_type_t file_type;	int rd;	int wr;/* If the moov atom is compressed */        int compressed_moov;        unsigned char *moov_data;/* * Temporary storage of compressed sizes.  If the file length is shorter than the * uncompressed sizes, it won't work. */        int64_t moov_end;        int64_t moov_size;/* AVI tree */        quicktime_riff_t *riff[MAX_RIFFS];        int total_riffs;        uint32_t max_riff_size;/* for begining and ending frame writes where the user wants to write the  *//* file descriptor directly */	int64_t offset;/* I/O *//* Current position of virtual file descriptor */	int64_t file_position;      // Work around a bug in glibc where ftello returns only 32 bits by maintaining// our own position	int64_t ftell_position;/* Read ahead buffer */	int64_t preload_size;      /* Enables preload when nonzero. */	uint8_t *preload_buffer;	int64_t preload_start;     /* Start of preload_buffer in file */	int64_t preload_end;       /* End of preload buffer in file */	int64_t preload_ptr;       /* Offset of preload_start in preload_buffer *//* Write ahead buffer *//* Amount of data in presave buffer */        int64_t presave_size;/* Next presave byte's position in file */        int64_t presave_position;        uint8_t *presave_buffer;/* Presave doesn't matter a whole lot, so its size is fixed */#define QUICKTIME_PRESAVE 0x100000/* mapping of audio channels to movie tracks *//* one audio map entry exists for each channel */	int total_atracks;	quicktime_audio_map_t *atracks;/* mapping of video tracks to movie tracks */	int total_vtracks;	quicktime_video_map_t *vtracks;/* Mapping of text tracks to movie tracks */	int total_ttracks;	quicktime_text_map_t *ttracks;/* Parameters for frame currently being decoded */	int in_x, in_y, in_w, in_h, out_w, out_h;/*      Libquicktime change: color_model and row_span are now saved per track *//*	int color_model, row_span; */	quicktime_qtvr_node_t qtvr_node[MAXNODES];/* Logging support */        lqt_log_callback_t log_callback;        void * log_data;/* I/O Error is saved here: It has the advantage, that   codecs don't have to check the return values of quicktime_[read|write]_data   all the time. */        int io_error;        int io_eof;};typedef struct{	int (*delete_vcodec)(quicktime_video_map_t *vtrack);	int (*delete_acodec)(quicktime_audio_map_t *atrack);	int (*decode_video)(quicktime_t *file, 				unsigned char **row_pointers, 				int track);	int (*encode_video)(quicktime_t *file, 				unsigned char **row_pointers, 				int track);        /* API Change: Return value is the number of samples */        int (*decode_audio)(quicktime_t *file,                             void * output,                            long samples,                             int track);	int (*encode_audio)(quicktime_t *file,                             void * input,                            long samples,                            int track);	int (*set_parameter)(quicktime_t *file, 		int track, 		const char *key, 		const void *value);        /* Set the encoding pass */        int (*set_pass)(quicktime_t *file, 		int track, int pass, int total_passes,                              const char * stats_file);        /* Encode and write remaining stuff before closing */        int (*flush)(quicktime_t *file,                      int track);        /* Resynchronize the codec after seeking */        void (*resync)(quicktime_t *file, int track);        void *priv;        /* The followings are for libquicktime only */        void *module;     /* Needed by libquicktime for dynamic loading */        char *codec_name; /* Needed by libquicktime */} quicktime_codec_t;#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -