Permalink
Browse files

Make it all compile...

  • Loading branch information...
Beirdo committed Apr 2, 2012
1 parent 940dd94 commit 6c3653cd378aacef10b7706d8b7f71beae41274c
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
@@ -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()
@@ -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;
@@ -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);
@@ -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;
@@ -274,7 +274,9 @@ bool CdDecoder::initialize()
setCDSpeed(2);
return m_inited = true;
m_inited = true;
return m_inited;
}
// pure virtual
Oops, something went wrong.

0 comments on commit 6c3653c

Please sign in to comment.