diff options
author | Anssi Hannula <anssi@xbmc.org> | 2011-02-01 23:02:31 +0200 |
---|---|---|
committer | Anssi Hannula <anssi@xbmc.org> | 2011-02-03 00:03:03 +0200 |
commit | 773159bea90303826ad21e061e95793efddcff44 (patch) | |
tree | 6b7171be78d562ab3b82331c8b92c91dbced488d /lib/DllAvCodec.h | |
parent | e227b817a90c65ee8a42b31940689edd25ea3744 (diff) |
changed: use the new ffmpeg decoding functions
The old ones were deprecated on 2009-04-07.
Diffstat (limited to 'lib/DllAvCodec.h')
-rw-r--r-- | lib/DllAvCodec.h | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/lib/DllAvCodec.h b/lib/DllAvCodec.h index f286647004..da28c05f0e 100644 --- a/lib/DllAvCodec.h +++ b/lib/DllAvCodec.h @@ -96,9 +96,9 @@ public: virtual int avcodec_close_dont_call(AVCodecContext *avctx)=0; virtual AVFrame *avcodec_alloc_frame(void)=0; virtual int avpicture_fill(AVPicture *picture, uint8_t *ptr, PixelFormat pix_fmt, int width, int height)=0; - virtual int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, uint8_t *buf, int buf_size)=0; - virtual int avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples, int *frame_size_ptr, uint8_t *buf, int buf_size)=0; - virtual int avcodec_decode_subtitle(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, const uint8_t *buf, int buf_size)=0; + virtual int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, AVPacket *avpkt)=0; + virtual int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples, int *frame_size_ptr, AVPacket *avpkt)=0; + virtual int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, AVPacket *avpkt)=0; virtual int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size, const short *samples)=0; virtual int avpicture_get_size(PixelFormat pix_fmt, int width, int height)=0; virtual AVCodecContext *avcodec_alloc_context(void)=0; @@ -164,9 +164,16 @@ public: } virtual AVFrame *avcodec_alloc_frame() { return ::avcodec_alloc_frame(); } virtual int avpicture_fill(AVPicture *picture, uint8_t *ptr, PixelFormat pix_fmt, int width, int height) { return ::avpicture_fill(picture, ptr, pix_fmt, width, height); } - virtual int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, uint8_t *buf, int buf_size) { return ::avcodec_decode_video(avctx, picture, got_picture_ptr, buf, buf_size); } - virtual int avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples, int *frame_size_ptr, uint8_t *buf, int buf_size) { return ::avcodec_decode_audio2(avctx, samples, frame_size_ptr, buf, buf_size); } - virtual int avcodec_decode_subtitle(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, const uint8_t *buf, int buf_size) { return ::avcodec_decode_subtitle(avctx, sub, got_sub_ptr, buf, buf_size); } +#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52,23,0) + // API added on: 2009-04-07 + virtual int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, AVPacket *avpkt) { return ::avcodec_decode_video2(avctx, picture, got_picture_ptr, avpkt); } + virtual int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples, int *frame_size_ptr, AVPacket *avpkt) { return ::avcodec_decode_audio3(avctx, samples, frame_size_ptr, avpkt); } + virtual int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, AVPacket *avpkt) { return ::avcodec_decode_subtitle2(avctx, sub, got_sub_ptr, avpkt); } +#else + virtual int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, AVPacket *avpkt) { return ::avcodec_decode_video(avctx, picture, got_picture_ptr, avpkt->data, avpkt->size); } + virtual int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples, int *frame_size_ptr, AVPacket *avpkt) { return ::avcodec_decode_audio2(avctx, samples, frame_size_ptr, avpkt->data, avpkt->size); } + virtual int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, AVPacket *avpkt) { return ::avcodec_decode_subtitle(avctx, sub, got_sub_ptr, avpkt->data, avpkt->size); } +#endif virtual int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size, const short *samples) { return ::avcodec_encode_audio(avctx, buf, buf_size, samples); } virtual int avpicture_get_size(PixelFormat pix_fmt, int width, int height) { return ::avpicture_get_size(pix_fmt, width, height); } virtual AVCodecContext *avcodec_alloc_context() { return ::avcodec_alloc_context(); } @@ -221,9 +228,9 @@ class DllAvCodec : public DllDynamic, DllAvCodecInterface #ifndef _LINUX DEFINE_FUNC_ALIGNED1(void, __cdecl, avcodec_flush_buffers, AVCodecContext*) DEFINE_FUNC_ALIGNED2(int, __cdecl, avcodec_open_dont_call, AVCodecContext*, AVCodec *) - DEFINE_FUNC_ALIGNED5(int, __cdecl, avcodec_decode_video, AVCodecContext*, AVFrame*, int*, uint8_t*, int) - DEFINE_FUNC_ALIGNED5(int, __cdecl, avcodec_decode_audio2, AVCodecContext*, int16_t*, int*, uint8_t*, int) - DEFINE_FUNC_ALIGNED5(int, __cdecl, avcodec_decode_subtitle, AVCodecContext*, AVSubtitle*, int*, const uint8_t *, int) + DEFINE_FUNC_ALIGNED4(int, __cdecl, avcodec_decode_video2, AVCodecContext*, AVFrame*, int*, AVPacket*) + DEFINE_FUNC_ALIGNED4(int, __cdecl, avcodec_decode_audio3, AVCodecContext*, int16_t*, int*, AVPacket*) + DEFINE_FUNC_ALIGNED4(int, __cdecl, avcodec_decode_subtitle2, AVCodecContext*, AVSubtitle*, int*, AVPacket*) DEFINE_FUNC_ALIGNED4(int, __cdecl, avcodec_encode_audio, AVCodecContext*, uint8_t*, int, const short*) DEFINE_FUNC_ALIGNED0(AVCodecContext*, __cdecl, avcodec_alloc_context) DEFINE_FUNC_ALIGNED1(AVCodecParserContext*, __cdecl, av_parser_init, int) @@ -231,9 +238,9 @@ class DllAvCodec : public DllDynamic, DllAvCodecInterface #else DEFINE_METHOD1(void, avcodec_flush_buffers, (AVCodecContext* p1)) DEFINE_METHOD2(int, avcodec_open_dont_call, (AVCodecContext* p1, AVCodec *p2)) - DEFINE_METHOD5(int, avcodec_decode_video, (AVCodecContext* p1, AVFrame *p2, int *p3, uint8_t *p4, int p5)) - DEFINE_METHOD5(int, avcodec_decode_audio2, (AVCodecContext* p1, int16_t *p2, int *p3, uint8_t *p4, int p5)) - DEFINE_METHOD5(int, avcodec_decode_subtitle, (AVCodecContext* p1, AVSubtitle *p2, int *p3, const uint8_t *p4, int p5)) + DEFINE_METHOD4(int, avcodec_decode_video2, (AVCodecContext* p1, AVFrame *p2, int *p3, AVPacket *p4)) + DEFINE_METHOD4(int, avcodec_decode_audio3, (AVCodecContext* p1, int16_t *p2, int *p3, AVPacket *p4)) + DEFINE_METHOD4(int, avcodec_decode_subtitle2, (AVCodecContext* p1, AVSubtitle *p2, int *p3, AVPacket *p4)) DEFINE_METHOD4(int, avcodec_encode_audio, (AVCodecContext* p1, uint8_t *p2, int p3, const short *p4)) DEFINE_METHOD0(AVCodecContext*, avcodec_alloc_context) DEFINE_METHOD1(AVCodecParserContext*, av_parser_init, (int p1)) @@ -282,9 +289,9 @@ class DllAvCodec : public DllDynamic, DllAvCodecInterface RESOLVE_METHOD(avcodec_alloc_frame) RESOLVE_METHOD_RENAME(avcodec_register_all, avcodec_register_all_dont_call) RESOLVE_METHOD(avpicture_fill) - RESOLVE_METHOD(avcodec_decode_video) - RESOLVE_METHOD(avcodec_decode_audio2) - RESOLVE_METHOD(avcodec_decode_subtitle) + RESOLVE_METHOD(avcodec_decode_video2) + RESOLVE_METHOD(avcodec_decode_audio3) + RESOLVE_METHOD(avcodec_decode_subtitle2) RESOLVE_METHOD(avcodec_encode_audio) RESOLVE_METHOD(avpicture_get_size) RESOLVE_METHOD(avcodec_alloc_context) |