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

📄 qtprivate.h

📁 这个库实现了录象功能
💻 H
📖 第 1 页 / 共 3 页
字号:
/******************************************************************************* qtprivate.h libquicktime - A library for reading and writing quicktime/avi/mp4 files. http://libquicktime.sourceforge.net Copyright (C) 2002 Heroine Virtual Ltd. Copyright (C) 2002-2007 Members of the libquicktime project. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*******************************************************************************/#ifndef PRIVATE_H#define PRIVATE_H#include "charset.h"#include <quicktime/lqt_atoms.h>#include <inttypes.h>#include <stdio.h> // For quicktime_s->stream/* ================================= structures *//* Version used internally.  You need to query it with the C functions *//* These must match quicktime4linux !!! */#define QUICKTIME_MAJOR   2#define QUICKTIME_MINOR   0#define QUICKTIME_RELEASE 0#define HEADER_LENGTH 8#define MAXTRACKS 1024#define MAXNODES 1/* Crazy Mich R. Soft constants */#define AVI_HASINDEX       0x00000010  // Index at end of file?#define AVI_MUSTUSEINDEX   0x00000020#define AVI_ISINTERLEAVED  0x00000100#define AVI_TRUSTCKTYPE    0x00000800  // Use CKType to find key frames?#define AVI_WASCAPTUREFILE 0x00010000#define AVI_COPYRIGHTED    0x00020000#define AVIF_WASCAPTUREFILE     0x00010000#define AVI_KEYFRAME       0x10#define AVI_INDEX_OF_CHUNKS 0x01#define AVI_INDEX_OF_INDEXES 0x00                                                                                                                     #define AVI_FRAME_RATE_BASE 10000#define MAX_RIFFS  0x100#define QTVR_GRABBER_SCROLLER_UI 1#define QTVR_OLD_JOYSTICK_UI 2 #define QTVR_JOYSTICK_UI 3#define QTVR_GRABBER_UI 4#define QTVR_ABSOLUTE_UI 5/* Forward declarations */typedef struct quicktime_strl_s quicktime_strl_t;typedef struct{/* for AVI it's the end of the 8 byte header in the file *//* for Quicktime it's the start of the 8 byte header in the file */	int64_t start;	int64_t end;        /* byte endpoint in file */	int64_t size;       /* byte size for writing */	int use_64;         /* Use 64 bit header */	unsigned char type[4];} quicktime_atom_t;typedef struct{	int64_t start;	int64_t end;        /* byte endpoint in file */	int64_t size;       /* byte size for writing */	unsigned char type[4];	int child_count;	int use_64;	long ID;} quicktime_qtatom_t;typedef struct{	float values[9];} quicktime_matrix_t;typedef struct  {  uint32_t major_brand;  uint32_t minor_version;  int num_compatible_brands;  uint32_t * compatible_brands;  } quicktime_ftyp_t;typedef struct{	int version;	long flags;        uint64_t creation_time;	uint64_t modification_time;	int track_id;	long reserved1;	uint64_t duration;        uint8_t reserved2[8];	int layer;	int alternate_group;	float volume;	long reserved3;	quicktime_matrix_t matrix;	float track_width;	float track_height;} quicktime_tkhd_t;typedef struct{	long seed;	long flags;	long size;	unsigned short int *alpha;	unsigned short int *red;	unsigned short int *green;	unsigned short int *blue;} quicktime_ctab_t;/* ===================== sample table ======================== // *//* sample description */typedef struct{	int motion_jpeg_quantization_table;} quicktime_mjqt_t;typedef struct{	int motion_jpeg_huffman_table;} quicktime_mjht_t;typedef struct{	uint16_t version;	uint16_t revision;	uint32_t imagingMode;	uint32_t imagingValidFlags;	uint32_t correction;	uint32_t quality;	uint32_t directdraw;	uint32_t imagingProperties[6];	uint32_t reserved1;	uint32_t reserved2;} quicktime_impn_t;typedef struct{	quicktime_impn_t impn;} quicktime_imgp_t;typedef struct{	long reserved1;	long reserved2;	int version;	int revision;		long STrack; /* Prefix 'S' == Scene */	long LowResSTrack;	uint32_t reserved3[6];	long HSTrack; /* Prefix 'HS' == HotSpot */	uint32_t reserved4[9];		float HPanStart;	float HPanEnd;	float VPanStart;	float VPanEnd;	float MinZoom;	float MaxZoom;		long SHeight;	long SWidth;	long NumFrames;	int reserved5;	int SNumFramesHeight;	int SNumFramesWidth;	int SDepth;		long HSHeight;	long HSWidth;	int reserved6;	int HSNumFramesHeight;	int HSNumFramesWidth;	int HSDepth;} quicktime_pano_t;typedef struct{	int version;	int revision;	char nodeType[4];	long locationFlags;	long locationData;	long reserved1;	long reserved2;} quicktime_nloc_t;typedef struct{	int version;	int revision;	char nodeType[4];	long nodeID;	long nameAtomID;	long commentAtomID;	long reserved1;	long reserved2;} quicktime_ndhd_t;typedef struct{	quicktime_nloc_t nloc;	int ID;} quicktime_vrni_t;typedef struct{	quicktime_vrni_t vrni[MAXNODES];	int children;} quicktime_vrnp_t;typedef struct{	int version;	int revision;	long NameAtomID;	long DefaultNodeID;	long flags;	long reserved1;	long reserved2;	} quicktime_vrsc_t;typedef struct{	quicktime_vrsc_t vrsc;	quicktime_imgp_t imgp;	quicktime_vrnp_t vrnp;} quicktime_qtvr_t;/* MPEG-4 esds (elementary stream descriptor) */typedef struct  {  int version;  long flags;  uint16_t esid;  uint8_t stream_priority;    uint8_t  objectTypeId;  uint8_t  streamType;  uint32_t bufferSizeDB;  uint32_t maxBitrate;  uint32_t avgBitrate;  int      decoderConfigLen;  uint8_t* decoderConfig;  } quicktime_esds_t;/* MPEG-4 iods */typedef struct  {  int version;  long flags;  uint16_t ObjectDescriptorID;  uint8_t  ODProfileLevel;  uint8_t  sceneProfileLevel;  uint8_t  audioProfileId;  uint8_t  videoProfileId;  uint8_t  graphicsProfileLevel;  struct    {    uint8_t ES_ID_IncTag;    uint8_t length;    uint32_t track_id;    } * tracks;  int num_tracks;  } quicktime_iods_t;/* User atoms: These can be either inside a wave atom (for audio) or   in the sample description (for video) */typedef struct  {  int num_atoms;  uint8_t ** atoms;  } quicktime_user_atoms_t;/* wave atom and subatoms */typedef struct  {  char codec[4];  /* Remainder could be a WAVEFORMATEX structure */  } quicktime_frma_t;typedef struct  {  int16_t littleEndian;  } quicktime_enda_t;typedef struct  {  quicktime_frma_t frma;  int has_frma;  quicktime_enda_t enda;  int has_enda;  quicktime_esds_t esds;  int has_esds;    quicktime_user_atoms_t user_atoms;  } quicktime_wave_t;typedef struct  {  int version;  long flags;    uint32_t mChannelLayoutTag;  uint32_t mChannelBitmap;  uint32_t mNumberChannelDescriptions;  struct    {    uint32_t mChannelLabel;    uint32_t mChannelFlags;    float    mCoordinates[3];    } * ChannelDescriptions;  } quicktime_chan_t;typedef struct  {  int fields;    /* 0, 1, or 2 */  int dominance;   /* 0 - unknown     1 - top first     2 - bottom first */  } quicktime_fiel_t;typedef struct  {  float gamma;  } quicktime_gama_t;/* Font table for MPEG-4 timed text */typedef struct  {  uint16_t num_fonts;  struct    {    uint16_t font_id;    char font_name[256];    } * fonts;  } quicktime_ftab_t;/* Sample description for Quicktime text tracks */typedef struct  {  uint32_t displayFlags;  uint32_t textJustification;  uint16_t bgColor[3];  uint16_t defaultTextBox[4];  uint32_t scrpStartChar;              /*starting character position*/  uint16_t scrpHeight;  uint16_t scrpAscent;  uint16_t scrpFont;  uint16_t scrpFace;  uint16_t scrpSize;  uint16_t scrpColor[3];  char font_name[256];  } quicktime_stsd_text_t;/* Sample description for MPEG-4 text tracks */typedef struct  {  uint32_t display_flags;  uint8_t horizontal_justification;  uint8_t vertical_justification;  uint8_t back_color[4];  uint16_t defaultTextBox[4];  uint16_t start_char_offset;  uint16_t end_char_offset;  uint16_t font_id;  uint8_t  style_flags;  uint8_t  font_size;  uint8_t  text_color[4];  int has_ftab;  quicktime_ftab_t ftab;  } quicktime_stsd_tx3g_t;/* Sample description for timecode tracks */typedef struct  {  uint32_t reserved2;  uint32_t flags;  uint32_t timescale;  uint32_t frameduration;  uint8_t numframes;// http://developer.apple.com/documentation/QuickTime/QTFF/QTFFChap3/chapter_4_section_4.html#//apple_ref/doc/uid/TP40000939-CH205-BBCGABGG  //  uint8_t reserved3[3];  // Real life  uint8_t reserved3;    char * name;  } quicktime_stsd_tmcd_t;typedef struct{	char format[4];	uint8_t reserved[6];	int data_reference;/* common to audio and video */	int version;	int revision;	char vendor[4];/* video description */	long temporal_quality;	long spatial_quality;	int width;	int height;	float dpi_horizontal;	float dpi_vertical;	int64_t data_size;	int frames_per_sample;	char compressor_name[32];	int depth;	int ctab_id;        int has_ctab;	quicktime_ctab_t ctab;        quicktime_pasp_t pasp;        int has_pasp;	quicktime_colr_t colr;	int has_colr;	quicktime_clap_t clap;        int has_clap;        quicktime_fiel_t fiel;        int has_fiel;        quicktime_gama_t gama;        int has_gama;        quicktime_pano_t pano;	quicktime_qtvr_t qtvr;        int has_wave;        quicktime_wave_t wave;/* audio description */	uint32_t channels;	uint32_t sample_size;/* Audio extension for version == 2 */        uint32_t formatSpecificFlags;        uint32_t constBytesPerAudioPacket;        uint32_t constLPCMFramesPerAudioPacket;/* LQT: We have int16_t for the compression_id, because otherwise negative   values don't show up correctly */        int16_t compression_id;	int packet_size;        double samplerate;/* Audio extension for version == 1 */        uint32_t audio_samples_per_packet;        uint32_t audio_bytes_per_packet;        uint32_t audio_bytes_per_frame;        uint32_t audio_bytes_per_sample;        quicktime_esds_t esds;        int has_esds;        quicktime_chan_t chan;        int has_chan;        quicktime_user_atoms_t user_atoms;/* LQT: We store the complete atom (starting with the fourcc)   here, because this must be passed to the Sorenson 3 decoder */        unsigned char * table_raw;        int table_raw_size;/* Quicktime text */        quicktime_stsd_text_t text;/* Quicktime tx3g */        quicktime_stsd_tx3g_t tx3g;        quicktime_stsd_tmcd_t tmcd;} quicktime_stsd_table_t;typedef struct{	int version;	long flags;	long total_entries;	quicktime_stsd_table_t *table;} quicktime_stsd_t;/* time to sample */typedef struct{

⌨️ 快捷键说明

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