Skip to content
Browse files

Make it all compile...

  • Loading branch information...
1 parent 940dd94 commit 6c3653cd378aacef10b7706d8b7f71beae41274c @Beirdo Beirdo committed Apr 2, 2012
Showing with 500 additions and 401 deletions.
  1. +8 −9 mythplugins/mytharchive/mytharchive/thumbfinder.cpp
  2. +18 −18 mythplugins/mytharchive/mytharchivehelper/main.cpp
  3. +36 −27 mythplugins/mythmusic/mythmusic/avfdecoder.cpp
  4. +1 −2 mythplugins/mythmusic/mythmusic/avfdecoder.h
  5. +3 −1 mythplugins/mythmusic/mythmusic/cddecoder.cpp
  6. +14 −16 mythplugins/mythmusic/mythmusic/metaioavfcomment.cpp
  7. +12 −14 mythplugins/mythmusic/mythmusic/metaiomp4.cpp
  8. +5 −5 mythplugins/mythmusic/mythmusic/musicutils.cpp
  9. +37 −19 mythtv/configure
  10. +1 −0 mythtv/external/.gitignore
  11. +11 −11 mythtv/external/FFmpeg/Makefile
  12. +4 −0 mythtv/external/FFmpeg/README.sync
  13. +4 −2 mythtv/external/FFmpeg/common.mak
  14. +1 −1 mythtv/external/FFmpeg/libavcodec/aaclatmdec.c
  15. +5 −3 mythtv/external/FFmpeg/libavcodec/avcodec.h
  16. +1 −1 mythtv/external/FFmpeg/libavcodec/golomb.h
  17. +5 −0 mythtv/external/FFmpeg/libavcodec/libavcodec.v
  18. +1 −1 mythtv/external/FFmpeg/libavcodec/mpegvideo.h
  19. +2 −0 mythtv/external/FFmpeg/libavformat/libavformat.v
  20. +4 −4 mythtv/external/FFmpeg/libavformat/mpegts.c
  21. +5 −0 mythtv/external/FFmpeg/libavformat/utils.c
  22. +6 −4 mythtv/external/FFmpeg/library.mak
  23. +1 −1 mythtv/filters/adjust/filter_adjust.c
  24. +1 −1 mythtv/filters/crop/filter_crop.c
  25. +3 −3 mythtv/filters/denoise3d/filter_denoise3d.c
  26. +1 −1 mythtv/filters/greedyhdeint/color.c
  27. +3 −3 mythtv/filters/greedyhdeint/filter_greedyhdeint.c
  28. +2 −2 mythtv/filters/kerneldeint/filter_kerneldeint.c
  29. +9 −5 mythtv/filters/linearblend/filter_linearblend.c
  30. +4 −4 mythtv/filters/postprocess/filter_postprocess.c
  31. +1 −1 mythtv/filters/quickdnr/filter_quickdnr.c
  32. +5 −5 mythtv/filters/yadif/filter_yadif.c
  33. +0 −1 mythtv/libs/libmyth/audio/audiooutputdigitalencoder.cpp
  34. +13 −24 mythtv/libs/libmyth/audio/spdifencoder.cpp
  35. +0 −1 mythtv/libs/libmyth/audio/spdifencoder.h
  36. +5 −4 mythtv/libs/libmythfreesurround/el_processor.cpp
  37. +5 −7 mythtv/libs/libmythtv/NuppelVideoRecorder.cpp
  38. +104 −88 mythtv/libs/libmythtv/avformatdecoder.cpp
  39. +1 −1 mythtv/libs/libmythtv/avformatdecoder.h
  40. +71 −43 mythtv/libs/libmythtv/avformatwriter.cpp
  41. +2 −0 mythtv/libs/libmythtv/avformatwriter.h
  42. +12 −4 mythtv/libs/libmythtv/avfringbuffer.cpp
  43. +1 −0 mythtv/libs/libmythtv/avfringbuffer.h
  44. +4 −3 mythtv/libs/libmythtv/dtvrecorder.cpp
  45. +2 −2 mythtv/libs/libmythtv/mhi.cpp
  46. +2 −6 mythtv/libs/libmythtv/mpeg/H264Parser.cpp
  47. +1 −0 mythtv/libs/libmythtv/mythplayer.cpp
  48. +21 −19 mythtv/libs/libmythtv/nuppeldecoder.cpp
  49. +2 −0 mythtv/libs/libmythtv/recorderbase.cpp
  50. +3 −1 mythtv/libs/libmythtv/signalmonitor.cpp
  51. +6 −5 mythtv/libs/libmythtv/streamingringbuffer.cpp
  52. +1 −0 mythtv/libs/libmythtv/streamingringbuffer.h
  53. +2 −2 mythtv/programs/mythtranscode/helper.c
  54. +21 −19 mythtv/programs/mythtranscode/mpeg2fix.cpp
  55. +6 −6 mythtv/programs/mythutil/mpegutils.cpp
  56. +1 −1 mythtv/programs/programs-libs.pro
