patches for the sound build

This commit is contained in:
abveritas 2011-11-09 06:47:11 +00:00
parent bd30f69627
commit 1758118f2c
6 changed files with 463 additions and 9 deletions

View File

@ -16,11 +16,14 @@ makedepends=('pkgconfig' 'gstreamer0.10-base>=0.10.34' 'xvidcore' 'libdca' 'bzip
'schroedinger' 'libass' 'libvpx' 'gsm' 'libgme' 'rtmpdump' 'libsndfile' 'librsvg')
url="http://gstreamer.freedesktop.org/"
options=(!libtool !emptydirs)
source=(${url}/src/gst-plugins-bad/gst-plugins-bad-${pkgver}.tar.bz2)
md5sums=('9a2acee1f386f71247003d0d7090fb1c')
source=(${url}/src/gst-plugins-bad/gst-plugins-bad-${pkgver}.tar.bz2
gst-plugins-bad-0.10.22-mjpegtools2.0.patch)
md5sums=('9a2acee1f386f71247003d0d7090fb1c'
'd1e4ba414877909f4a3313e905412a61')
build() {
cd "${srcdir}/gst-plugins-bad-${pkgver}"
patch -p1 -i "${srcdir}/gst-plugins-bad-0.10.22-mjpegtools2.0.patch"
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
--disable-static --enable-experimental \
--with-package-name="GStreamer Bad Plugins (Chakra GNU/Linux)" \

View File

@ -0,0 +1,26 @@
From 407b02578689804dc6bc47e53be9e87cc1b25597 Mon Sep 17 00:00:00 2001
From: Götz Waschk <waschk@mandriva.org>
Date: Tue, 24 May 2011 13:42:44 +0000
Subject: mpeg2enc: support mjpegtools 2.0
This adds conditional includes for the renamed headers in mjpegtools 2.0.
Fixes: #650970.
---
diff --git a/ext/mpeg2enc/gstmpeg2encoder.cc b/ext/mpeg2enc/gstmpeg2encoder.cc
index acfda50..31f1a30 100644
--- a/ext/mpeg2enc/gstmpeg2encoder.cc
+++ b/ext/mpeg2enc/gstmpeg2encoder.cc
@@ -26,7 +26,10 @@
#include <mpegconsts.h>
#include <quantize.hh>
-#if GST_MJPEGTOOLS_API >= 10900
+#if GST_MJPEGTOOLS_API >= 10903
+#include <ontheflyratectlpass1.hh>
+#include <ontheflyratectlpass2.hh>
+#elif GST_MJPEGTOOLS_API >= 10900
#include <ontheflyratectl.hh>
#include <pass1ratectl.hh>
#include <pass2ratectl.hh>
--
cgit v0.9.0.2-2-gbebe

View File

@ -23,11 +23,15 @@ optdepends=('libao: for ao plugin'
'libid3tag: for mp3 plugin'
'wavpack: for wavpack plugin')
options=('!libtool')
source=(http://downloads.sourceforge.net/${pkgname}/${pkgname}-${pkgver}.tar.gz)
md5sums=('e9d35cf3b0f8878596e0b7c49f9e8302')
source=(http://downloads.sourceforge.net/${pkgname}/${pkgname}-${pkgver}.tar.gz
sox-14.3.2-ffmpeg.patch)
md5sums=('e9d35cf3b0f8878596e0b7c49f9e8302'
'217df87e92a3698ba1d7a78779ed72f2')
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
patch -p1 -i "${srcdir}/sox-14.3.2-ffmpeg.patch"
sed -i 's|man1/sox.1 soxeffect.7|man1/sox.1.gz soxeffect.7.gz|' Makefile.am
./configure --prefix=/usr \
--sysconfdir=/etc \
--with-dyn-default \

View File

@ -0,0 +1,39 @@
Index: sox-14.3.2/src/ffmpeg.c
===================================================================
--- sox-14.3.2.orig/src/ffmpeg.c
+++ sox-14.3.2/src/ffmpeg.c
@@ -91,7 +91,7 @@ static int stream_component_open(priv_t
if (!codec || avcodec_open(enc, codec) < 0)
return -1;
- if (enc->codec_type != CODEC_TYPE_AUDIO) {
+ if (enc->codec_type != AVMEDIA_TYPE_AUDIO) {
lsx_fail("ffmpeg CODEC %x is not an audio CODEC", enc->codec_type);
return -1;
}
@@ -182,7 +182,7 @@ static int startread(sox_format_t * ft)
/* Find audio stream (FIXME: allow different stream to be selected) */
for (i = 0; (unsigned)i < ffmpeg->ctxt->nb_streams; i++) {
AVCodecContext *enc = ffmpeg->ctxt->streams[i]->codec;
- if (enc->codec_type == CODEC_TYPE_AUDIO && ffmpeg->audio_index < 0) {
+ if (enc->codec_type == AVMEDIA_TYPE_AUDIO && ffmpeg->audio_index < 0) {
ffmpeg->audio_index = i;
break;
}
@@ -273,7 +273,7 @@ static AVStream *add_audio_stream(sox_fo
c = st->codec;
c->codec_id = codec_id;
- c->codec_type = CODEC_TYPE_AUDIO;
+ c->codec_type = AVMEDIA_TYPE_AUDIO;
/* put sample parameters */
c->bit_rate = 256000; /* FIXME: allow specification */
@@ -423,7 +423,7 @@ static size_t write_samples(sox_format_t
av_init_packet(&pkt);
pkt.size = avcodec_encode_audio(c, ffmpeg->audio_buf_aligned, AVCODEC_MAX_AUDIO_FRAME_SIZE, ffmpeg->samples);
pkt.pts = av_rescale_q(c->coded_frame->pts, c->time_base, ffmpeg->audio_st->time_base);
- pkt.flags |= PKT_FLAG_KEY;
+ pkt.flags |= AV_PKT_FLAG_KEY;
pkt.stream_index = ffmpeg->audio_st->index;
pkt.data = ffmpeg->audio_buf_aligned;

View File

@ -31,16 +31,18 @@ optdepends=('imagemagick: for using the imagemagick plugin' \
'aalib: for using the aalib plugin')
options=('!libtool')
source=(http://downloads.sourceforge.net/sourceforge/xine/${pkgname}-${pkgver}.tar.bz2
xine-lib-1.1.1-configure-no-mcpu-march.patch xine-lib-1.1.19-xvmc.patch)
md5sums=('a410a0f0617e1d6309f0cbe907f73f8a' '9776df4eb54d2f1f68d8268adbc3b5c2'\
'8662fb124870b1dd7effe4ff5e2a2e3d')
sha1sums=('5afcc28c5cf2bdaab99d951960f6587797e1e5a0' '121a8358d7919b2e51067412373f52848290338a'\
'920bf27e6e3523dfe4cc9c802ff713e9688a3f34')
xine-lib-1.1.1-configure-no-mcpu-march.patch xine-lib-1.1.19-xvmc.patch
xine-lib-1.1.19-ffmpeg.patch)
sha1sums=('5afcc28c5cf2bdaab99d951960f6587797e1e5a0'
'121a8358d7919b2e51067412373f52848290338a'
'920bf27e6e3523dfe4cc9c802ff713e9688a3f34'
'5c72832408877be2fee22cccaf4d630b4c0843fe')
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
patch -p0 < ../xine-lib-1.1.1-configure-no-mcpu-march.patch
patch -p0 < ../xine-lib-1.1.19-xvmc.patch
patch -p1 -i "${srcdir}/xine-lib-1.1.19-ffmpeg.patch"
sed -i 's|linux/videodev.h|libv4l1-videodev.h|' \
configure.ac src/input/input_v4l.c src/video_out/video_out_syncfb.h

View File

@ -0,0 +1,380 @@
diff -r 717450d734f7 src/combined/ffmpeg/ff_audio_decoder.c
--- a/src/combined/ffmpeg/ff_audio_decoder.c Mon May 16 15:49:02 2011 +0100
+++ b/src/combined/ffmpeg/ff_audio_decoder.c Mon May 16 19:46:49 2011 -0400
@@ -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 -r 717450d734f7 src/combined/ffmpeg/ff_video_decoder.c
--- a/src/combined/ffmpeg/ff_video_decoder.c Mon May 16 15:49:02 2011 +0100
+++ b/src/combined/ffmpeg/ff_video_decoder.c Mon May 16 19:46:49 2011 -0400
@@ -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 -r 717450d734f7 src/post/planar/pp.c
--- a/src/post/planar/pp.c Mon May 16 15:49:02 2011 +0100
+++ b/src/post/planar/pp.c Mon May 16 19:46:49 2011 -0400
@@ -35,6 +35,12 @@
# include <libpostproc/postprocess.h>
#endif
+#if LIBPOSTPROC_VERSION_MAJOR < 52
+# define pp_context pp_context_t
+# define pp_mode pp_mode_t
+# define PP_PARAMETERS_T
+#endif
+
#define PP_STRING_SIZE 256 /* size of pp mode string (including all options) */
/* plugin class initialization function */
@@ -76,14 +82,15 @@
/* libpostproc specific stuff */
int pp_flags;
- pp_context_t *pp_context;
- pp_mode_t *pp_mode;
+ pp_context *our_context;
+ pp_mode *our_mode;
pthread_mutex_t lock;
};
static int set_parameters (xine_post_t *this_gen, void *param_gen) {
+#ifdef PP_PARAMETERS_T
post_plugin_pp_t *this = (post_plugin_pp_t *)this_gen;
pp_parameters_t *param = (pp_parameters_t *)param_gen;
@@ -92,17 +99,18 @@
memcpy( &this->params, param, sizeof(pp_parameters_t) );
pthread_mutex_unlock (&this->lock);
-
+#endif
return 1;
}
static int get_parameters (xine_post_t *this_gen, void *param_gen) {
+#ifdef PP_PARAMETERS_T
post_plugin_pp_t *this = (post_plugin_pp_t *)this_gen;
pp_parameters_t *param = (pp_parameters_t *)param_gen;
memcpy( param, &this->params, sizeof(pp_parameters_t) );
-
+#endif
return 1;
}
@@ -202,8 +210,8 @@
if(cpu_caps & MM_ACCEL_X86_3DNOW)
this->pp_flags |= PP_CPU_CAPS_3DNOW;
- this->pp_mode = NULL;
- this->pp_context = NULL;
+ this->our_mode = NULL;
+ this->our_context = NULL;
pthread_mutex_init (&this->lock, NULL);
@@ -248,13 +256,13 @@
post_plugin_pp_t *this = (post_plugin_pp_t *)this_gen;
if (_x_post_dispose(this_gen)) {
- 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;
}
free(this);
}
@@ -304,7 +312,7 @@
pthread_mutex_lock (&this->lock);
- if( !this->pp_context ||
+ if( !this->our_context ||
this->frame_width != yv12_frame->width ||
this->frame_height != yv12_frame->height ) {
@@ -312,32 +320,32 @@
this->frame_height = yv12_frame->height;
pp_flags = this->pp_flags;
- if(this->pp_context)
- pp_free_context(this->pp_context);
+ if(this->our_context)
+ pp_free_context(this->our_context);
- this->pp_context = pp_get_context(frame->width, frame->height, pp_flags);
+ this->our_context = pp_get_context(frame->width, frame->height, pp_flags);
- 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_mode)
- this->pp_mode = pp_get_mode_by_name_and_quality(this->params.mode,
+ if(!this->our_mode)
+ this->our_mode = pp_get_mode_by_name_and_quality(this->params.mode,
this->params.quality);
- if(this->pp_mode)
+ if(this->our_mode)
pp_postprocess(yv12_frame->base, yv12_frame->pitches,
out_frame->base, out_frame->pitches,
(frame->width+7)&(~7), frame->height,
NULL, 0,
- this->pp_mode, this->pp_context,
+ this->our_mode, this->our_context,
0 /*this->av_frame->pict_type*/);
pthread_mutex_unlock (&this->lock);
- if(this->pp_mode) {
+ if(this->our_mode) {
skip = out_frame->draw(out_frame, stream);
_x_post_frame_copy_up(frame, out_frame);
} else {