[haiku-commits] haiku: hrev48081 - src/add-ons/media/plugins/ffmpeg build/jam/repositories/HaikuPorts

  • From: pulkomandy@xxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 24 Oct 2014 11:29:36 +0200 (CEST)

hrev48081 adds 2 changesets to branch 'master'
old head: 7a71a43eaa576a873e748d89ccda7286b5123865
new head: c8d6d0408f91924d56705a07dcfb8a7d4c4ff29a
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=c8d6d04+%5E7a71a43

----------------------------------------------------------------------------

84e7040: ffmpeg plugin: update to 0.11.5.

c8d6d04: Update to ffmpeg 0.11.5.
  
  I could not reproduce the issues in #8856 with this build. Let me know
  if you run into files that don't play anymore.

                                 [ Adrien Destugues <pulkomandy@xxxxxxxxx> ]

----------------------------------------------------------------------------

5 files changed, 37 insertions(+), 43 deletions(-)
build/jam/repositories/HaikuPorts/x86_gcc2       |  8 ++---
.../media/plugins/ffmpeg/AVCodecEncoder.cpp      | 28 +++++++--------
.../media/plugins/ffmpeg/AVFormatReader.cpp      |  4 +--
.../media/plugins/ffmpeg/AVFormatWriter.cpp      | 38 +++++++++-----------
src/add-ons/media/plugins/ffmpeg/gfx_conv_c.cpp  |  2 +-

############################################################################

Commit:      84e70401cd02f134e87d758785d5a5f252b3b1ab
URL:         http://cgit.haiku-os.org/haiku/commit/?id=84e7040
Author:      Adrien Destugues <pulkomandy@xxxxxxxxx>
Date:        Fri Oct 24 08:54:07 2014 UTC

ffmpeg plugin: update to 0.11.5.

----------------------------------------------------------------------------

diff --git a/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp 
b/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp
index 58b26cc..79db210 100644
--- a/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp
+++ b/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp
@@ -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];
diff --git a/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp 
b/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp
index f4b79b4..742976f 100644
--- a/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp
+++ b/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp
@@ -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)
diff --git a/src/add-ons/media/plugins/ffmpeg/AVFormatWriter.cpp 
b/src/add-ons/media/plugins/ffmpeg/AVFormatWriter.cpp
index e12a958..11e1a96 100644
--- a/src/add-ons/media/plugins/ffmpeg/AVFormatWriter.cpp
+++ b/src/add-ons/media/plugins/ffmpeg/AVFormatWriter.cpp
@@ -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;
diff --git a/src/add-ons/media/plugins/ffmpeg/gfx_conv_c.cpp 
b/src/add-ons/media/plugins/ffmpeg/gfx_conv_c.cpp
index 66c8238..3ca125a 100644
--- a/src/add-ons/media/plugins/ffmpeg/gfx_conv_c.cpp
+++ b/src/add-ons/media/plugins/ffmpeg/gfx_conv_c.cpp
@@ -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;
 

############################################################################

Revision:    hrev48081
Commit:      c8d6d0408f91924d56705a07dcfb8a7d4c4ff29a
URL:         http://cgit.haiku-os.org/haiku/commit/?id=c8d6d04
Author:      Adrien Destugues <pulkomandy@xxxxxxxxx>
Date:        Fri Oct 24 09:28:37 2014 UTC

Ticket:      https://dev.haiku-os.org/ticket/8856

Update to ffmpeg 0.11.5.

I could not reproduce the issues in #8856 with this build. Let me know
if you run into files that don't play anymore.

----------------------------------------------------------------------------

diff --git a/build/jam/repositories/HaikuPorts/x86_gcc2 
b/build/jam/repositories/HaikuPorts/x86_gcc2
index 6462949..12ac111 100644
--- a/build/jam/repositories/HaikuPorts/x86_gcc2
+++ b/build/jam/repositories/HaikuPorts/x86_gcc2
@@ -66,8 +66,8 @@ RemotePackageRepository HaikuPorts
        faad2_devel-2.7-1
        f1spirit-0.rc9.1615-1
        findutils-4.4.2-1
-       ffmpeg-0.11.5-1
-       ffmpeg_devel-0.11.5-1
+       ffmpeg-0.11.5-2
+       ffmpeg_devel-0.11.5-2
        flac-1.3.0-1
        flac_devel-1.3.0-1
        flex-2.5.39-1
@@ -372,8 +372,8 @@ RemotePackageRepository HaikuPorts
        expat_x86_devel-2.0.1-7
        faad2_x86-2.7-1
        faad2_x86_devel-2.7-1
-       ffmpeg_x86-0.10.14-1
-       ffmpeg_x86_devel-0.10.14-1
+       ffmpeg_x86-0.11.5-2
+       ffmpeg_x86_devel-0.11.5-2
        fitz_x86-1.1-1
        flac_x86-1.3.0-1
        flac_x86_devel-1.3.0-1


Other related posts: