00001 #ifndef QTFFMPEG_H 00002 #define QTFFMPEG_H 00003 00004 00005 00006 // This must be separate from qtprivate.h to keep everyone from 00007 // depending on avcodec.h 00008 // FFMPEG front end for quicktime. 00009 // Getting ffmpeg to do all the things it needs to do is so labor 00010 // intensive, we have a front end for the ffmpeg front end. 00011 00012 00013 // This front end is bastardized to support alternating fields with 00014 // alternating ffmpeg instances. It drastically reduces the bitrate 00015 // required to store interlaced video but nothing can read it but 00016 // Heroine Virtual. 00017 00018 00019 00020 #include "avcodec.h" 00021 #include "qtprivate.h" 00022 00023 00024 00025 typedef struct 00026 { 00027 #define FIELDS 2 00028 // Encoding 00029 AVCodec *encoder[FIELDS]; 00030 AVCodecContext *encoder_context[FIELDS]; 00031 00032 00033 // Decoding 00034 AVCodec *decoder[FIELDS]; 00035 AVCodecContext *decoder_context[FIELDS]; 00036 AVFrame picture[FIELDS]; 00037 00038 // Last frame decoded 00039 int64_t last_frame[FIELDS]; 00040 // Rounded dimensions 00041 int width_i; 00042 int height_i; 00043 // Original dimensions 00044 int width; 00045 int height; 00046 int fields; 00047 00048 00049 // Temporary storage for color conversions 00050 char *temp_frame; 00051 // Storage of compressed data 00052 unsigned char *work_buffer; 00053 // Allocation of work_buffer 00054 int buffer_size; 00055 int ffmpeg_id; 00056 } quicktime_ffmpeg_t; 00057 00058 extern int ffmpeg_initialized; 00059 extern pthread_mutex_t ffmpeg_lock; 00060 00061 00062 quicktime_ffmpeg_t* quicktime_new_ffmpeg( 00063 int cpus, 00064 int fields, 00065 int ffmpeg_id, 00066 int w, 00067 int h, 00068 // FFmpeg needs this for the header 00069 quicktime_stsd_table_t *stsd_table); 00070 void quicktime_delete_ffmpeg(quicktime_ffmpeg_t *ptr); 00071 int quicktime_ffmpeg_decode(quicktime_ffmpeg_t *ffmpeg, 00072 quicktime_t *file, 00073 unsigned char **row_pointers, 00074 int track); 00075 00076 00077 00078 #endif 00079 00080 00081 00082 00083 00084 00085
1.5.5