00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00024 #ifndef AVCODEC_INTERNAL_H
00025 #define AVCODEC_INTERNAL_H
00026
00027 #include <stdint.h>
00028
00029 #include "libavutil/mathematics.h"
00030 #include "libavutil/pixfmt.h"
00031 #include "avcodec.h"
00032
00033 #define FF_SANE_NB_CHANNELS 128U
00034
00035 typedef struct InternalBuffer {
00036 uint8_t *base[AV_NUM_DATA_POINTERS];
00037 uint8_t *data[AV_NUM_DATA_POINTERS];
00038 int linesize[AV_NUM_DATA_POINTERS];
00039 int width;
00040 int height;
00041 enum AVPixelFormat pix_fmt;
00042 } InternalBuffer;
00043
00044 typedef struct AVCodecInternal {
00049 int buffer_count;
00050
00055 InternalBuffer *buffer;
00056
00063 int is_copy;
00064
00065 #if FF_API_OLD_DECODE_AUDIO
00066
00070 int sample_count;
00071 #endif
00072
00077 int last_audio_frame;
00078
00083 uint8_t *audio_data;
00084
00088 uint8_t *byte_buffer;
00089 unsigned int byte_buffer_size;
00090
00091 void *frame_thread_encoder;
00092
00096 int skip_samples;
00097 } AVCodecInternal;
00098
00099 struct AVCodecDefault {
00100 const uint8_t *key;
00101 const uint8_t *value;
00102 };
00103
00112 AVHWAccel *ff_find_hwaccel(enum AVCodecID codec_id, enum AVPixelFormat pix_fmt);
00113
00118 int ff_match_2uint16(const uint16_t (*tab)[2], int size, int a, int b);
00119
00120 unsigned int avpriv_toupper4(unsigned int x);
00121
00125 void ff_init_buffer_info(AVCodecContext *s, AVFrame *frame);
00126
00130 void ff_packet_free_side_data(AVPacket *pkt);
00131
00132 extern volatile int ff_avcodec_locked;
00133 int ff_lock_avcodec(AVCodecContext *log_ctx);
00134 int ff_unlock_avcodec(void);
00135
00136 int avpriv_lock_avformat(void);
00137 int avpriv_unlock_avformat(void);
00138
00144 #define FF_MAX_EXTRADATA_SIZE ((1 << 28) - FF_INPUT_BUFFER_PADDING_SIZE)
00145
00163 int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int size);
00164
00165 int ff_alloc_packet(AVPacket *avpkt, int size);
00166
00170 static av_always_inline int64_t ff_samples_to_time_base(AVCodecContext *avctx,
00171 int64_t samples)
00172 {
00173 if(samples == AV_NOPTS_VALUE)
00174 return AV_NOPTS_VALUE;
00175 return av_rescale_q(samples, (AVRational){ 1, avctx->sample_rate },
00176 avctx->time_base);
00177 }
00178
00184 int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame);
00185
00186 int ff_thread_can_start_frame(AVCodecContext *avctx);
00187
00188 int ff_get_logical_cpus(AVCodecContext *avctx);
00189
00190 int avpriv_h264_has_num_reorder_frames(AVCodecContext *avctx);
00191
00197 int ff_codec_open2_recursive(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options);
00198
00202 int ff_codec_close_recursive(AVCodecContext *avctx);
00203
00204 #endif