ffmpeg plugin: update to 0.11.5.

This commit is contained in:
Adrien Destugues 2014-10-24 10:54:07 +02:00
parent 7a71a43eaa
commit 84e70401cd
4 changed files with 33 additions and 39 deletions

View File

@ -368,19 +368,19 @@ AVCodecEncoder::_Setup()
// sample format
switch (fInputFormat.u.raw_audio.format) {
case media_raw_audio_format::B_AUDIO_FLOAT:
fContext->sample_fmt = SAMPLE_FMT_FLT;
fContext->sample_fmt = AV_SAMPLE_FMT_FLT;
break;
case media_raw_audio_format::B_AUDIO_DOUBLE:
fContext->sample_fmt = SAMPLE_FMT_DBL;
fContext->sample_fmt = AV_SAMPLE_FMT_DBL;
break;
case media_raw_audio_format::B_AUDIO_INT:
fContext->sample_fmt = SAMPLE_FMT_S32;
fContext->sample_fmt = AV_SAMPLE_FMT_S32;
break;
case media_raw_audio_format::B_AUDIO_SHORT:
fContext->sample_fmt = SAMPLE_FMT_S16;
fContext->sample_fmt = AV_SAMPLE_FMT_S16;
break;
case media_raw_audio_format::B_AUDIO_UCHAR:
fContext->sample_fmt = SAMPLE_FMT_U8;
fContext->sample_fmt = AV_SAMPLE_FMT_U8;
break;
case media_raw_audio_format::B_AUDIO_CHAR:
@ -393,28 +393,28 @@ AVCodecEncoder::_Setup()
switch (fInputFormat.u.raw_audio.channel_count) {
default:
case 2:
fContext->channel_layout = CH_LAYOUT_STEREO;
fContext->channel_layout = AV_CH_LAYOUT_STEREO;
break;
case 1:
fContext->channel_layout = CH_LAYOUT_MONO;
fContext->channel_layout = AV_CH_LAYOUT_MONO;
break;
case 3:
fContext->channel_layout = CH_LAYOUT_SURROUND;
fContext->channel_layout = AV_CH_LAYOUT_SURROUND;
break;
case 4:
fContext->channel_layout = CH_LAYOUT_QUAD;
fContext->channel_layout = AV_CH_LAYOUT_QUAD;
break;
case 5:
fContext->channel_layout = CH_LAYOUT_5POINT0;
fContext->channel_layout = AV_CH_LAYOUT_5POINT0;
break;
case 6:
fContext->channel_layout = CH_LAYOUT_5POINT1;
fContext->channel_layout = AV_CH_LAYOUT_5POINT1;
break;
case 8:
fContext->channel_layout = CH_LAYOUT_7POINT1;
fContext->channel_layout = AV_CH_LAYOUT_7POINT1;
break;
case 10:
fContext->channel_layout = CH_LAYOUT_7POINT1_WIDE;
fContext->channel_layout = AV_CH_LAYOUT_7POINT1_WIDE;
break;
}
} else {
@ -444,7 +444,7 @@ AVCodecEncoder::_Setup()
576000, 640000
};
int diff = wantedBitRate;
for (int i = 0; i < sizeof(kBitRates) / sizeof(int); i++) {
for (unsigned int i = 0; i < sizeof(kBitRates) / sizeof(int); i++) {
int currentDiff = abs(wantedBitRate - kBitRates[i]);
if (currentDiff < diff) {
fContext->bit_rate = kBitRates[i];

View File

@ -51,7 +51,7 @@ static const int64 kNoPTSValue = AV_NOPTS_VALUE;
static uint32
avformat_to_beos_byte_order(SampleFormat format)
avformat_to_beos_byte_order(AVSampleFormat format)
{
// TODO: Huh?
return B_MEDIA_HOST_ENDIAN;
@ -66,7 +66,7 @@ avdictionary_to_message(AVDictionary* dictionary, BMessage* message)
AVDictionaryEntry* entry = NULL;
while ((entry = av_dict_get(dictionary, "", entry,
AV_METADATA_IGNORE_SUFFIX))) {
AV_DICT_IGNORE_SUFFIX))) {
// convert entry keys into something more meaningful using the names from
// id3v2.c
if (strcmp(entry->key, "TALB") == 0 || strcmp(entry->key, "TAL") == 0)

View File

@ -173,19 +173,19 @@ AVFormatWriter::StreamCookie::Init(media_format* format,
fStream->codec->channels = format->u.raw_audio.channel_count;
switch (format->u.raw_audio.format) {
case media_raw_audio_format::B_AUDIO_FLOAT:
fStream->codec->sample_fmt = SAMPLE_FMT_FLT;
fStream->codec->sample_fmt = AV_SAMPLE_FMT_FLT;
break;
case media_raw_audio_format::B_AUDIO_DOUBLE:
fStream->codec->sample_fmt = SAMPLE_FMT_DBL;
fStream->codec->sample_fmt = AV_SAMPLE_FMT_DBL;
break;
case media_raw_audio_format::B_AUDIO_INT:
fStream->codec->sample_fmt = SAMPLE_FMT_S32;
fStream->codec->sample_fmt = AV_SAMPLE_FMT_S32;
break;
case media_raw_audio_format::B_AUDIO_SHORT:
fStream->codec->sample_fmt = SAMPLE_FMT_S16;
fStream->codec->sample_fmt = AV_SAMPLE_FMT_S16;
break;
case media_raw_audio_format::B_AUDIO_UCHAR:
fStream->codec->sample_fmt = SAMPLE_FMT_U8;
fStream->codec->sample_fmt = AV_SAMPLE_FMT_U8;
break;
case media_raw_audio_format::B_AUDIO_CHAR:
@ -198,28 +198,28 @@ AVFormatWriter::StreamCookie::Init(media_format* format,
switch (format->u.raw_audio.channel_count) {
default:
case 2:
fStream->codec->channel_layout = CH_LAYOUT_STEREO;
fStream->codec->channel_layout = AV_CH_LAYOUT_STEREO;
break;
case 1:
fStream->codec->channel_layout = CH_LAYOUT_MONO;
fStream->codec->channel_layout = AV_CH_LAYOUT_MONO;
break;
case 3:
fStream->codec->channel_layout = CH_LAYOUT_SURROUND;
fStream->codec->channel_layout = AV_CH_LAYOUT_SURROUND;
break;
case 4:
fStream->codec->channel_layout = CH_LAYOUT_QUAD;
fStream->codec->channel_layout = AV_CH_LAYOUT_QUAD;
break;
case 5:
fStream->codec->channel_layout = CH_LAYOUT_5POINT0;
fStream->codec->channel_layout = AV_CH_LAYOUT_5POINT0;
break;
case 6:
fStream->codec->channel_layout = CH_LAYOUT_5POINT1;
fStream->codec->channel_layout = AV_CH_LAYOUT_5POINT1;
break;
case 8:
fStream->codec->channel_layout = CH_LAYOUT_7POINT1;
fStream->codec->channel_layout = AV_CH_LAYOUT_7POINT1;
break;
case 10:
fStream->codec->channel_layout = CH_LAYOUT_7POINT1_WIDE;
fStream->codec->channel_layout = AV_CH_LAYOUT_7POINT1_WIDE;
break;
}
} else {
@ -365,7 +365,7 @@ AVFormatWriter::Init(const media_file_format* fileFormat)
// Allocate I/O context and initialize it with buffer
// and hook functions, pass ourself as cookie.
fIOContext = av_alloc_put_byte(buffer, kIOBufferSize, 1, this,
fIOContext = avio_alloc_context(buffer, kIOBufferSize, 1, this,
0, _Write, _Seek);
if (fIOContext == NULL) {
TRACE("av_alloc_put_byte() failed!\n");
@ -411,12 +411,6 @@ AVFormatWriter::CommitHeader()
if (fHeaderWritten)
return B_NOT_ALLOWED;
// According to output_example.c, the output parameters must be set even
// if none are specified. In the example, this call is used after the
// streams have been created.
if (av_set_parameters(fContext, NULL) < 0)
return B_ERROR;
#if OPEN_CODEC_CONTEXT
for (unsigned i = 0; i < fContext->nb_streams; i++) {
AVStream* stream = fContext->streams[i];
@ -434,9 +428,9 @@ AVFormatWriter::CommitHeader()
}
#endif
int result = av_write_header(fContext);
int result = avformat_write_header(fContext, NULL);
if (result < 0)
TRACE(" av_write_header(): %d\n", result);
TRACE(" avformat_write_header(): %d\n", result);
// We need to close the codecs we opened, even in case of failure.
fHeaderWritten = true;

View File

@ -181,7 +181,7 @@ gfx_conv_YCbCr422_RGB32_c(AVFrame *in, AVFrame *out, int width, int height)
int uv_index;
for (uint32 i = 0; i < height; i++) {
for (int32 i = 0; i < height; i++) {
uv_index = 0;