comparison utils.c @ 6318:73c09e922744 libavcodec

Make avcodec_decode_* functions take const input buffers.
author michael
date Sat, 02 Feb 2008 22:54:50 +0000
parents a0a645626940
children 11a44fc273a5
comparison
equal deleted inserted replaced
6317:2f44646383c8 6318:73c09e922744
932 return ret; 932 return ret;
933 } 933 }
934 934
935 int attribute_align_arg avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture, 935 int attribute_align_arg avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
936 int *got_picture_ptr, 936 int *got_picture_ptr,
937 uint8_t *buf, int buf_size) 937 const uint8_t *buf, int buf_size)
938 { 938 {
939 int ret; 939 int ret;
940 940
941 *got_picture_ptr= 0; 941 *got_picture_ptr= 0;
942 if((avctx->coded_width||avctx->coded_height) && avcodec_check_dimensions(avctx,avctx->coded_width,avctx->coded_height)) 942 if((avctx->coded_width||avctx->coded_height) && avcodec_check_dimensions(avctx,avctx->coded_width,avctx->coded_height))
955 return ret; 955 return ret;
956 } 956 }
957 957
958 int attribute_align_arg avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples, 958 int attribute_align_arg avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples,
959 int *frame_size_ptr, 959 int *frame_size_ptr,
960 uint8_t *buf, int buf_size) 960 const uint8_t *buf, int buf_size)
961 { 961 {
962 int ret; 962 int ret;
963 963
964 if((avctx->codec->capabilities & CODEC_CAP_DELAY) || buf_size){ 964 if((avctx->codec->capabilities & CODEC_CAP_DELAY) || buf_size){
965 //FIXME remove the check below _after_ ensuring that all audio check that the available space is enough 965 //FIXME remove the check below _after_ ensuring that all audio check that the available space is enough
984 } 984 }
985 985
986 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) 986 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
987 int avcodec_decode_audio(AVCodecContext *avctx, int16_t *samples, 987 int avcodec_decode_audio(AVCodecContext *avctx, int16_t *samples,
988 int *frame_size_ptr, 988 int *frame_size_ptr,
989 uint8_t *buf, int buf_size){ 989 const uint8_t *buf, int buf_size){
990 *frame_size_ptr= AVCODEC_MAX_AUDIO_FRAME_SIZE; 990 *frame_size_ptr= AVCODEC_MAX_AUDIO_FRAME_SIZE;
991 return avcodec_decode_audio2(avctx, samples, frame_size_ptr, buf, buf_size); 991 return avcodec_decode_audio2(avctx, samples, frame_size_ptr, buf, buf_size);
992 } 992 }
993 #endif 993 #endif
994 994