util/viddec3test: Update use of deprecated APIs and enums
authorKarthik Ramanan <a0393906@ti.com>
Tue, 17 May 2016 10:54:52 +0000 (16:24 +0530)
committerKarthik Ramanan <a0393906@ti.com>
Tue, 17 May 2016 10:54:52 +0000 (16:24 +0530)
Signed-off-by: Karthik Ramanan <a0393906@ti.com>
util/demux.c
viddec3test.c

index e932ac4e2364df41ae4ecf89c84ba110ab0fdf28..a77bbb8746ceed6e9fe571928bd4f56ba5c4bd1d 100644 (file)
@@ -84,7 +84,7 @@ static struct demux * open_stream(const char * filename, int *width, int *height
        AVBitStreamFilterContext *bsf = NULL;
        struct demux *demux;
 
        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;
        }
                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);
        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;
        }
                if(get_esds_offset(filename, demux))
                        return NULL;
        }
@@ -230,7 +230,7 @@ int demux_rewind(struct demux *demux)
 
 void demux_deinit(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);
        if (demux->bsf)
                av_bitstream_filter_close(demux->bsf);
        free(demux->esds.data);
index 984334a771d201e9f53a61140a1563eaac8eebfb..edaaf41775c7712043b93abcff17aa063e2640e3 100644 (file)
@@ -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 */
                /* 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;
                }
                        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;
 
        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);
         }
             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);
         }
             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);
                decoder->demux->first_in_buff = 1;
                decoder->codec = VIDDEC3_create(decoder->engine,
                                         "ivahd_mpeg4dec", decoder->params);