6 // This must be separate from qtprivate.h to keep everyone from
7 // depending on avcodec.h
8 // FFMPEG front end for quicktime.
9 // Getting ffmpeg to do all the things it needs to do is so labor
10 // intensive, we have a front end for the ffmpeg front end.
13 // This front end is bastardized to support alternating fields with
14 // alternating ffmpeg instances. It drastically reduces the bitrate
15 // required to store interlaced video but nothing can read it but
20 #include "libavformat/avformat.h"
21 #include "libavcodec/avcodec.h"
22 #include "qtprivate.h"
30 AVCodec *encoder[FIELDS];
31 AVCodecContext *encoder_context[FIELDS];
35 AVCodec *decoder[FIELDS];
36 AVCodecContext *decoder_context[FIELDS];
37 AVFrame picture[FIELDS];
40 int64_t last_frame[FIELDS];
44 // Original dimensions
50 // Temporary storage for color conversions
52 // Storage of compressed data
53 unsigned char *work_buffer;
54 // Allocation of work_buffer
59 extern int ffmpeg_initialized;
60 extern pthread_mutex_t ffmpeg_lock;
63 quicktime_ffmpeg_t *quicktime_new_ffmpeg(int cpus,
64 int fields,int ffmpeg_id, int w,int h,
65 quicktime_stsd_table_t *stsd_table); // FFmpeg needs this for the header
66 void quicktime_delete_ffmpeg(quicktime_ffmpeg_t *ptr);
67 int quicktime_ffmpeg_decode(quicktime_ffmpeg_t *ffmpeg,
68 quicktime_t *file, unsigned char **row_pointers, int track);
70 int quicktime_decode_audio3(
71 AVCodecContext *avctx, int16_t *samples,
72 int *frame_size_ptr, AVPacket *avpkt);