Mailinglist Archive: opensuse-kde3 (21 mails)

< Previous Next >
[opensuse-kde3] k3b ffmpeg 0.11-1 patch
Ilya,

Here is a patch for review for k3b. This patch updates k3b/plugins/decode/ffmpeg to be compatible with ffmpeg 0.11-1 and eliminates all deprecated warnings during compile of k3bffmpegwrapper.cpp. It needs review and testing. Since these deprecations have existed for quite some time, there may be no need for preprocessor checks as the replaced functions have been deprecated for a long time. The patch addresses all of the following:

k3bffmpegwrapper.cpp: In member function 'bool K3bFFMpegFile::open()':
k3bffmpegwrapper.cpp:82:84: error: 'av_open_input_file' was not declared in this scope
k3bffmpegwrapper.cpp:89:3: warning: 'int av_find_stream_info(AVFormatContext*)' is deprecated (declared at /usr/include/libavformat/avformat.h:1357) [-Wdeprecated-declarations]
k3bffmpegwrapper.cpp:89:41: warning: 'int av_find_stream_info(AVFormatContext*)' is deprecated (declared at /usr/include/libavformat/avformat.h:1357) [-Wdeprecated-declarations]
k3bffmpegwrapper.cpp:117:7: warning: 'int avcodec_open(AVCodecContext*, AVCodec*)' is deprecated (declared at /usr/include/libavcodec/avcodec.h:3380) [-Wdeprecated-declarations]
k3bffmpegwrapper.cpp:117:44: warning: 'int avcodec_open(AVCodecContext*, AVCodec*)' is deprecated (declared at /usr/include/libavcodec/avcodec.h:3380) [-Wdeprecated-declarations]
k3bffmpegwrapper.cpp:131:63: error: 'dump_format' was not declared in this scope
k3bffmpegwrapper.cpp: In member function 'void K3bFFMpegFile::close()':
k3bffmpegwrapper.cpp:153:5: warning: 'void av_close_input_file(AVFormatContext*)' is deprecated (declared at /usr/include/libavformat/avformat.h:1533) [-Wdeprecated-declarations]
k3bffmpegwrapper.cpp:153:43: warning: 'void av_close_input_file(AVFormatContext*)' is deprecated (declared at /usr/include/libavformat/avformat.h:1533) [-Wdeprecated-declarations]
k3bffmpegwrapper.cpp: In member function 'int
K3bFFMpegFile::fillOutputBuffer()':
k3bffmpegwrapper.cpp:318:11: warning: 'int avcodec_decode_audio3(AVCodecContext*, int16_t*, int*, AVPacket*)' is deprecated (declared at /usr/include/libavcodec/avcodec.h:3658) [-Wdeprecated-declarations]
k3bffmpegwrapper.cpp:320:14: warning: 'int avcodec_decode_audio3(AVCodecContext*, int16_t*, int*, AVPacket*)' is deprecated (declared at /usr/include/libavcodec/avcodec.h:3658) [-Wdeprecated-declarations]

HTH


--
David C. Rankin, J.D.,P.E.
--- k3b/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp
+++ k3b/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp 2012-07-25
12:40:06.485816955 -0500
@@ -1,4 +1,4 @@
-/*
+/*
*
* $Id: k3bffmpegwrapper.cpp 641819 2007-03-12 17:29:23Z trueg $
* Copyright (C) 2004-2007 Sebastian Trueg <trueg@xxxxxxx>
@@ -79,14 +79,14 @@
close();

// open the file
- int err = av_open_input_file( &d->formatContext, m_filename.local8Bit(), 0,
0, 0 );
+ int err = avformat_open_input( &d->formatContext, m_filename.local8Bit(), 0,
0);
if( err < 0 ) {
kdDebug() << "(K3bFFMpegFile) unable to open " << m_filename << " with
error " << err << endl;
return false;
}

// analyze the streams
- av_find_stream_info( d->formatContext );
+ avformat_find_stream_info( d->formatContext, NULL );

// we only handle files containing one audio stream
if( d->formatContext->nb_streams != 1 ) {
@@ -114,7 +114,7 @@

// open the codec on our context
kdDebug() << "(K3bFFMpegFile) found codec for " << m_filename << endl;
- if( avcodec_open( codecContext, d->codec ) < 0 ) {
+ if( avcodec_open2( codecContext, d->codec, NULL ) < 0 ) {
kdDebug() << "(K3bFFMpegDecoderFactory) could not open codec." << endl;
return false;
}
@@ -128,7 +128,7 @@
}

// dump some debugging info
- dump_format( d->formatContext, 0, m_filename.local8Bit(), 0 );
+ av_dump_format( d->formatContext, 0, m_filename.local8Bit(), 0 );

return true;
}
@@ -150,7 +150,7 @@
}

if( d->formatContext ) {
- av_close_input_file( d->formatContext );
+ avformat_close_input( &d->formatContext );
d->formatContext = 0;
}
}
@@ -315,8 +315,8 @@
av_init_packet( &avp );
avp.data = d->packetData;
avp.size = d->packetSize;
-int len = avcodec_decode_audio3( d->formatContext->streams[0]->codec,
- (short*)d->outputBuffer,
&d->outputBufferSize,
+int len = avcodec_decode_audio4( d->formatContext->streams[0]->codec,
+ (AVFrame*)d->outputBuffer,
&d->outputBufferSize,
&avp );
#else
#ifdef FFMPEG_BUILD_PRE_4629
< Previous Next >
This Thread
  • No further messages