View
17 mythplugins/mytharchive/mytharchive/thumbfinder.cpp
@@ -564,8 +564,7 @@ bool ThumbFinder::initAVCodec(const QString &inFile)
QByteArray inFileBA = inFile.toLocal8Bit();
- int ret = av_open_input_file(
- &m_inputFC, inFileBA.constData(), NULL, 0, NULL);
+ int ret = avformat_open_input(&m_inputFC, inFileBA.constData(), NULL, NULL);
if (ret)
{
@@ -574,11 +573,11 @@ bool ThumbFinder::initAVCodec(const QString &inFile)
}
// Getting stream information
- if ((ret = av_find_stream_info(m_inputFC)) < 0)
+ if ((ret = avformat_find_stream_info(m_inputFC, NULL)) < 0)
{
LOG(VB_GENERAL, LOG_ERR,
QString("Couldn't get stream info, error #%1").arg(ret));
- av_close_input_file(m_inputFC);
+ avformat_close_input(&m_inputFC);
m_inputFC = NULL;
return false;
}
@@ -591,7 +590,7 @@ bool ThumbFinder::initAVCodec(const QString &inFile)
for (uint i = 0; i < m_inputFC->nb_streams; i++)
{
AVStream *st = m_inputFC->streams[i];
- if (m_inputFC->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO)
+ if (m_inputFC->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO)
{
m_startTime = -1;
if (m_inputFC->streams[i]->start_time != (int) AV_NOPTS_VALUE)
@@ -630,7 +629,7 @@ bool ThumbFinder::initAVCodec(const QString &inFile)
m_codecCtx->skip_frame = AVDISCARD_DEFAULT;
m_codecCtx->skip_idct = AVDISCARD_DEFAULT;
m_codecCtx->skip_loop_filter = AVDISCARD_DEFAULT;
- m_codecCtx->error_recognition = FF_ER_CAREFUL;
+ m_codecCtx->err_recognition = AV_EF_CAREFUL;
m_codecCtx->error_concealment = 3;
// get decoder for video stream
@@ -644,7 +643,7 @@ bool ThumbFinder::initAVCodec(const QString &inFile)
}
// open codec
- if (avcodec_open(m_codecCtx, m_codec) < 0)
+ if (avcodec_open2(m_codecCtx, m_codec, NULL) < 0)
{
LOG(VB_GENERAL, LOG_ERR,
"ThumbFinder: Couldn't open codec for video stream");
@@ -839,7 +838,7 @@ bool ThumbFinder::getFrameImage(bool needKeyFrame, int64_t requiredPTS)
{
frameCount++;
- keyFrame = pkt.flags & PKT_FLAG_KEY;
+ keyFrame = pkt.flags & AV_PKT_FLAG_KEY;
if (m_startPTS == -1 && pkt.dts != (int64_t)AV_NOPTS_VALUE)
{
@@ -923,7 +922,7 @@ void ThumbFinder::closeAVCodec()
avcodec_close(m_codecCtx);
// close the video file
- av_close_input_file(m_inputFC);
+ avformat_close_input(&m_inputFC);
}
void ThumbFinder::showMenu()
View
36 mythplugins/mytharchive/mytharchivehelper/main.cpp
@@ -1849,7 +1849,7 @@ static int grabThumbnail(QString inFile, QString thumbList, QString outFile, int
QByteArray inFileBA = inFile.toLocal8Bit();
- int ret = av_open_input_file(&inputFC, inFileBA.constData(), NULL, 0, NULL);
+ int ret = avformat_open_input(&inputFC, inFileBA.constData(), NULL, NULL);
if (ret)
{
LOG(VB_JOBQUEUE, LOG_ERR, "grabThumbnail(): Couldn't open input file" +
@@ -1858,11 +1858,11 @@ static int grabThumbnail(QString inFile, QString thumbList, QString outFile, int
}
// Getting stream information
- if ((ret = av_find_stream_info(inputFC)) < 0)
+ if ((ret = avformat_find_stream_info(inputFC, NULL)) < 0)
{
LOG(VB_JOBQUEUE, LOG_ERR,
QString("Couldn't get stream info, error #%1").arg(ret));
- av_close_input_file(inputFC);
+ avformat_close_input(&inputFC);
inputFC = NULL;
return 1;
}
@@ -1874,7 +1874,7 @@ static int grabThumbnail(QString inFile, QString thumbList, QString outFile, int
for (uint i = 0; i < inputFC->nb_streams; i++)
{
AVStream *st = inputFC->streams[i];
- if (inputFC->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO)
+ if (inputFC->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO)
{
videostream = i;
width = st->codec->width;
@@ -1906,7 +1906,7 @@ static int grabThumbnail(QString inFile, QString thumbList, QString outFile, int
}
// open codec
- if (avcodec_open(codecCtx, codec) < 0)
+ if (avcodec_open2(codecCtx, codec, NULL) < 0)
{
LOG(VB_JOBQUEUE, LOG_ERR, "Couldn't open codec for video stream");
return 1;
@@ -2036,7 +2036,7 @@ static int grabThumbnail(QString inFile, QString thumbList, QString outFile, int
avcodec_close(codecCtx);
// close the video file
- av_close_input_file(inputFC);
+ avformat_close_input(&inputFC);
return 0;
}
@@ -2195,7 +2195,7 @@ static int getFileInfo(QString inFile, QString outFile, int lenMethod)
QByteArray inFileBA = inFile.toLocal8Bit();
- int ret = av_open_input_file(&inputFC, inFileBA.constData(), fmt, 0, NULL);
+ int ret = avformat_open_input(&inputFC, inFileBA.constData(), fmt, NULL);
if (ret)
{
@@ -2205,13 +2205,13 @@ static int getFileInfo(QString inFile, QString outFile, int lenMethod)
}
// Getting stream information
- ret = av_find_stream_info(inputFC);
+ ret = avformat_find_stream_info(inputFC, NULL);
if (ret < 0)
{
LOG(VB_JOBQUEUE, LOG_ERR,
QString("Couldn't get stream info, error #%1").arg(ret));
- av_close_input_file(inputFC);
+ avformat_close_input(&inputFC);
inputFC = NULL;
return 1;
}
@@ -2244,7 +2244,7 @@ static int getFileInfo(QString inFile, QString outFile, int lenMethod)
switch (inputFC->streams[i]->codec->codec_type)
{
- case CODEC_TYPE_VIDEO:
+ case AVMEDIA_TYPE_VIDEO:
{
QStringList param = QString(buf).split(',', QString::SkipEmptyParts);
QString codec = param[0].remove("Video:", Qt::CaseInsensitive);
@@ -2358,7 +2358,7 @@ static int getFileInfo(QString inFile, QString outFile, int lenMethod)
break;
}
- case CODEC_TYPE_AUDIO:
+ case AVMEDIA_TYPE_AUDIO:
{
QStringList param = QString(buf).split(',', QString::SkipEmptyParts);
QString codec = param[0].remove("Audio:", Qt::CaseInsensitive);
@@ -2376,8 +2376,8 @@ static int getFileInfo(QString inFile, QString outFile, int lenMethod)
stream.setAttribute("channels", st->codec->channels);
- AVMetadataTag *metatag =
- av_metadata_get(st->metadata, "language", NULL, 0);
+ AVDictionaryEntry *metatag =
+ av_dict_get(st->metadata, "language", NULL, 0);
if (metatag)
stream.setAttribute("language", metatag->value);
else
@@ -2404,7 +2404,7 @@ static int getFileInfo(QString inFile, QString outFile, int lenMethod)
break;
}
- case CODEC_TYPE_SUBTITLE:
+ case AVMEDIA_TYPE_SUBTITLE:
{
QStringList param = QString(buf).split(',', QString::SkipEmptyParts);
QString codec = param[0].remove("Subtitle:", Qt::CaseInsensitive);
@@ -2414,8 +2414,8 @@ static int getFileInfo(QString inFile, QString outFile, int lenMethod)
stream.setAttribute("ffmpegindex", ffmpegIndex++);
stream.setAttribute("codec", codec.trimmed());
- AVMetadataTag *metatag =
- av_metadata_get(st->metadata, "language", NULL, 0);
+ AVDictionaryEntry *metatag =
+ av_dict_get(st->metadata, "language", NULL, 0);
if (metatag)
stream.setAttribute("language", metatag->value);
else
@@ -2428,7 +2428,7 @@ static int getFileInfo(QString inFile, QString outFile, int lenMethod)
break;
}
- case CODEC_TYPE_DATA:
+ case AVMEDIA_TYPE_DATA:
{
QDomElement stream = doc.createElement("data");
stream.setAttribute("streamindex", i);
@@ -2460,7 +2460,7 @@ static int getFileInfo(QString inFile, QString outFile, int lenMethod)
f.close();
// Close input file
- av_close_input_file(inputFC);
+ avformat_close_input(&inputFC);
inputFC = NULL;
return 0;
View
63 mythplugins/mythmusic/mythmusic/avfdecoder.cpp
@@ -40,6 +40,10 @@ using namespace std;
#include "metaiomp4.h"
#include "metaiowavpack.h"
+extern "C" {
+#include "libavformat/avio.h"
+}
+
// size of the buffer used for streaming
#define BUFFER_SIZE 8192
@@ -89,7 +93,6 @@ avfDecoder::avfDecoder(const QString &file, DecoderFactory *d, QIODevice *i,
{
setObjectName("avfDecoder");
setFilename(file);
- memset(&m_params, 0, sizeof(AVFormatParameters));
}
avfDecoder::~avfDecoder(void)
@@ -154,11 +157,11 @@ bool avfDecoder::initialize()
// if the input is not a file then setup the buffer
// and iocontext to stream from it
m_buffer = (unsigned char*) av_malloc(BUFFER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
- m_byteIOContext = new ByteIOContext;
- init_put_byte(m_byteIOContext, m_buffer, BUFFER_SIZE, 0, input(), &ReadFunc, &WriteFunc, &SeekFunc);
+ m_byteIOContext = avio_alloc_context(m_buffer, BUFFER_SIZE, 0, input(),
+ &ReadFunc, &WriteFunc, &SeekFunc);
filename = "stream";
- m_byteIOContext->is_streamed = 1;
+ m_byteIOContext->seekable = 0;
// probe the stream
AVProbeData probe_data;
@@ -199,11 +202,15 @@ bool avfDecoder::initialize()
// this should populate the input context
int err;
if (m_inputIsFile)
- err = av_open_input_file(&m_inputContext, filename.toLocal8Bit().constData(),
- m_inputFormat, 0, &m_params);
+ err = avformat_open_input(&m_inputContext,
+ filename.toLocal8Bit().constData(),
+ m_inputFormat, NULL);
else
- err = av_open_input_stream(&m_inputContext, m_byteIOContext, "decoder",
- m_inputFormat, &m_params);
+ {
+ m_inputContext->pb = m_byteIOContext;
+ err = avformat_open_input(&m_inputContext, "decoder",
+ m_inputFormat, NULL);
+ }
if (err < 0)
{
@@ -218,7 +225,7 @@ bool avfDecoder::initialize()
// determine the stream format
// this also populates information needed for metadata
- if (av_find_stream_info(m_inputContext) < 0)
+ if (avformat_find_stream_info(m_inputContext, NULL) < 0)
{
error("Could not determine the stream format.");
deinit();
@@ -244,9 +251,10 @@ bool avfDecoder::initialize()
return false;
}
- if (avcodec_open(m_audioDec,m_codec) < 0)
+ if (avcodec_open2(m_audioDec, m_codec, NULL) < 0)
{
- error(QString("Could not open audio codec: %1").arg(m_audioDec->codec_id));
+ error(QString("Could not open audio codec: %1")
+ .arg(m_audioDec->codec_id));
deinit();
return false;
}
@@ -265,11 +273,11 @@ bool avfDecoder::initialize()
switch (m_audioDec->sample_fmt)
{
- case SAMPLE_FMT_U8: m_sampleFmt = FORMAT_U8; break;
- case SAMPLE_FMT_S16: m_sampleFmt = FORMAT_S16; break;
- case SAMPLE_FMT_FLT: m_sampleFmt = FORMAT_FLT; break;
- case SAMPLE_FMT_DBL: m_sampleFmt = FORMAT_NONE; break;
- case SAMPLE_FMT_S32:
+ case AV_SAMPLE_FMT_U8: m_sampleFmt = FORMAT_U8; break;
+ case AV_SAMPLE_FMT_S16: m_sampleFmt = FORMAT_S16; break;
+ case AV_SAMPLE_FMT_FLT: m_sampleFmt = FORMAT_FLT; break;
+ case AV_SAMPLE_FMT_DBL: m_sampleFmt = FORMAT_NONE; break;
+ case AV_SAMPLE_FMT_S32:
switch (m_audioDec->bits_per_raw_sample)
{
case 0: m_sampleFmt = FORMAT_S32; break;
@@ -278,14 +286,13 @@ bool avfDecoder::initialize()
default: m_sampleFmt = FORMAT_NONE;
}
break;
- default: m_sampleFmt = FORMAT_NONE;
+ default: m_sampleFmt = FORMAT_NONE;
}
if (m_sampleFmt == FORMAT_NONE)
{
- int bps =
- av_get_bits_per_sample_fmt(m_audioDec->sample_fmt);
- if (m_audioDec->sample_fmt == SAMPLE_FMT_S32 &&
+ int bps = av_get_bytes_per_sample(m_audioDec->sample_fmt) << 3;
+ if (m_audioDec->sample_fmt == AV_SAMPLE_FMT_S32 &&
m_audioDec->bits_per_raw_sample)
{
bps = m_audioDec->bits_per_raw_sample;
@@ -337,10 +344,7 @@ void avfDecoder::deinit()
// Cleanup here
if (m_inputContext)
{
- if (m_inputIsFile)
- av_close_input_file(m_inputContext);
- else
- av_close_input_stream(m_inputContext);
+ avformat_close_input(&m_inputContext);
m_inputContext = NULL;
}
@@ -429,12 +433,17 @@ void avfDecoder::run()
// m_samples is the output buffer
// data_size is the size in bytes of the frame
// tmp_pkt is the input buffer
+ AVFrame frame;
+ int got_frame = 0;
+
data_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
- dec_len = avcodec_decode_audio3(m_audioDec, m_samples,
- &data_size, &tmp_pkt);
- if (dec_len < 0)
+ dec_len = avcodec_decode_audio4(m_audioDec, &frame,
+ &got_frame, &tmp_pkt);
+ if (dec_len < 0 || !got_frame)
break;
+ memcpy(m_samples, frame.extended_data[0], data_size);
+
s = (char *)m_samples;
// Copy the data to the output buffer
memcpy((char *)(output_buf + output_at), s, data_size);
View
3 mythplugins/mythmusic/mythmusic/avfdecoder.h
@@ -48,14 +48,13 @@ class avfDecoder : public Decoder
QString devicename;
AVInputFormat *m_inputFormat;
- AVFormatParameters m_params;
AVFormatContext *m_inputContext;
AVCodec *m_codec; // Codec
AVCodecContext *m_audioDec;
bool m_inputIsFile;
unsigned char *m_buffer;
- ByteIOContext *m_byteIOContext;
+ AVIOContext *m_byteIOContext;
int errcode;
int16_t *m_samples;
View
4 mythplugins/mythmusic/mythmusic/cddecoder.cpp
@@ -274,7 +274,9 @@ bool CdDecoder::initialize()
setCDSpeed(2);
- return m_inited = true;
+ m_inited = true;
+
+ return m_inited;
}
// pure virtual
View
30 mythplugins/mythmusic/mythmusic/metaioavfcomment.cpp
@@ -41,20 +41,19 @@ Metadata* MetaIOAVFComment::read(const QString &filename)
int year = 0, tracknum = 0, length = 0;
AVFormatContext* p_context = NULL;
- AVFormatParameters* p_params = NULL;
AVInputFormat* p_inputformat = NULL;
QByteArray local8bit = filename.toLocal8Bit();
- if ((av_open_input_file(&p_context, local8bit.constData(),
- p_inputformat, 0, p_params) < 0))
+ if ((avformat_open_input(&p_context, local8bit.constData(),
+ p_inputformat, NULL) < 0))
{
return NULL;
}
- if (av_find_stream_info(p_context) < 0)
+ if (avformat_find_stream_info(p_context, NULL) < 0)
return NULL;
- AVMetadataTag *tag = av_metadata_get(p_context->metadata, "title", NULL, 0);
+ AVDictionaryEntry *tag = av_dict_get(p_context->metadata, "title", NULL, 0);
if (!tag)
{
readFromFilename(filename, artist, album, title, genre, tracknum);
@@ -63,24 +62,24 @@ Metadata* MetaIOAVFComment::read(const QString &filename)
{
title = (char *)tag->value;
- tag = av_metadata_get(p_context->metadata, "author", NULL, 0);
+ tag = av_dict_get(p_context->metadata, "author", NULL, 0);
if (tag)
artist += (char *)tag->value;
// compilation_artist???
- tag = av_metadata_get(p_context->metadata, "album", NULL, 0);
+ tag = av_dict_get(p_context->metadata, "album", NULL, 0);
if (tag)
album += (char *)tag->value;
- tag = av_metadata_get(p_context->metadata, "genre", NULL, 0);
+ tag = av_dict_get(p_context->metadata, "genre", NULL, 0);
if (tag)
genre += (char *)tag->value;
- tag = av_metadata_get(p_context->metadata, "year", NULL, 0);
+ tag = av_dict_get(p_context->metadata, "year", NULL, 0);
if (tag)
year = atoi(tag->value);
- tag = av_metadata_get(p_context->metadata, "tracknum", NULL, 0);
+ tag = av_dict_get(p_context->metadata, "tracknum", NULL, 0);
if (tag)
tracknum = atoi(tag->value);
}
@@ -92,7 +91,7 @@ Metadata* MetaIOAVFComment::read(const QString &filename)
retdata->determineIfCompilation();
- av_close_input_file(p_context);
+ avformat_close_input(&p_context);
return retdata;
}
@@ -106,23 +105,22 @@ Metadata* MetaIOAVFComment::read(const QString &filename)
int MetaIOAVFComment::getTrackLength(const QString &filename)
{
AVFormatContext* p_context = NULL;
- AVFormatParameters* p_params = NULL;
AVInputFormat* p_inputformat = NULL;
// Open the specified file and populate the metadata info
QByteArray local8bit = filename.toLocal8Bit();
- if ((av_open_input_file(&p_context, local8bit.constData(),
- p_inputformat, 0, p_params) < 0))
+ if ((avformat_open_input(&p_context, local8bit.constData(),
+ p_inputformat, NULL) < 0))
{
return 0;
}
- if (av_find_stream_info(p_context) < 0)
+ if (avformat_find_stream_info(p_context, NULL) < 0)
return 0;
int rv = getTrackLength(p_context);
- av_close_input_file(p_context);
+ avformat_close_input(&p_context);
return rv;
}
View
26 mythplugins/mythmusic/mythmusic/metaiomp4.cpp
@@ -86,30 +86,29 @@ Metadata* MetaIOMP4::read(const QString &filename)
bool compilation = false;
AVFormatContext* p_context = NULL;
- AVFormatParameters* p_params = NULL;
AVInputFormat* p_inputformat = NULL;
QByteArray local8bit = filename.toLocal8Bit();
- if ((av_open_input_file(&p_context, local8bit.constData(),
- p_inputformat, 0, p_params) < 0))
+ if ((avformat_open_input(&p_context, local8bit.constData(),
+ p_inputformat, NULL) < 0))
{
return NULL;
}
- if (av_find_stream_info(p_context) < 0)
+ if (avformat_find_stream_info(p_context, NULL) < 0)
return NULL;
#if 0
//### Debugging, enable to dump a list of all field names/values found
- AVMetadataTag *tag = av_metadata_get(p_context->metadata, "\0", NULL,
+ AVDictionaryEntry *tag = av_dict_get(p_context->metadata, "\0", NULL,
AV_METADATA_IGNORE_SUFFIX);
while (tag != NULL)
{
LOG(VB_GENERAL, LOG_DEBUG, QString("Tag: %1 Value: %2")
.arg(tag->key) .arg(QString::fromUtf8(tag->value)));
- tag = av_metadata_get(p_context->metadata, "\0", tag,
- AV_METADATA_IGNORE_SUFFIX);
+ tag = av_dict_get(p_context->metadata, "\0", tag,
+ AV_METADATA_IGNORE_SUFFIX);
}
//####
#endif
@@ -149,7 +148,7 @@ Metadata* MetaIOMP4::read(const QString &filename)
retdata->setCompilation(compilation);
- av_close_input_file(p_context);
+ avformat_close_input(&p_context);
return retdata;
}
@@ -163,7 +162,7 @@ Metadata* MetaIOMP4::read(const QString &filename)
*/
QString MetaIOMP4::getFieldValue(AVFormatContext* context, const char* tagname)
{
- AVMetadataTag *tag = av_metadata_get(context->metadata, tagname, NULL, 0);
+ AVDictionaryEntry *tag = av_dict_get(context->metadata, tagname, NULL, 0);
QString value;
@@ -182,23 +181,22 @@ QString MetaIOMP4::getFieldValue(AVFormatContext* context, const char* tagname)
int MetaIOMP4::getTrackLength(const QString &filename)
{
AVFormatContext* p_context = NULL;
- AVFormatParameters* p_params = NULL;
AVInputFormat* p_inputformat = NULL;
// Open the specified file and populate the metadata info
QByteArray local8bit = filename.toLocal8Bit();
- if ((av_open_input_file(&p_context, local8bit.constData(),
- p_inputformat, 0, p_params) < 0))
+ if ((avformat_open_input(&p_context, local8bit.constData(),
+ p_inputformat, NULL) < 0))
{
return 0;
}
- if (av_find_stream_info(p_context) < 0)
+ if (avformat_find_stream_info(p_context, NULL) < 0)
return 0;
int rv = getTrackLength(p_context);
- av_close_input_file(p_context);
+ avformat_close_input(&p_context);
return rv;
}
View
10 mythplugins/mythmusic/mythmusic/musicutils.cpp
@@ -66,7 +66,7 @@ uint calcTrackLength(const QString &musicFile)
QByteArray inFileBA = musicFile.toLocal8Bit();
- int ret = av_open_input_file(&inputFC, inFileBA.constData(), fmt, 0, NULL);
+ int ret = avformat_open_input(&inputFC, inFileBA.constData(), fmt, NULL);
if (ret)
{
@@ -76,13 +76,13 @@ uint calcTrackLength(const QString &musicFile)
}
// Getting stream information
- ret = av_find_stream_info(inputFC);
+ ret = avformat_find_stream_info(inputFC, NULL);
if (ret < 0)
{
LOG(VB_GENERAL, LOG_ERR,
QString("calcTrackLength: Couldn't get stream info, error #%1").arg(ret));
- av_close_input_file(inputFC);
+ avformat_close_input(&inputFC);
inputFC = NULL;
return 0;
}
@@ -99,7 +99,7 @@ uint calcTrackLength(const QString &musicFile)
switch (inputFC->streams[i]->codec->codec_type)
{
- case CODEC_TYPE_AUDIO:
+ case AVMEDIA_TYPE_AUDIO:
{
AVPacket pkt;
av_init_packet(&pkt);
@@ -125,7 +125,7 @@ uint calcTrackLength(const QString &musicFile)
}
// Close input file
- av_close_input_file(inputFC);
+ avformat_close_input(&inputFC);
inputFC = NULL;
return duration;
View
56 mythtv/configure
@@ -1132,40 +1132,46 @@ COMPONENT_LIST="
protocols
"
+PROGRAM_LIST="
+ ffplay
+ ffprobe
+ ffserver
+ ffmpeg
+"
+
CONFIG_LIST="
$COMPONENT_LIST
- aandct
+ $PROGRAM_LIST
ac3dsp
avcodec
avdevice
avfilter
avformat
avisynth
bzlib
+ crystalhd
dct
doc
dwt
dxva2
fastdiv
- ffmpeg
- ffplay
- ffprobe
- ffserver
fft
frei0r
gnutls
- golomb
gpl
gray
- h264dsp
- h264pred
hardcoded_tables
- huffman
+ libaacplus
+ libass
+ libbluray
+ libcdio
+ libcelt
libdc1394
libdirac
libfaac
libfreetype
libgsm
+ libmodplug
libmp3lame
libnut
libopencore_amrnb
@@ -1178,6 +1184,7 @@ CONFIG_LIST="
libspeex
libstagefright_h264
libtheora
+ libutvideo
libv4l2
libvo_aacenc
libvo_amrwbenc
@@ -1186,12 +1193,10 @@ CONFIG_LIST="
libx264
libxavs
libxvid
- lpc
lsp
mdct
memalign_hack
- mlib
- mpegaudio_hp
+ mpegaudiodsp
network
nonfree
openal
@@ -1210,6 +1215,7 @@ CONFIG_LIST="
swresample
swscale
swscale_alpha
+ thumb
vaapi
vda
vdpau
@@ -2177,6 +2183,11 @@ enable avdevice
enable avfilter
enable avformat
enable avutil
+enable postproc
+enable stripping
+enable swresample
+enable swscale
+
enable asm
enable debug
#enable doc
@@ -2187,12 +2198,9 @@ enable gpl
enable mpegaudio_hp
enable network
enable optimizations
-enable postproc
enable protocols
enable runtime_cpudetect
enable shared
-enable stripping
-enable swscale
enable swscale_alpha
# build settings
@@ -4163,11 +4171,20 @@ check_cxxflags -D__STDC_LIMIT_MACROS
# add some linker flags
check_ldflags -Wl,--warn-common
-<<BLOCKQUOTE
check_ldflags -Wl,--as-needed
-BLOCKQUOTE
-check_ldflags '-Wl,-rpath-link,\$(BUILD_ROOT)/external/FFmpeg/libpostproc -Wl,-rpath-link,\$(BUILD_ROOT)/external/FFmpeg/libswscale -Wl,-rpath-link,\$(BUILD_ROOT)/external/FFmpeg/libavfilter -Wl,-rpath-link,\$(BUILD_ROOT)/external/FFmpeg/libavdevice -Wl,-rpath-link,\$(BUILD_ROOT)/external/FFmpeg/libavformat -Wl,-rpath-link,\$(BUILD_ROOT)/external/FFmpeg/libavcodec -Wl,-rpath-link,\$(BUILD_ROOT)/external/FFmpeg/libavutil'
-check_ldflags -Wl,-Bsymbolic
+check_ldflags '-Wl,-rpath-link,\$(SRC_PATH_BARE)/external/FFmpeg/libpostproc:\$(SRC_PATH_BARE)/external/FFmpeg/libswresample:\$(SRC_PATH_BARE)/external/FFmpeg/libswscale:\$(SRC_PATH_BARE)/external/FFmpeg/libavfilter:\$(SRC_PATH_BARE)/external/FFmpeg/libavdevice:\$(SRC_PATH_BARE)/external/FFmpeg/libavformat:\$(SRC_PATH_BARE)/external/FFmpeg/libavcodec:\$(SRC_PATH_BARE)/external/FFmpeg/libavutil'
+test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
+
+enabled xmm_clobber_test && \
+ check_ldflags -Wl,--wrap,avcodec_open2 \
+ -Wl,--wrap,avcodec_decode_audio4 \
+ -Wl,--wrap,avcodec_decode_video2 \
+ -Wl,--wrap,avcodec_decode_subtitle2 \
+ -Wl,--wrap,avcodec_encode_audio2 \
+ -Wl,--wrap,avcodec_encode_video \
+ -Wl,--wrap,avcodec_encode_subtitle \
+ -Wl,--wrap,sws_scale || \
+ disable xmm_clobber_test
echo "X{};" > $TMPV
if test_ldflags -Wl,--version-script,$TMPV; then
@@ -4952,6 +4969,7 @@ cat > $TMPH <<EOF
#define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
#define FFMPEG_LICENSE "$(c_escape $license)"
#define FFMPEG_DATADIR "$(eval c_escape $datadir)"
+#define AVCONV_DATADIR "$(eval c_escape $datadir)"
#define CC_TYPE "$cc_type"
#define CC_VERSION $cc_version
#define restrict $_restrict
View
1 mythtv/external/.gitignore
@@ -14,3 +14,4 @@ mythffmpeg
ffplay
ffplay_g
mythffplay
+FFmpeg.old
View
22 mythtv/external/FFmpeg/Makefile
@@ -1,16 +1,16 @@
include config.mak
-SRC_DIR = $(SRC_PATH_BARE)
-SRC_PATH = $(SRC_PATH_BARE)/external/FFmpeg
-
-vpath %.c $(SRC_PATH_BARE)
-vpath %.cpp $(SRC_PATH_BARE)
-vpath %.h $(SRC_PATH_BARE)
-vpath %.S $(SRC_PATH_BARE)
-vpath %.asm $(SRC_PATH_BARE)
-vpath %.v $(SRC_PATH_BARE)
-vpath %.texi $(SRC_PATH_BARE)
-vpath %/fate_config.sh.template $(SRC_PATH_BARE)
+SRC_PATH = ${SRC_PATH_BARE}/external/FFmpeg
+SRC_DIR = $(SRC_PATH)
+
+vpath %.c $(SRC_DIR)
+vpath %.cpp $(SRC_DIR)
+vpath %.h $(SRC_DIR)
+vpath %.S $(SRC_DIR)
+vpath %.asm $(SRC_DIR)
+vpath %.v $(SRC_DIR)
+vpath %.texi $(SRC_DIR)
+vpath %/fate_config.sh.template $(SRC_DIR)
PROGS-$(CONFIG_FFMPEG) += ffmpeg
PROGS-$(CONFIG_FFPLAY) += ffplay
View
4 mythtv/external/FFmpeg/README.sync
@@ -0,0 +1,4 @@
+This code was resynced upstream to:
+
+git://source.ffmpeg.org/ffmpeg.git at SHA1 d3db8988d on March 31, 2010
+
View
6 mythtv/external/FFmpeg/common.mak
@@ -22,6 +22,7 @@ endif
ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale swresample
+
# NASM requires -I path terminated with /
IFLAGS := -I. -I$(SRC_PATH)/
CPPFLAGS := $(IFLAGS) $(CPPFLAGS)
@@ -79,8 +80,6 @@ OBJS += $(OBJS-yes)
FFLIBS := $(FFLIBS-yes) $(FFLIBS)
TESTPROGS += $(TESTPROGS-yes)
-FFEXTRALIBS := $(FFLIBS:%=-lmyth%$(BUILDSUF)) $(EXTRALIBS)
-
EXAMPLES := $(EXAMPLES:%=$(SUBDIR)%-example$(EXESUF))
OBJS := $(sort $(OBJS:%=$(SUBDIR)%))
TESTOBJS := $(TESTOBJS:%=$(SUBDIR)%) $(TESTPROGS:%=$(SUBDIR)%-test.o)
@@ -91,6 +90,9 @@ TOOLS += $(TOOLS-yes)
TOOLOBJS := $(TOOLS:%=tools/%.o)
TOOLS := $(TOOLS:%=tools/%$(EXESUF))
+FFEXTRALIBS := $(addprefix -lmyth,$(addsuffix $(BUILDSUF),$(FFLIBS))) $(EXTRALIBS)
+#FFLDFLAGS := $(addprefix -L$(SRC_PATH_BARE)/external/FFmpeg/lib,$(ALLFFLIBS)) $(LDFLAGS)
+
DEP_LIBS := $(foreach NAME,$(FFLIBS),lib$(NAME)/$($(CONFIG_SHARED:yes=S)LIBNAME))
ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h))
View
2 mythtv/external/FFmpeg/libavcodec/aaclatmdec.c
@@ -91,7 +91,7 @@ static void latm_read_ga_specific_config(int audio_object_type,
ext_flag = copy_bits(pb, gb, 1);
if (!c->chan_config)
- ff_copy_pce_data(pb, gb); // program_config_element
+ avpriv_copy_pce_data(pb, gb); // program_config_element
if (audio_object_type == AOT_AAC_SCALABLE ||
audio_object_type == AOT_ER_AAC_SCALABLE)
View
8 mythtv/external/FFmpeg/libavcodec/avcodec.h
@@ -1305,11 +1305,13 @@ typedef struct AVCodecContext {
*/
unsigned int stream_codec_tag;
-#if FF_API_SUB_ID
+#if 1 || FF_API_SUB_ID
/**
- * @deprecated this field is unused
+ * this field is unused by ffmpeg, but is used by MythTV for the DVB
+ * caption carousel
+ *
*/
- attribute_deprecated int sub_id;
+ int sub_id;
#endif
void *priv_data;
View
2 mythtv/external/FFmpeg/libavcodec/golomb.h
@@ -121,7 +121,7 @@ static inline int svq3_get_ue_golomb(GetBitContext *gb){
return ff_interleaved_ue_golomb_vlc_code[buf];
}else{
- int ret = 1;
+ uint ret = 1;
do {
buf >>= 32 - 8;
View
5 mythtv/external/FFmpeg/libavcodec/libavcodec.v
@@ -27,5 +27,10 @@ LIBAVCODEC_$MAJOR {
ff_jpeg_fdct*;
#XBMC's configure checks for ff_vdpau_vc1_decode_picture()
ff_vdpau_vc1_decode_picture;
+ ff_codec_type_string;
+ ff_codec_id_string;
+ ff_*golomb*code;
+ ff_*golomb*len;
+ ff_inv_zigzag_direct16;
local: *;
};
View
2 mythtv/external/FFmpeg/libavcodec/mpegvideo.h
@@ -203,7 +203,7 @@ typedef struct MotionEstContext{
* MpegEncContext.
*/
typedef struct MpegEncContext {
- AVClass *class;
+ AVClass *clss;
struct AVCodecContext *avctx;
/* the following parameters must be initialized before encoding */
int width, height;///< picture size. must be a multiple of 16
View
2 mythtv/external/FFmpeg/libavformat/libavformat.v
@@ -13,6 +13,7 @@ LIBAVFORMAT_$MAJOR {
ffio_set_buf_size;
ffurl_close;
ffurl_open;
+ ffurl_read;
ffurl_read_complete;
ffurl_seek;
ffurl_size;
@@ -36,5 +37,6 @@ LIBAVFORMAT_$MAJOR {
udp_get_local_port;
init_checksum;
init_put_byte;
+ ff_read_frame_flush;
local: *;
};
View
8 mythtv/external/FFmpeg/libavformat/mpegts.c
@@ -2155,7 +2155,7 @@ static void mpegts_add_stream(MpegTSContext *ts, int id, pmt_entry_t* item,
ts->pid_cnt++;
if (item->dvbci.language[0])
- av_metadata_set2(&st->metadata, "language", item->dvbci.language, 0);
+ av_dict_set(&st->metadata, "language", item->dvbci.language, 0);
if (item->dvbci.sub_id && (item->codec_id == CODEC_ID_DVB_SUBTITLE))
st->codec->sub_id = item->dvbci.sub_id;
@@ -2782,7 +2782,7 @@ static int mpegts_read_header(AVFormatContext *s)
/* now find the info for the first service if we found any,
otherwise try to filter all PATs */
- url_fseek(pb, pos, SEEK_SET);
+ ffurl_seek(pb, pos, SEEK_SET);
ts->req_sid = sid = ts->prg[i].id;
handle_packets(ts, s->probesize / ts->raw_packet_size);
@@ -2797,7 +2797,7 @@ static int mpegts_read_header(AVFormatContext *s)
/* turn off crc checking */
ts->pmt_filter->u.section_filter.check_crc = 0;
/* try again */
- url_fseek(pb, pos, SEEK_SET);
+ ffurl_seek(pb, pos, SEEK_SET);
ts->req_sid = sid = ts->prg[i].id;
handle_packets(ts, s->probesize / ts->raw_packet_size);
}
@@ -2812,7 +2812,7 @@ static int mpegts_read_header(AVFormatContext *s)
"contents of first TS packet only!\n");
ts->pmt_filter->pmt_chop_at_ts = 1;
/* try again */
- url_fseek(pb, pos, SEEK_SET);
+ ffurl_seek(pb, pos, SEEK_SET);
ts->req_sid = sid = ts->prg[i].id;
handle_packets(ts, s->probesize / ts->raw_packet_size);
}
View
5 mythtv/external/FFmpeg/libavformat/utils.c
@@ -2254,6 +2254,11 @@ void estimate_timings(AVFormatContext *ic, int64_t old_offset)
}
}
+void av_estimate_timings(AVFormatContext *ic, int64_t old_offset)
+{
+ return estimate_timings(ic, old_offset);
+}
+
static int has_codec_parameters(AVStream *st)
{
AVCodecContext *avctx = st->codec;
View
10 mythtv/external/FFmpeg/library.mak
@@ -1,6 +1,6 @@
-SRC_DIR := $(SRC_PATH)/lib$(NAME)
+SRC_DIR := $(SRC_PATH_BARE)/lib$(NAME)
-include $(SRC_PATH)/common.mak
+include $(SRC_PATH_BARE)/external/FFmpeg/common.mak
LIBVERSION := $(lib$(NAME)_VERSION)
LIBMAJOR := $(lib$(NAME)_VERSION_MAJOR)
@@ -28,7 +28,9 @@ $(SUBDIR)$(LIBNAME): $(OBJS)
$(AR) rc $@ $^ $(EXTRAOBJS)
$(RANLIB) $@
-install-headers: install-lib$(NAME)-headers install-lib$(NAME)-pkgconfig
+
+#install-headers: install-lib$(NAME)-headers install-lib$(NAME)-pkgconfig
+install-headers: install-lib$(NAME)-headers
install-libs-$(CONFIG_STATIC): install-lib$(NAME)-static
install-libs-$(CONFIG_SHARED): install-lib$(NAME)-shared
@@ -42,7 +44,7 @@ $(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SUBDIR)lib$(NAME).ver
$(SLIB_CREATE_DEF_CMD)
- $$(LD) $(SHFLAGS) $(LDFLAGS) -o $$@ $$(filter %.o,$$^) $(FFEXTRALIBS) $(EXTRAOBJS)
+ $$(LD) $(SHFLAGS) $(LDFLAGS) -o $$@ $$(filter %.o,$$^) $(EXTRAOBJS) $(FFEXTRALIBS)
$(SLIB_EXTRA_CMD)
ifdef SUBDIR
View
2 mythtv/filters/adjust/filter_adjust.c
@@ -213,7 +213,7 @@ static int fillTableMMX(uint8_t *table, mmx_t *shift, mmx_t *scale, mmx_t *min,
fillTable(table, in_min, in_max, out_min, out_max, gamma);
scalec = ((out_max - out_min) << 15)/(in_max - in_min);
- if ((av_get_cpu_flags() & FF_MM_MMX) == 0 || gamma < 0.9999 ||
+ if ((av_get_cpu_flags() & AV_CPU_FLAG_MMX) == 0 || gamma < 0.9999 ||
gamma > 1.00001 || scalec > 32767 << 7)
return 0;
shiftc = 2;
View
2 mythtv/filters/crop/filter_crop.c
@@ -285,7 +285,7 @@ static VideoFilter *new_filter(VideoFrameType inpixfmt,
filter->vf.filter = &crop;
#ifdef MMX
- if (av_get_cpu_flags() & FF_MM_MMX)
+ if (av_get_cpu_flags() & AV_CPU_FLAG_MMX)
filter->vf.filter = &cropMMX;
#endif
View
6 mythtv/filters/denoise3d/filter_denoise3d.c
@@ -344,7 +344,7 @@ static int denoise3DFilter(VideoFilter *f, VideoFrame *frame, int field)
TF_START;
#ifdef MMX
- if (filter->mm_flags & FF_MM_MMX)
+ if (filter->mm_flags & AV_CPU_FLAG_MMX)
emms();
#endif
@@ -366,7 +366,7 @@ static int denoise3DFilter(VideoFilter *f, VideoFrame *frame, int field)
filter->coefs[2] + 256,
filter->coefs[3] + 256);
#ifdef MMX
- if (filter->mm_flags & FF_MM_MMX)
+ if (filter->mm_flags & AV_CPU_FLAG_MMX)
emms();
#endif
@@ -419,7 +419,7 @@ static VideoFilter *NewDenoise3DFilter(VideoFrameType inpixfmt,
#ifdef MMX
filter->mm_flags = av_get_cpu_flags();
- if (filter->mm_flags & FF_MM_MMX)
+ if (filter->mm_flags & AV_CPU_FLAG_MMX)
filter->filtfunc = &denoiseMMX;
#endif
View
2 mythtv/filters/greedyhdeint/color.c
@@ -610,7 +610,7 @@ void init_yuv_conversion(void)
/* determine best YV12 -> YUY2 converter to use */
#ifdef MMX
- if (av_get_cpu_flags() & FF_MM_MMXEXT)
+ if (av_get_cpu_flags() & AV_CPU_FLAG_MMX2)
{
yv12_to_yuy2 = yv12_to_yuy2_mmxext;
yuy2_to_yv12 = yuy2_to_yv12_mmxext;
View
6 mythtv/filters/greedyhdeint/filter_greedyhdeint.c
@@ -176,21 +176,21 @@ static int GreedyHDeint (VideoFilter * f, VideoFrame * frame, int field)
#ifdef MMX
/* SSE Version has best quality. 3DNOW and MMX a litte bit impure */
- if (filter->mm_flags & FF_MM_SSE)
+ if (filter->mm_flags & AV_CPU_FLAG_SSE)
{
greedyh_filter_sse(
filter->deint_frame, 2 * frame->width,
filter->frames[cur_frame], filter->frames[last_frame],
bottom_field, field, frame->width, frame->height);
}
- else if (filter->mm_flags & FF_MM_3DNOW)
+ else if (filter->mm_flags & AV_CPU_FLAG_3DNOW)
{
greedyh_filter_3dnow(
filter->deint_frame, 2 * frame->width,
filter->frames[cur_frame], filter->frames[last_frame],
bottom_field, field, frame->width, frame->height);
}
- else if (filter->mm_flags & FF_MM_MMX)
+ else if (filter->mm_flags & AV_CPU_FLAG_MMX)
{
greedyh_filter_mmx(
filter->deint_frame, 2 * frame->width,
View
4 mythtv/filters/kerneldeint/filter_kerneldeint.c
@@ -412,7 +412,7 @@ static void filter_func(struct ThisFilter *p, uint8_t *dst, int dst_offsets[3],
}
}
#if HAVE_MMX
- if (p->mm_flags & FF_MM_MMX)
+ if (p->mm_flags & AV_CPU_FLAG_MMX)
emms();
#endif
}
@@ -562,7 +562,7 @@ static VideoFilter *NewKernelDeintFilter(VideoFrameType inpixfmt,
filter->line_filter_fast = &line_filter_c_fast;
#if HAVE_MMX
filter->mm_flags = av_get_cpu_flags();
- if (filter->mm_flags & FF_MM_MMX)
+ if (filter->mm_flags & AV_CPU_FLAG_MMX)
{
filter->line_filter = &line_filter_mmx;
filter->line_filter_fast = &line_filter_mmx_fast;
View
14 mythtv/filters/linearblend/filter_linearblend.c
@@ -8,6 +8,10 @@
#include <stdint.h>
#endif
+#if HAVE_MMX || HAVE_AMD3DNOW
+#include "libavcodec/x86/mmx.h"
+#endif
+
#include "../mm_arch.h"
#if HAVE_ALTIVEC_H
#include <altivec.h>
@@ -320,8 +324,8 @@ static int linearBlendFilter(VideoFilter *f, VideoFrame *frame, int field)
}
}
-#if HAVE_MMX
- if ((vf->mm_flags & FF_MM_MMXEXT) || (vf->mm_flags & FF_MM_3DNOW))
+#if HAVE_MMX || HAVE_AMD3DNOW
+ if ((vf->mm_flags & AV_CPU_FLAG_MMX2) || (vf->mm_flags & AV_CPU_FLAG_3DNOW))
emms();
#endif
@@ -353,11 +357,11 @@ static VideoFilter *new_filter(VideoFrameType inpixfmt,
filter->vf.filter = &linearBlendFilter;
filter->subfilter = &linearBlend; /* Default, non accellerated */
filter->mm_flags = av_get_cpu_flags();
- if (HAVE_MMX && filter->mm_flags & FF_MM_MMXEXT)
+ if (HAVE_MMX && filter->mm_flags & AV_CPU_FLAG_MMX2)
filter->subfilter = &linearBlendMMX;
- else if (HAVE_AMD3DNOW && filter->mm_flags & FF_MM_3DNOW)
+ else if (HAVE_AMD3DNOW && filter->mm_flags & AV_CPU_FLAG_3DNOW)
filter->subfilter = &linearBlend3DNow;
- else if (HAVE_ALTIVEC && filter->mm_flags & FF_MM_ALTIVEC)
+ else if (HAVE_ALTIVEC && filter->mm_flags & AV_CPU_FLAG_ALTIVEC)
filter->vf.filter = &linearBlendFilterAltivec;
filter->vf.cleanup = NULL;
View
8 mythtv/filters/postprocess/filter_postprocess.c
@@ -23,14 +23,14 @@ typedef struct ThisFilter
{
VideoFilter vf;
- pp_mode_t* mode;
- pp_context_t* context;
+ pp_mode *mode;
+ pp_context *context;
int width;
int height;
int ysize;
int csize;
- unsigned char* src[3];
- unsigned char* dst[3];
+ unsigned char *src[3];
+ unsigned char *dst[3];
int srcStride[3];
int dstStride[3];
int eprint;
View
2 mythtv/filters/quickdnr/filter_quickdnr.c
@@ -522,7 +522,7 @@ static VideoFilter *new_filter(VideoFrameType inpixfmt,
filter->vf.filter = (double_threshold) ? &quickdnr2 : &quickdnr;
#ifdef MMX
- if (av_get_cpu_flags() > FF_MM_MMXEXT)
+ if (av_get_cpu_flags() > AV_CPU_FLAG_MMX2)
{
filter->vf.filter = (double_threshold) ? &quickdnr2MMX : &quickdnrMMX;
for (i = 0; i < 8; i++)
View
10 mythtv/filters/yadif/filter_yadif.c
@@ -625,18 +625,18 @@ static VideoFilter * YadifDeintFilter(VideoFrameType inpixfmt,
filter->filter_line = filter_line_c;
#if HAVE_MMX
- if (filter->mm_flags & FF_MM_MMX)
+ if (filter->mm_flags & AV_CPU_FLAG_MMX)
{
filter->filter_line = filter_line_mmx2;
}
- if (filter->mm_flags & FF_MM_SSE2)
+ if (filter->mm_flags & AV_CPU_FLAG_SSE2)
fast_memcpy=fast_memcpy_SSE;
- else if (filter->mm_flags & FF_MM_MMXEXT)
+ else if (filter->mm_flags & AV_CPU_FLAG_MMX2)
fast_memcpy=fast_memcpy_MMX2;
- else if (filter->mm_flags & FF_MM_3DNOW)
+ else if (filter->mm_flags & AV_CPU_FLAG_3DNOW)
fast_memcpy=fast_memcpy_3DNow;
- else if (filter->mm_flags & FF_MM_MMX)
+ else if (filter->mm_flags & AV_CPU_FLAG_MMX)
fast_memcpy=fast_memcpy_MMX;
else
#endif
View
1 mythtv/libs/libmyth/audio/audiooutputdigitalencoder.cpp
@@ -98,7 +98,6 @@ bool AudioOutputDigitalEncoder::Init(
.arg(samplerate) .arg(channels));
// We need to do this when called from mythmusic
- avcodec_init();
avcodec_register_all();
#if LIBAVCODEC_VERSION_INT > AV_VERSION_INT( 52, 113, 0 )
codec = avcodec_find_encoder_by_name("ac3_fixed");
View
37 mythtv/libs/libmyth/audio/spdifencoder.cpp
@@ -5,6 +5,10 @@
#include "compat.h"
#include "spdifencoder.h"
#include "mythlogging.h"
+extern "C" {
+#include "libavformat/avformat.h"
+#include "libavutil/opt.h"
+}
#define LOC QString("SPDIFEncoder: ")
@@ -42,47 +46,32 @@ SPDIFEncoder::SPDIFEncoder(QString muxer, int codec_id)
}
m_oc->oformat = fmt;
- if (av_set_parameters(m_oc, NULL) < 0)
- {
- LOG(VB_AUDIO, LOG_ERR, LOC + "av_set_parameters");
- Destroy();
- return;
- }
-
- m_oc->pb = av_alloc_put_byte(m_buffer, sizeof(m_buffer), URL_RDONLY,
- this, NULL, funcIO, NULL);
+ m_oc->pb = avio_alloc_context(m_buffer, sizeof(m_buffer), 0,
+ this, NULL, funcIO, NULL);
if (!m_oc->pb)
{
- LOG(VB_AUDIO, LOG_ERR, LOC + "av_alloc_put_byte");
+ LOG(VB_AUDIO, LOG_ERR, LOC + "avio_alloc_context");
Destroy();
return;
}
- m_oc->pb->is_streamed = true;
+ m_oc->pb->seekable = 0;
m_oc->flags |= AVFMT_NOFILE | AVFMT_FLAG_IGNIDX;
- if (av_set_parameters(m_oc, NULL) != 0)
- {
- LOG(VB_AUDIO, LOG_ERR, LOC + "av_set_parameters");
- Destroy();
- return;
- }
-
- m_stream = av_new_stream(m_oc, 1);
+ m_stream = avformat_new_stream(m_oc, NULL);
if (!m_stream)
{
- LOG(VB_AUDIO, LOG_ERR, LOC + "av_new_stream");
+ LOG(VB_AUDIO, LOG_ERR, LOC + "avformat_new_stream");
Destroy();
return;
}
- // copy without decoding or reencoding
- m_stream->stream_copy = true;
+ m_stream->id = 1;
AVCodecContext *codec = m_stream->codec;
codec->codec_id = (CodecID)codec_id;
- av_write_header(m_oc);
+ avformat_write_header(m_oc, NULL);
LOG(VB_AUDIO, LOG_INFO, LOC + QString("Creating %1 encoder (for %2)")
.arg(muxer).arg(ff_codec_id_string((CodecID)codec_id)));
@@ -152,7 +141,7 @@ bool SPDIFEncoder::SetMaxHDRate(int rate)
{
return false;
}
- av_set_int(m_oc->priv_data, "dtshd_rate", rate);
+ av_opt_set_int(m_oc->priv_data, "dtshd_rate", rate, 0);
return true;
}
View
1 mythtv/libs/libmyth/audio/spdifencoder.h
@@ -9,7 +9,6 @@ extern "C" {
#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"
#include "libavcodec/audioconvert.h"
-#include "libavcodec/opt.h"
}
class MPUBLIC SPDIFEncoder
View
9 mythtv/libs/libmythfreesurround/el_processor.cpp
@@ -262,9 +262,10 @@ class decoder_impl {
fftwf_execute(loadR);
#else
ff_fft_permuteRC(fftContextForward, lt, (FFTComplex*)&dftL[0]);
+ av_fft_calc(fftContextForward, (FFTComplex*)&dftL[0]);
+
ff_fft_permuteRC(fftContextForward, rt, (FFTComplex*)&dftR[0]);
- ff_fft_calc(fftContextForward, (FFTComplex*)&dftL[0]);
- ff_fft_calc(fftContextForward, (FFTComplex*)&dftR[0]);
+ av_fft_calc(fftContextForward, (FFTComplex*)&dftR[0]);
#endif
// 2. compare amplitude and phase of each DFT bin and produce the X/Y coordinates in the sound field
@@ -455,8 +456,8 @@ class decoder_impl {
src[N-f][0] = src[f][0];
src[N-f][1] = -src[f][1]; // complex conjugate
}
- ff_fft_permute(fftContextReverse, (FFTComplex*)&src[0]);
- ff_fft_calc(fftContextReverse, (FFTComplex*)&src[0]);
+ av_fft_permute(fftContextReverse, (FFTComplex*)&src[0]);
+ av_fft_calc(fftContextReverse, (FFTComplex*)&src[0]);
float* pT1 = &target[current_buf*halfN];
float* pWnd1 = &wnd[0];
View
12 mythtv/libs/libmythtv/NuppelVideoRecorder.cpp
@@ -520,7 +520,7 @@ bool NuppelVideoRecorder::SetupAVCodecVideo(void)
return false;
}
- mpa_vidctx = avcodec_alloc_context();
+ mpa_vidctx = avcodec_alloc_context3(NULL);
avcodec_get_frame_defaults(&mpa_picture);
@@ -577,8 +577,6 @@ bool NuppelVideoRecorder::SetupAVCodecVideo(void)
mpa_vidctx->bit_rate_tolerance = usebitrate * 100;
mpa_vidctx->qmin = maxquality;
mpa_vidctx->qmax = minquality;
- mpa_vidctx->mb_qmin = maxquality;
- mpa_vidctx->mb_qmax = minquality;
mpa_vidctx->max_qdiff = qualdiff;
mpa_vidctx->flags = mp4opts;
mpa_vidctx->mb_decision = mb_decision;
@@ -599,12 +597,12 @@ bool NuppelVideoRecorder::SetupAVCodecVideo(void)
mpa_vidctx->idct_algo = FF_IDCT_AUTO;
mpa_vidctx->prediction_method = FF_PRED_LEFT;
if (videocodec.toLower() == "huffyuv" || videocodec.toLower() == "mjpeg")
- mpa_vidctx->strict_std_compliance = FF_COMPLIANCE_INOFFICIAL;
+ mpa_vidctx->strict_std_compliance = FF_COMPLIANCE_UNOFFICIAL;
mpa_vidctx->thread_count = encoding_thread_count;
QMutexLocker locker(avcodeclock);
- if (avcodec_open(mpa_vidctx, mpa_vidcodec) < 0)
+ if (avcodec_open2(mpa_vidctx, mpa_vidcodec, NULL) < 0)
{
LOG(VB_GENERAL, LOG_ERR, LOC + QString("Unable to open FFMPEG/%1 codec")
.arg(videocodec));
@@ -2952,9 +2950,9 @@ void NuppelVideoRecorder::WriteVideo(VideoFrame *frame, bool skipsync,
mpa_picture.type = FF_BUFFER_TYPE_SHARED;
if (wantkeyframe)
- mpa_picture.pict_type = FF_I_TYPE;
+ mpa_picture.pict_type = AV_PICTURE_TYPE_I;
else
- mpa_picture.pict_type = 0;
+ mpa_picture.pict_type = AV_PICTURE_TYPE_NONE;
if (!hardware_encode)
{
View
192 mythtv/libs/libmythtv/avformatdecoder.cpp
@@ -60,10 +60,13 @@ extern "C" {
extern "C" {
#include "libavutil/avutil.h"
+#include "libavutil/log.h"
+#include "libavcodec/avcodec.h"
#include "libavcodec/ac3_parser.h"
-extern const uint8_t *ff_find_start_code(const uint8_t *p, const uint8_t *end, uint32_t *state);
-extern void ff_read_frame_flush(AVFormatContext *s);
+#include "libavcodec/mpegvideo.h"
+#include "libavformat/avformat.h"
#include "libavformat/avio.h"
+#include "libavformat/internal.h"
#include "libswscale/swscale.h"
#include "ivtv_myth.h"
}
@@ -302,13 +305,10 @@ AvFormatDecoder::AvFormatDecoder(MythPlayer *parent,
m_fps(0.0f),
codec_is_mpeg(false)
{
- memset(&params, 0, sizeof(AVFormatParameters));
memset(&readcontext, 0, sizeof(readcontext));
memset(ccX08_in_pmt, 0, sizeof(ccX08_in_pmt));
memset(ccX08_in_tracks, 0, sizeof(ccX08_in_tracks));
- // using preallocated AVFormatContext for our own ByteIOContext
- params.prealloced_context = 1;
audioSamples = (short int *)av_mallocz(AVCODEC_MAX_AUDIO_FRAME_SIZE *
sizeof(int32_t));
ccd608->SetIgnoreTimecode(true);
@@ -384,7 +384,7 @@ void AvFormatDecoder::CloseContext()
av_free(ic->pb->buffer);
av_free(ic->pb);
- av_close_input_file(ic);
+ avformat_close_input(&ic);
ic = NULL;
fmt->flags &= ~AVFMT_NOFILE;
}
@@ -408,7 +408,7 @@ int64_t AvFormatDecoder::NormalizeVideoTimecode(int64_t timecode)
for (uint i = 0; i < ic->nb_streams; i++)
{
AVStream *st1 = ic->streams[i];
- if (st1 && st1->codec->codec_type == CODEC_TYPE_VIDEO)
+ if (st1 && st1->codec->codec_type == AVMEDIA_TYPE_VIDEO)
{
st = st1;
break;
@@ -547,7 +547,7 @@ bool AvFormatDecoder::DoFastForward(long long desiredFrame, bool discardFrames)
for (uint i = 0; i < ic->nb_streams; i++)
{
AVStream *st1 = ic->streams[i];
- if (st1 && st1->codec->codec_type == CODEC_TYPE_VIDEO)
+ if (st1 && st1->codec->codec_type == AVMEDIA_TYPE_VIDEO)
{
st = st1;
break;
@@ -817,13 +817,13 @@ void AvFormatDecoder::InitByteContext(void)
readcontext.max_packet_size = 0;
readcontext.priv_data = avfRingBuffer;
unsigned char* buffer = (unsigned char *)av_malloc(buf_size);
- ic->pb = av_alloc_put_byte(buffer, buf_size, 0,
- &readcontext,
- AVF_Read_Packet,
- AVF_Write_Packet,
- AVF_Seek_Packet);
+ ic->pb = avio_alloc_context(buffer, buf_size, 0,
+ &readcontext,
+ AVF_Read_Packet,
+ AVF_Write_Packet,
+ AVF_Seek_Packet);
- ic->pb->is_streamed = streamed;
+ ic->pb->seekable = !streamed;
}
extern "C" void HandleStreamChange(void *data)
@@ -876,7 +876,7 @@ int AvFormatDecoder::FindStreamInfo(void)
{
QMutexLocker lock(avcodeclock);
silence_ffmpeg_logging = true;
- int retval = av_find_stream_info(ic);
+ int retval = avformat_find_stream_info(ic, NULL);
silence_ffmpeg_logging = false;
return retval;
}
@@ -937,7 +937,7 @@ int AvFormatDecoder::OpenFile(RingBuffer *rbuffer, bool novideo,
InitByteContext();
- int err = av_open_input_stream(&ic, ic->pb, filename, fmt, &params);
+ int err = avformat_open_input(&ic, filename, fmt, NULL);
if (err < 0)
{
LOG(VB_GENERAL, LOG_ERR, LOC +
@@ -956,7 +956,7 @@ int AvFormatDecoder::OpenFile(RingBuffer *rbuffer, bool novideo,
{
LOG(VB_GENERAL, LOG_ERR, LOC + "Could not find codec parameters. " +
QString("file was \"%1\".").arg(filename));
- av_close_input_file(ic);
+ avformat_close_input(&ic);
ic = NULL;
return -1;
}
@@ -1259,12 +1259,11 @@ void AvFormatDecoder::InitVideoCodec(AVStream *stream, AVCodecContext *enc,
enc->draw_horiz_band = NULL;
enc->slice_flags = 0;
- enc->error_recognition = FF_ER_COMPLIANT;
+ enc->err_recognition = AV_EF_COMPLIANT;
enc->workaround_bugs = FF_BUG_AUTODETECT;
enc->error_concealment = FF_EC_GUESS_MVS | FF_EC_DEBLOCK;
enc->idct_algo = FF_IDCT_AUTO;
enc->debug = 0;
- enc->rate_emu = 0;
enc->error_rate = 0;
AVCodec *codec = avcodec_find_decoder(enc->codec_id);
@@ -1390,9 +1389,11 @@ void AvFormatDecoder::InitVideoCodec(AVStream *stream, AVCodecContext *enc,
case CODEC_ID_WMV2:
video_format = VIDEO_WMV;
break;
+#if 0
case CODEC_ID_XVID:
video_format = VIDEO_XVID;
break;
+#endif
default:
video_format = VIDEO_MPG;
break;
@@ -1644,8 +1645,9 @@ void AvFormatDecoder::ScanTeletextCaptions(int av_index)
void AvFormatDecoder::ScanRawTextCaptions(int av_stream_index)
{
- AVMetadataTag *metatag = av_metadata_get(ic->streams[av_stream_index]->metadata,
- "language", NULL, 0);
+ AVDictionaryEntry *metatag =
+ av_dict_get(ic->streams[av_stream_index]->metadata, "language", NULL,
+ 0);
int lang = metatag ? get_canonical_lang(metatag->value) :
iso639_str3_to_key("und");
LOG(VB_PLAYBACK, LOG_INFO, LOC +
@@ -1764,7 +1766,7 @@ int AvFormatDecoder::ScanStreams(bool novideo)
switch (enc->codec_type)
{
- case CODEC_TYPE_VIDEO:
+ case AVMEDIA_TYPE_VIDEO:
{
//assert(enc->codec_id);
if (!enc->codec_id)
@@ -1828,7 +1830,7 @@ int AvFormatDecoder::ScanStreams(bool novideo)
// Needed for broken transmitters which mark
// MPEG2 streams as MPEG1 streams, and should
// be harmless for unbroken ones.
- if (CODEC_ID_MPEG1VIDEO == enc->codec_id)
+ if (enc->codec_id == CODEC_ID_MPEG1VIDEO)
enc->codec_id = CODEC_ID_MPEG2VIDEO;
// HACK -- end
#endif // USING_VDPAU
@@ -1940,7 +1942,7 @@ int AvFormatDecoder::ScanStreams(bool novideo)
break;
}
- case CODEC_TYPE_AUDIO:
+ case AVMEDIA_TYPE_AUDIO:
{
if (enc->codec)
{
@@ -1960,7 +1962,7 @@ int AvFormatDecoder::ScanStreams(bool novideo)
bitrate += enc->bit_rate;
break;
}
- case CODEC_TYPE_SUBTITLE:
+ case AVMEDIA_TYPE_SUBTITLE:
{
if (enc->codec_id == CODEC_ID_DVB_TELETEXT)
ScanTeletextCaptions(i);
@@ -1972,15 +1974,15 @@ int AvFormatDecoder::ScanStreams(bool novideo)
.arg(ff_codec_type_string(enc->codec_type)));
break;
}
- case CODEC_TYPE_DATA:
+ case AVMEDIA_TYPE_DATA:
{
ScanTeletextCaptions(i);
bitrate += enc->bit_rate;
LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("data codec (%1)")
.arg(ff_codec_type_string(enc->codec_type)));
break;
}
- case CODEC_TYPE_ATTACHMENT:
+ case AVMEDIA_TYPE_ATTACHMENT:
{
if (enc->codec_id == CODEC_ID_TTF)
tracks[kTrackTypeAttachment].push_back(
@@ -2001,13 +2003,13 @@ int AvFormatDecoder::ScanStreams(bool novideo)
}
}
- if (enc->codec_type != CODEC_TYPE_AUDIO &&
- enc->codec_type != CODEC_TYPE_VIDEO &&
- enc->codec_type != CODEC_TYPE_SUBTITLE)
+ if (enc->codec_type != AVMEDIA_TYPE_AUDIO &&
+ enc->codec_type != AVMEDIA_TYPE_VIDEO &&
+ enc->codec_type != AVMEDIA_TYPE_SUBTITLE)
continue;
// skip DVB teletext and text subs, there is no libavcodec decoder
- if (enc->codec_type == CODEC_TYPE_SUBTITLE &&
+ if (enc->codec_type == AVMEDIA_TYPE_SUBTITLE &&
(enc->codec_id == CODEC_ID_DVB_TELETEXT ||
enc->codec_id == CODEC_ID_TEXT))
continue;
@@ -2067,7 +2069,7 @@ int AvFormatDecoder::ScanStreams(bool novideo)
continue;
}
// select vdpau capable decoder if needed
- else if (enc->codec_type == CODEC_TYPE_VIDEO &&
+ else if (enc->codec_type == AVMEDIA_TYPE_VIDEO &&
codec_is_vdpau(video_codec_id) && !CODEC_IS_VDPAU(codec))
{
codec = find_vdpau_decoder(codec, enc->codec_id);
@@ -2077,7 +2079,7 @@ int AvFormatDecoder::ScanStreams(bool novideo)
{
QMutexLocker locker(avcodeclock);
- int open_val = avcodec_open(enc, codec);
+ int open_val = avcodec_open2(enc, codec, NULL);
if (open_val < 0)
{
LOG(VB_GENERAL, LOG_ERR, LOC +
@@ -2101,7 +2103,7 @@ int AvFormatDecoder::ScanStreams(bool novideo)
}
}
- if (enc->codec_type == CODEC_TYPE_SUBTITLE)
+ if (enc->codec_type == AVMEDIA_TYPE_SUBTITLE)
{
bool forced = ic->streams[i]->disposition & AV_DISPOSITION_FORCED;
int lang = GetSubtitleLanguage(subtitleStreamCount, i);
@@ -2118,7 +2120,7 @@ int AvFormatDecoder::ScanStreams(bool novideo)
.arg(iso639_key_toName(lang)).arg(lang));
}
- if (enc->codec_type == CODEC_TYPE_AUDIO)
+ if (enc->codec_type == AVMEDIA_TYPE_AUDIO)
{
int lang = GetAudioLanguage(audioStreamCount, i);
int channels = ic->streams[i]->codec->channels;
@@ -2239,9 +2241,8 @@ void AvFormatDecoder::DoFastForwardSeek(long long desiredFrame, bool &needflush)
int AvFormatDecoder::GetSubtitleLanguage(uint subtitle_index, uint stream_index)
{
(void)subtitle_index;
- AVMetadataTag *metatag =
- av_metadata_get(ic->streams[stream_index]->metadata,
- "language", NULL, 0);
+ AVDictionaryEntry *metatag =
+ av_dict_get(ic->streams[stream_index]->metadata, "language", NULL, 0);
return metatag ? get_canonical_lang(metatag->value) :
iso639_str3_to_key("und");
}
@@ -2372,8 +2373,6 @@ int get_avf_buffer(struct AVCodecContext *c, AVFrame *pic)
pic->opaque = frame;
pic->type = FF_BUFFER_TYPE_USER;
- pic->age = 256 * 256 * 256 * 64;
-
pic->reordered_opaque = c->reordered_opaque;
return 0;
@@ -2392,7 +2391,7 @@ void AvFormatDecoder::RemoveAudioStreams()
for (uint i = 0; i < ic->nb_streams;)
{
AVStream *st = ic->streams[i];
- if (st->codec->codec_type == CODEC_TYPE_AUDIO)
+ if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO)
{
av_remove_stream(ic, st->id, 0);
i--;
@@ -2438,8 +2437,6 @@ int get_avf_buffer_vdpau(struct AVCodecContext *c, AVFrame *pic)
pic->opaque = frame;
pic->type = FF_BUFFER_TYPE_USER;
- pic->age = 256 * 256 * 256 * 64;
-
frame->pix_fmt = c->pix_fmt;
#ifdef USING_VDPAU
@@ -2506,7 +2503,6 @@ int get_avf_buffer_dxva2(struct AVCodecContext *c, AVFrame *pic)
pic->reordered_opaque = c->reordered_opaque;
pic->opaque = frame;
pic->type = FF_BUFFER_TYPE_USER;
- pic->age = 256 * 256 * 256 *64;
frame->pix_fmt = c->pix_fmt;
#ifdef USING_DXVA2
@@ -2538,7 +2534,6 @@ int get_avf_buffer_vaapi(struct AVCodecContext *c, AVFrame *pic)
pic->linesize[3] = 0;
pic->opaque = frame;
pic->type = FF_BUFFER_TYPE_USER;
- pic->age = 256 * 256 * 256 * 64;
frame->pix_fmt = c->pix_fmt;
#ifdef USING_VAAPI
@@ -2815,7 +2810,7 @@ void AvFormatDecoder::MpegPreProcessPkt(AVStream *stream, AVPacket *pkt)
while (bufptr < bufend)
{
- bufptr = ff_find_start_code(bufptr, bufend, &start_code_state);
+ bufptr = avpriv_mpv_find_start_code(bufptr, bufend, &start_code_state);
float aspect_override = -1.0f;
if (ringBuffer->IsDVD())
@@ -2836,7 +2831,8 @@ void AvFormatDecoder::MpegPreProcessPkt(AVStream *stream, AVPacket *pkt)
uint width = seq->width() >> context->lowres;
uint height = seq->height() >> context->lowres;
- current_aspect = seq->aspect(context->sub_id == 1);
+ current_aspect = seq->aspect(context->codec_id ==
+ CODEC_ID_MPEG1VIDEO);
if (aspect_override > 0.0f)
current_aspect = aspect_override;
float seqFPS = seq->fps();
@@ -2881,14 +2877,14 @@ void AvFormatDecoder::MpegPreProcessPkt(AVStream *stream, AVPacket *pkt)
if (!seen_gop && seq_count > 1)
{
HandleGopStart(pkt, true);
- pkt->flags |= PKT_FLAG_KEY;
+ pkt->flags |= AV_PKT_FLAG_KEY;
}
}
else if (GOP_START == start_code_state)
{
HandleGopStart(pkt, true);
seen_gop = true;
- pkt->flags |= PKT_FLAG_KEY;
+ pkt->flags |= AV_PKT_FLAG_KEY;
}
}
}
@@ -2912,7 +2908,7 @@ bool AvFormatDecoder::H264PreProcessPkt(AVStream *stream, AVPacket *pkt)
if (nal_size)
{
- if (pkt->flags & PKT_FLAG_KEY)
+ if (pkt->flags & AV_PKT_FLAG_KEY)
HandleGopStart(pkt, false);
return true;
}
@@ -2981,7 +2977,7 @@ bool AvFormatDecoder::H264PreProcessPkt(AVStream *stream, AVPacket *pkt)
}
HandleGopStart(pkt, true);
- pkt->flags |= PKT_FLAG_KEY;
+ pkt->flags |= AV_PKT_FLAG_KEY;
}
return on_frame;
@@ -3002,7 +2998,7 @@ bool AvFormatDecoder::PreProcessVideoPacket(AVStream *curstream, AVPacket *pkt)
}
else
{
- if (pkt->flags & PKT_FLAG_KEY)
+ if (pkt->flags & AV_PKT_FLAG_KEY)
{
HandleGopStart(pkt, false);
seen_gop = true;
@@ -3018,7 +3014,7 @@ bool AvFormatDecoder::PreProcessVideoPacket(AVStream *curstream, AVPacket *pkt)
}
if (framesRead == 0 && !justAfterChange &&
- !(pkt->flags & PKT_FLAG_KEY))
+ !(pkt->flags & AV_PKT_FLAG_KEY))
{
av_free_packet(pkt);
return false;
@@ -3653,7 +3649,7 @@ void AvFormatDecoder::GetAttachmentData(uint trackNo, QByteArray &filename,
return;
int index = tracks[kTrackTypeAttachment][trackNo].av_stream_index;
- AVMetadataTag *tag = av_metadata_get(ic->streams[index]->metadata,
+ AVDictionaryEntry *tag = av_dict_get(ic->streams[index]->metadata,
"filename", NULL, 0);
if (tag)
filename = QByteArray(tag->value);
@@ -4106,11 +4102,17 @@ bool AvFormatDecoder::ProcessAudioPacket(AVStream *curstream, AVPacket *pkt,
ctx->channels = m_audio->GetMaxChannels();
}
+ AVFrame frame;
+ int got_frame = 0;
+
data_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
- ret = avcodec_decode_audio3(ctx, audioSamples,
- &data_size, &tmp_pkt);
- decoded_size = data_size;
- already_decoded = true;
+ ret = avcodec_decode_audio4(ctx, &frame, &got_frame, &tmp_pkt);
+ if (ret > 0 && got_frame)
+ {
+ decoded_size = data_size;
+ already_decoded = true;
+ memcpy(audioSamples, frame.extended_data[0], decoded_size);
+ }