From: Karthik Ramanan Date: Tue, 17 May 2016 10:54:52 +0000 (+0530) Subject: util/viddec3test: Update use of deprecated APIs and enums X-Git-Url: https://git.ti.com/gitweb?p=glsdk%2Fomapdrmtest.git;a=commitdiff_plain;h=297d748d0a97999bc562d406609ab7e80fc28cb1;hp=833f2ebb296d8555bd6d6c68290830435a3f8203 util/viddec3test: Update use of deprecated APIs and enums Signed-off-by: Karthik Ramanan --- diff --git a/util/demux.c b/util/demux.c index e932ac4..a77bbb8 100644 --- a/util/demux.c +++ b/util/demux.c @@ -84,7 +84,7 @@ static struct demux * open_stream(const char * filename, int *width, int *height AVBitStreamFilterContext *bsf = NULL; struct demux *demux; - if ((cc->codec_id != CODEC_ID_H264) && (cc->codec_id != CODEC_ID_MPEG2VIDEO) && ( cc->codec_id != CODEC_ID_MPEG4)){ + if ((cc->codec_id != AV_CODEC_ID_H264) && (cc->codec_id != AV_CODEC_ID_MPEG2VIDEO) && ( cc->codec_id != AV_CODEC_ID_MPEG4)){ ERROR("could not open '%s': unsupported codec %d", filename, cc->codec_id); return NULL; } @@ -119,7 +119,7 @@ struct demux * demux_init(const char * filename, int *width, int *height) av_register_all(); avcodec_register_all(); demux = open_stream(filename, width, height); - if ((demux != NULL) && (demux->cc->codec_id == CODEC_ID_MPEG4)) { + if ((demux != NULL) && (demux->cc->codec_id == AV_CODEC_ID_MPEG4)) { if(get_esds_offset(filename, demux)) return NULL; } @@ -230,7 +230,7 @@ int demux_rewind(struct demux *demux) void demux_deinit(struct demux *demux) { - av_close_input_file(demux->afc); + avformat_close_input(demux->afc); if (demux->bsf) av_bitstream_filter_close(demux->bsf); free(demux->esds.data); diff --git a/viddec3test.c b/viddec3test.c index 984334a..edaaf41 100644 --- a/viddec3test.c +++ b/viddec3test.c @@ -157,7 +157,7 @@ decoder_open(int argc, char **argv) /* calculate output buffer parameters: */ width = ALIGN2 (width, 4); /* round up to macroblocks */ height = ALIGN2 (height, 4); /* round up to macroblocks */ - if (decoder->demux->cc->codec_id == CODEC_ID_MPEG2VIDEO) { + if (decoder->demux->cc->codec_id == AV_CODEC_ID_MPEG2VIDEO) { padded_width = width; padded_height= height; } @@ -230,15 +230,15 @@ decoder_open(int argc, char **argv) decoder->params->numOutputDataUnits = 0; decoder->params->errorInfoMode = IVIDEO_ERRORINFO_OFF; - if (decoder->demux->cc->codec_id == CODEC_ID_MPEG2VIDEO) { + if (decoder->demux->cc->codec_id == AV_CODEC_ID_MPEG2VIDEO) { decoder->codec = VIDDEC3_create(decoder->engine, "ivahd_mpeg2vdec", decoder->params); } - else if (decoder->demux->cc->codec_id == CODEC_ID_H264) { + else if (decoder->demux->cc->codec_id == AV_CODEC_ID_H264) { decoder->codec = VIDDEC3_create(decoder->engine, "ivahd_h264dec", decoder->params); } - else if (decoder->demux->cc->codec_id == CODEC_ID_MPEG4) { + else if (decoder->demux->cc->codec_id == AV_CODEC_ID_MPEG4) { decoder->demux->first_in_buff = 1; decoder->codec = VIDDEC3_create(decoder->engine, "ivahd_mpeg4dec", decoder->params);