From 7579386f680d9c4ba70cfe47af2f1354fbb9db685e06026a749070c15c7717ba Mon Sep 17 00:00:00 2001 From: Manfred Tremmel Date: Sat, 28 May 2011 17:06:20 +0000 Subject: [PATCH 1/2] xine-lib: patch added to build against new abi ffmpeg (only non cribbled version) OBS-URL: https://build.opensuse.org/package/show/multimedia:xine/xine-lib?expand=0&rev=39 --- xine-lib-1.1.19-ffmpeg_abi_change.diff | 241 +++++++++++++++++++++++++ xine-lib.changes | 5 + xine-lib.spec | 4 +- 3 files changed, 249 insertions(+), 1 deletion(-) create mode 100644 xine-lib-1.1.19-ffmpeg_abi_change.diff diff --git a/xine-lib-1.1.19-ffmpeg_abi_change.diff b/xine-lib-1.1.19-ffmpeg_abi_change.diff new file mode 100644 index 0000000..c4bebad --- /dev/null +++ b/xine-lib-1.1.19-ffmpeg_abi_change.diff @@ -0,0 +1,241 @@ +diff -ur xine-lib-1.1.19.orig/src/combined/ffmpeg/ff_audio_decoder.c xine-lib-1.1.19/src/combined/ffmpeg/ff_audio_decoder.c +--- xine-lib-1.1.19.orig/src/combined/ffmpeg/ff_audio_decoder.c 2010-03-23 16:41:49.000000000 +0100 ++++ xine-lib-1.1.19/src/combined/ffmpeg/ff_audio_decoder.c 2011-05-17 20:23:15.000000000 +0200 +@@ -46,6 +46,12 @@ + + #define AUDIOBUFSIZE (64 * 1024) + ++#if LIBAVCODEC_VERSION_MAJOR >= 53 || (LIBAVCODEC_VERSION_MAJOR == 52 && LIBAVCODEC_VERSION_MINOR >= 32) ++# define AVAUDIO 3 ++#else ++# define AVAUDIO 2 ++#endif ++ + typedef struct { + audio_decoder_class_t decoder_class; + } ff_audio_class_t; +@@ -255,6 +261,9 @@ + buf->decoder_info[2]); + + } else if (!(buf->decoder_flags & BUF_FLAG_SPECIAL)) { ++#if AVAUDIO > 2 ++ AVPacket avpkt; ++#endif + + if( !this->decoder_ok ) { + if ( ! this->context || ! this->codec ) { +@@ -286,11 +295,21 @@ + if (!this->output_open) { + if (!this->audio_bits || !this->audio_sample_rate || !this->audio_channels) { + decode_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE; ++#if AVAUDIO > 2 ++ av_init_packet (&avpkt); ++ avpkt.data = (uint8_t *)&this->buf[0]; ++ avpkt.size = this->size; ++ avpkt.flags = AV_PKT_FLAG_KEY; ++ avcodec_decode_audio3 (this->context, ++ (int16_t *)this->decode_buffer, ++ &decode_buffer_size, &avpkt); ++#else + avcodec_decode_audio2 (this->context, + (int16_t *)this->decode_buffer, + &decode_buffer_size, + &this->buf[0], + this->size); ++#endif + this->audio_bits = this->context->bits_per_sample; + this->audio_sample_rate = this->context->sample_rate; + this->audio_channels = this->context->channels; +@@ -311,12 +330,21 @@ + offset = 0; + while (this->size>0) { + decode_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE; ++#if AVAUDIO > 2 ++ av_init_packet (&avpkt); ++ avpkt.data = (uint8_t *)&this->buf[offset]; ++ avpkt.size = this->size; ++ avpkt.flags = AV_PKT_FLAG_KEY; ++ bytes_consumed = avcodec_decode_audio3 (this->context, ++ (int16_t *)this->decode_buffer, ++ &decode_buffer_size, &avpkt); ++#else + bytes_consumed = avcodec_decode_audio2 (this->context, + (int16_t *)this->decode_buffer, + &decode_buffer_size, + &this->buf[offset], + this->size); +- ++#endif + if (bytes_consumed<0) { + xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, + "ffmpeg_audio_dec: error decompressing audio frame\n"); +diff -ur xine-lib-1.1.19.orig/src/combined/ffmpeg/ff_video_decoder.c xine-lib-1.1.19/src/combined/ffmpeg/ff_video_decoder.c +--- xine-lib-1.1.19.orig/src/combined/ffmpeg/ff_video_decoder.c 2010-03-10 20:07:15.000000000 +0100 ++++ xine-lib-1.1.19/src/combined/ffmpeg/ff_video_decoder.c 2011-05-17 20:23:15.000000000 +0200 +@@ -58,6 +58,14 @@ + + #define ENABLE_DIRECT_RENDERING + ++#if LIBAVCODEC_VERSION_MAJOR >= 53 || (LIBAVCODEC_VERSION_MAJOR == 52 && LIBAVCODEC_VERSION_MINOR >= 32) ++# define AVVIDEO 2 ++#else ++# define AVVIDEO 1 ++# define pp_context pp_context_t ++# define pp_mode pp_mode_t ++#endif ++ + /* reordered_opaque appeared in libavcodec 51.68.0 */ + #define AVCODEC_HAS_REORDERED_OPAQUE + #if LIBAVCODEC_VERSION_INT < 0x334400 +@@ -116,8 +124,8 @@ + + int pp_quality; + int pp_flags; +- pp_context_t *pp_context; +- pp_mode_t *pp_mode; ++ pp_context *our_context; ++ pp_mode *our_mode; + + /* mpeg-es parsing */ + mpeg_parser_t *mpeg_parser; +@@ -444,23 +452,23 @@ + this->pp_quality = this->class->pp_quality; + + if(this->pp_available && this->pp_quality) { +- if(!this->pp_context && this->context) +- this->pp_context = pp_get_context(this->context->width, this->context->height, ++ if(!this->our_context && this->context) ++ this->our_context = pp_get_context(this->context->width, this->context->height, + this->pp_flags); +- if(this->pp_mode) +- pp_free_mode(this->pp_mode); ++ if(this->our_mode) ++ pp_free_mode(this->our_mode); + +- this->pp_mode = pp_get_mode_by_name_and_quality("hb:a,vb:a,dr:a", ++ this->our_mode = pp_get_mode_by_name_and_quality("hb:a,vb:a,dr:a", + this->pp_quality); + } else { +- if(this->pp_mode) { +- pp_free_mode(this->pp_mode); +- this->pp_mode = NULL; ++ if(this->our_mode) { ++ pp_free_mode(this->our_mode); ++ this->our_mode = NULL; + } + +- if(this->pp_context) { +- pp_free_context(this->pp_context); +- this->pp_context = NULL; ++ if(this->our_context) { ++ pp_free_context(this->our_context); ++ this->our_context = NULL; + } + } + } +@@ -1055,12 +1063,26 @@ + } + + /* skip decoding b frames if too late */ ++#if AVVIDEO > 1 ++ this->context->skip_frame = (this->skipframes > 0) ? AVDISCARD_NONREF : AVDISCARD_DEFAULT; ++#else + this->context->hurry_up = (this->skipframes > 0); ++#endif + + lprintf("avcodec_decode_video: size=%d\n", this->mpeg_parser->buffer_size); ++#if AVVIDEO > 1 ++ AVPacket avpkt; ++ av_init_packet(&avpkt); ++ avpkt.data = (uint8_t *)this->mpeg_parser->chunk_buffer; ++ avpkt.size = this->mpeg_parser->buffer_size; ++ avpkt.flags = AV_PKT_FLAG_KEY; ++ len = avcodec_decode_video2 (this->context, this->av_frame, ++ &got_picture, &avpkt); ++#else + len = avcodec_decode_video (this->context, this->av_frame, + &got_picture, this->mpeg_parser->chunk_buffer, + this->mpeg_parser->buffer_size); ++#endif + lprintf("avcodec_decode_video: decoded_size=%d, got_picture=%d\n", + len, got_picture); + len = current - buf->content - offset; +@@ -1112,7 +1134,13 @@ + + } else { + +- if (this->context->hurry_up) { ++ if ( ++#if AVVIDEO > 1 ++ this->context->skip_frame != AVDISCARD_DEFAULT ++#else ++ this->context->hurry_up ++#endif ++ ) { + /* skipped frame, output a bad frame */ + img = this->stream->video_out->get_frame (this->stream->video_out, + this->bih.biWidth, +@@ -1304,13 +1332,25 @@ + got_picture = 0; + } else { + /* skip decoding b frames if too late */ ++#if AVVIDEO > 1 ++ this->context->skip_frame = (this->skipframes > 0) ? AVDISCARD_NONREF : AVDISCARD_DEFAULT; ++#else + this->context->hurry_up = (this->skipframes > 0); +- ++#endif + lprintf("buffer size: %d\n", this->size); ++#if AVVIDEO > 1 ++ AVPacket avpkt; ++ av_init_packet(&avpkt); ++ avpkt.data = (uint8_t *)&chunk_buf[offset]; ++ avpkt.size = this->size; ++ avpkt.flags = AV_PKT_FLAG_KEY; ++ len = avcodec_decode_video2 (this->context, this->av_frame, ++ &got_picture, &avpkt); ++#else + len = avcodec_decode_video (this->context, this->av_frame, + &got_picture, &chunk_buf[offset], + this->size); +- ++#endif + #ifdef AVCODEC_HAS_REORDERED_OPAQUE + /* reset consumed pts value */ + this->context->reordered_opaque = ff_tag_pts(this, 0); +@@ -1432,7 +1472,7 @@ + img->base, img->pitches, + img->width, img->height, + this->av_frame->qscale_table, this->av_frame->qstride, +- this->pp_mode, this->pp_context, ++ this->our_mode, this->our_context, + this->av_frame->pict_type); + + } else if (!this->av_frame->opaque) { +@@ -1676,11 +1716,11 @@ + free(this->buf); + this->buf = NULL; + +- if(this->pp_context) +- pp_free_context(this->pp_context); ++ if(this->our_context) ++ pp_free_context(this->our_context); + +- if(this->pp_mode) +- pp_free_mode(this->pp_mode); ++ if(this->our_mode) ++ pp_free_mode(this->our_mode); + + mpeg_parser_dispose(this->mpeg_parser); + +@@ -1721,8 +1761,8 @@ + this->aspect_ratio = 0; + + this->pp_quality = 0; +- this->pp_context = NULL; +- this->pp_mode = NULL; ++ this->our_context = NULL; ++ this->our_mode = NULL; + + this->mpeg_parser = NULL; + diff --git a/xine-lib.changes b/xine-lib.changes index 90bb3f6..43f30d2 100644 --- a/xine-lib.changes +++ b/xine-lib.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sat May 28 17:09:00 CET 2011 - Manfred.Tremmel@iiv.de + +- included a patch to build against new ffmpeg abi + ------------------------------------------------------------------- Thu Nov 18 10:04:52 UTC 2010 - coolo@novell.com diff --git a/xine-lib.spec b/xine-lib.spec index 4a0b48e..c0445fd 100644 --- a/xine-lib.spec +++ b/xine-lib.spec @@ -101,7 +101,7 @@ BuildRequires: DirectFB BuildRequires: libmodplug-devel %endif Version: 1.1.19 -Release: 1 +Release: 2 # bug437293 %ifarch ppc64 Obsoletes: xine-lib-64bit @@ -138,6 +138,7 @@ Patch73: xine-lib-%{version}-assert.patch Patch74: xine-configure.diff # *** Only working for noncrippled source Patch80: xine-lib-various-noncrippled.diff +Patch81: xine-lib-%{version}-ffmpeg_abi_change.diff %description xine is a free multimedia player. It plays back CDs, DVDs, and VCDs. It @@ -656,6 +657,7 @@ sed -i 's|^noinst_HEADERS = input_vdr.h|xineinclude_HEADERS = input_vdr.h|' src/ %else # Only apply to uncrippled source %patch80 +%patch81 -p1 %endif %patch72 -p1 %patch73 -p1 From 2a847261a4d8ed8265f6d59caebc95af1f191d928d91363d4cc86b38632b4f87 Mon Sep 17 00:00:00 2001 From: Manfred Tremmel Date: Thu, 7 Jul 2011 18:17:56 +0000 Subject: [PATCH 2/2] Accepting request 75620 from home:namtrac:branches:multimedia:xine - Add xine-lib-v4l-2.6.38.patch: use the new v4l interface OBS-URL: https://build.opensuse.org/request/show/75620 OBS-URL: https://build.opensuse.org/package/show/multimedia:xine/xine-lib?expand=0&rev=40 --- xine-lib-v4l-2.6.38.patch | 22 ++++++++++++++++++++++ xine-lib.changes | 5 +++++ xine-lib.spec | 9 +++++++++ 3 files changed, 36 insertions(+) create mode 100644 xine-lib-v4l-2.6.38.patch diff --git a/xine-lib-v4l-2.6.38.patch b/xine-lib-v4l-2.6.38.patch new file mode 100644 index 0000000..ad7c85c --- /dev/null +++ b/xine-lib-v4l-2.6.38.patch @@ -0,0 +1,22 @@ +--- configure.ac.orig 2011-07-07 10:45:26.462089794 +0200 ++++ configure.ac 2011-07-07 10:46:04.415089790 +0200 +@@ -682,7 +682,7 @@ + have_v4l=no + have_v4l2=no + if test "x$enable_v4l" != "xno"; then +- AC_CHECK_HEADERS([linux/videodev.h], [have_v4l=yes], []) ++ AC_CHECK_HEADERS([libv4l1-videodev.h], [have_v4l=yes], []) + AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h sys/videodev2.h], [have_v4l2=yes], []) + AC_CHECK_HEADERS([asm/types.h]) + if test "x$enable_v4l" = "xyes" && test "x$have_v4l$have_v4l2" = "xnono"; then +--- src/input/input_v4l.c 2010-03-09 23:17:05.000000000 +0100 ++++ src/input/input_v4l.c 2011-07-07 10:46:27.694089788 +0200 +@@ -47,7 +47,7 @@ + */ + #define _LINUX_TIME_H + +-#include ++#include + #include + #include + #include diff --git a/xine-lib.changes b/xine-lib.changes index 43f30d2..cbcc73a 100644 --- a/xine-lib.changes +++ b/xine-lib.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Jul 7 08:49:59 UTC 2011 - idonmez@novell.com + +- Add xine-lib-v4l-2.6.38.patch: use the new v4l interface + ------------------------------------------------------------------- Sat May 28 17:09:00 CET 2011 - Manfred.Tremmel@iiv.de diff --git a/xine-lib.spec b/xine-lib.spec index c0445fd..c4a2600 100644 --- a/xine-lib.spec +++ b/xine-lib.spec @@ -54,9 +54,13 @@ BuildRequires: libcdio-devel libdrm-devel libmng-devel libsmbclient BuildRequires: Mesa-devel libsmbclient-devel libtheora-devel libvorbis-devel BuildRequires: readline-devel update-desktop-files vcdimager-devel BuildRequires: speex-devel +%if 0%{suse_version} >= 1210 +BuildRequires: libv4l-devel >= 0.8.4 +%else %if 0%{suse_version} >= 1110 BuildRequires: libv4l-devel %endif +%endif %if 0%{suse_version} >= 1030 BuildRequires: lirc-devel %else @@ -136,6 +140,7 @@ Patch71: xine-lib-%{version}-demuxcheckfor_mad_ffmpeg.patch Patch72: xine-lib-%{version}-install-plugins-helper.diff Patch73: xine-lib-%{version}-assert.patch Patch74: xine-configure.diff +Patch75: xine-lib-v4l-2.6.38.patch # *** Only working for noncrippled source Patch80: xine-lib-various-noncrippled.diff Patch81: xine-lib-%{version}-ffmpeg_abi_change.diff @@ -662,6 +667,10 @@ sed -i 's|^noinst_HEADERS = input_vdr.h|xineinclude_HEADERS = input_vdr.h|' src/ %patch72 -p1 %patch73 -p1 %patch74 -p1 +%if 0%{suse_version} >= 1210 +%patch75 +%endif + rm -f m4/libtool15.m4 %build