Remove too old __MMFILE_FFMPEG_V100__ and related code. because __MMFILE_FFMPEG_V100_... 37/139737/1
authorHaejeong Kim <backto.kim@samsung.com>
Thu, 20 Jul 2017 08:29:11 +0000 (17:29 +0900)
committerHaejeong Kim <backto.kim@samsung.com>
Thu, 20 Jul 2017 08:29:11 +0000 (17:29 +0900)
Change-Id: I34f40f317d3b246ba83573b2200435cfcf595c63

formats/ffmpeg/Makefile.am
formats/ffmpeg/mm_file_format_ffmpeg.c
formats/ffmpeg/mm_file_format_frame.c

index f6e4fed..17cdc34 100755 (executable)
@@ -62,6 +62,5 @@ libmmfile_formats_la_LIBADD = $(MMCOMMON_LIBS) \
 libmmfile_formats_la_CFLAGS += $(DLOG_CFLAGS)
 libmmfile_formats_la_LIBADD += $(DLOG_LIBS)
 
-libmmfile_formats_la_CFLAGS += -D__MMFILE_FFMPEG_V100__
 libmmfile_formats_la_CFLAGS += -D__MMFILE_FFMPEG_V085__
 libmmfile_formats_la_CFLAGS += -D__MMFILE_LIBAV_VERSION__=11.4
index d7306e0..960397c 100755 (executable)
@@ -250,14 +250,11 @@ int mmfile_format_read_stream_ffmpg(MMFileFormatContext *formatContext)
         *@important if data is corrupted, occur segment fault by av_find_stream_info().
         *                      - fixed 2009-06-25.
         */
-#ifdef __MMFILE_FFMPEG_V100__
        if (formatContext->cdis != 1)
                ret = avformat_find_stream_info(pFormatCtx, NULL);
        else
                ret = 0;
-#else
-       ret = av_find_stream_info(pFormatCtx);
-#endif
+
        if (ret < 0) {
                debug_warning(DEBUG, "failed to find stream info. errcode = %d\n", ret);
                goto exception;
@@ -394,11 +391,7 @@ exception:
        }
 
        if (pFormatCtx) {
-#ifdef __MMFILE_FFMPEG_V100__
                avformat_close_input(&pFormatCtx);
-#else
-               av_close_input_file(pFormatCtx);
-#endif
                formatContext->privateFormatData = NULL;
        }
 
@@ -691,16 +684,13 @@ int mmfile_format_read_frame_ffmpg(MMFileFormatContext *formatContext, unsigned
 
                /*set workaround bug flag*/
                pVideoCodecCtx->workaround_bugs = FF_BUG_AUTODETECT;
-#ifdef __MMFILE_FFMPEG_V100__
+
                /* this is solution for PLM issue P13091703323 */
                /* If using thread when decoding frame, the result of decoding is not always same.
                    Thumbnail of video content is different with original file when copying file. */
                pVideoCodecCtx->thread_type = 0;
                pVideoCodecCtx->thread_count = 0;
                ret = avcodec_open2(pVideoCodecCtx, pVideoCodec, NULL);
-#else
-               ret = avcodec_open(pVideoCodecCtx, pVideoCodec);
-#endif
                if (ret < 0) {
                        debug_error(DEBUG, "error: avcodec_open fail.\n");
                        return MMFILE_FORMAT_FAIL;
@@ -824,11 +814,7 @@ int mmfile_format_close_ffmpg(MMFileFormatContext *formatContext)
                AVFormatContext *pFormatCtx = formatContext->privateFormatData;
 
                if (pFormatCtx) {
-#ifdef __MMFILE_FFMPEG_V100__
                        avformat_close_input(&pFormatCtx);
-#else
-                       av_close_input_file(pFormatCtx);
-#endif
                        formatContext->privateFormatData = NULL;
                }
 
index 6d44449..df04a1c 100755 (executable)
@@ -248,11 +248,7 @@ static int __mmfile_get_frame(AVFormatContext *pFormatCtx, double timestamp, boo
        AVPacket packet;
 
        /* Retrieve stream information */
-#ifdef __MMFILE_FFMPEG_V100__
        if (avformat_find_stream_info(pFormatCtx, NULL) < 0) {
-#else
-       if (av_find_stream_info(pFormatCtx) < 0) {
-#endif
                debug_error(DEBUG, "error : av_find_stream_info failed");
                ret = MMFILE_FORMAT_FAIL;
                goto exception; /* Couldn't find stream information */
@@ -289,13 +285,9 @@ static int __mmfile_get_frame(AVFormatContext *pFormatCtx, double timestamp, boo
        }
 
        /* Open codec */
-#ifdef __MMFILE_FFMPEG_V100__
        pVideoCodecCtx->thread_type = 0;
        pVideoCodecCtx->thread_count = 0;
        if (avcodec_open2(pVideoCodecCtx, pVideoCodec, NULL) < 0) {
-#else
-       if (avcodec_open(pVideoCodecCtx, pVideoCodec) < 0) {
-#endif
                debug_error(DEBUG, "error : avcodec_open failed");
                ret = MMFILE_FORMAT_FAIL;
                goto exception;; /*Could not open codec */