static int (*ff_lockmgr_cb)(void **mutex, enum AVLockOp op);
static void *codec_mutex;
-void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)
+void *av_fast_realloc(void *ptr, unsigned int *size, FF_INTERNALC_MEM_TYPE min_size)
{
if(min_size < *size)
return ptr;
return ptr;
}
-void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size)
+void av_fast_malloc(void *ptr, unsigned int *size, FF_INTERNALC_MEM_TYPE min_size)
{
void **p = ptr;
if (min_size < *size)
codec->next = NULL;
}
+#if LIBAVCODEC_VERSION_MAJOR < 53
+void register_avcodec(AVCodec *codec)
+{
+ avcodec_register(codec);
+}
+#endif
+
unsigned avcodec_get_edge_width(void)
{
return EDGE_WIDTH;
*width=FFALIGN(*width, align);
}
+#if LIBAVCODEC_VERSION_MAJOR < 53
+int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h){
+ return av_image_check_size(w, h, 0, av_log_ctx);
+}
+#endif
+
int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic){
int i;
int w= s->width;
return pts;
}
+#if FF_API_VIDEO_OLD
+int attribute_align_arg avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
+ int *got_picture_ptr,
+ const uint8_t *buf, int buf_size)
+{
+ AVPacket avpkt;
+ av_init_packet(&avpkt);
+ avpkt.data = buf;
+ avpkt.size = buf_size;
+ // HACK for CorePNG to decode as normal PNG by default
+ avpkt.flags = AV_PKT_FLAG_KEY;
+
+ return avcodec_decode_video2(avctx, picture, got_picture_ptr, &avpkt);
+}
+#endif
+
int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
int *got_picture_ptr,
AVPacket *avpkt)
return -1;
if((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size || (avctx->active_thread_type&FF_THREAD_FRAME)){
- av_packet_split_side_data(avpkt);
avctx->pkt = avpkt;
if (HAVE_PTHREADS && avctx->active_thread_type&FF_THREAD_FRAME)
ret = ff_thread_decode_frame(avctx, picture, got_picture_ptr,
return ret;
}
+#if FF_API_AUDIO_OLD
+int attribute_align_arg avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples,
+ int *frame_size_ptr,
+ const uint8_t *buf, int buf_size)
+{
+ AVPacket avpkt;
+ av_init_packet(&avpkt);
+ avpkt.data = buf;
+ avpkt.size = buf_size;
+
+ return avcodec_decode_audio3(avctx, samples, frame_size_ptr, &avpkt);
+}
+#endif
+
int attribute_align_arg avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples,
int *frame_size_ptr,
AVPacket *avpkt)
return ret;
}
+#if FF_API_SUBTITLE_OLD
+int avcodec_decode_subtitle(AVCodecContext *avctx, AVSubtitle *sub,
+ int *got_sub_ptr,
+ const uint8_t *buf, int buf_size)
+{
+ AVPacket avpkt;
+ av_init_packet(&avpkt);
+ avpkt.data = buf;
+ avpkt.size = buf_size;
+
+ return avcodec_decode_subtitle2(avctx, sub, got_sub_ptr, &avpkt);
+}
+#endif
+
int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
int *got_sub_ptr,
AVPacket *avpkt)
return n;
}
+#if LIBAVCODEC_VERSION_MAJOR < 53
+#include "libavutil/parseutils.h"
+
+int av_parse_video_frame_size(int *width_ptr, int *height_ptr, const char *str)
+{
+ return av_parse_video_size(width_ptr, height_ptr, str);
+}
+
+int av_parse_video_frame_rate(AVRational *frame_rate, const char *arg)
+{
+ return av_parse_video_rate(frame_rate, arg);
+}
+#endif
+
int ff_match_2uint16(const uint16_t (*tab)[2], int size, int a, int b){
int i;
for(i=0; i<size && !(tab[i][0]==a && tab[i][1]==b); i++);
s->thread_count = thread_count;
return ff_thread_init(s);
}
+
+void avcodec_thread_free(AVCodecContext *s)
+{
+#if HAVE_THREADS
+ ff_thread_free(s);
+#endif
+}
+
#endif