- make xine-lib's AAC decoder use libfaad from the audio/faad port

- bump PKGNAME

ok naddy@
This commit is contained in:
jakemsr 2007-09-04 00:44:26 +00:00
parent 4be3b741a6
commit 5a015ce4d7
3 changed files with 307 additions and 2 deletions

View File

@ -1,10 +1,10 @@
# $OpenBSD: Makefile,v 1.15 2007/07/14 08:53:43 jakemsr Exp $ # $OpenBSD: Makefile,v 1.16 2007/09/04 00:44:26 jakemsr Exp $
COMMENT= "multimedia decoding library" COMMENT= "multimedia decoding library"
V= 1.1.7 V= 1.1.7
DISTNAME= xine-lib-${V} DISTNAME= xine-lib-${V}
PKGNAME= ${DISTNAME}p0 PKGNAME= ${DISTNAME}p1
EXTRACT_SUFX= .tar.bz2 EXTRACT_SUFX= .tar.bz2
CATEGORIES= multimedia CATEGORIES= multimedia
SHARED_LIBS= xine 18.1 SHARED_LIBS= xine 18.1
@ -34,6 +34,7 @@ LIB_DEPENDS= FLAC.>=5::audio/flac \
a52::audio/liba52 \ a52::audio/liba52 \
avcodec.>=7,postproc.>=7::graphics/ffmpeg \ avcodec.>=7,postproc.>=7::graphics/ffmpeg \
dvdnav.>=5::multimedia/libdvdnav \ dvdnav.>=5::multimedia/libdvdnav \
faad.>=1::audio/faad \
mad.>=2::audio/libmad \ mad.>=2::audio/libmad \
mng.>=3::graphics/libmng \ mng.>=3::graphics/libmng \
ogg.>=5::audio/libogg \ ogg.>=5::audio/libogg \

View File

@ -0,0 +1,147 @@
$OpenBSD: patch-src_libfaad_Makefile_in,v 1.1 2007/09/04 00:44:26 jakemsr Exp $
--- src/libfaad/Makefile.in.orig Fri Aug 31 22:17:16 2007
+++ src/libfaad/Makefile.in Fri Aug 31 22:21:26 2007
@@ -71,43 +71,7 @@ xineplugLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(xineplug_LTLIBRARIES)
am__DEPENDENCIES_1 = $(top_builddir)/src/xine-engine/libxine.la
xineplug_decode_faad_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
-am_xineplug_decode_faad_la_OBJECTS = xineplug_decode_faad_la-bits.lo \
- xineplug_decode_faad_la-cfft.lo \
- xineplug_decode_faad_la-common.lo \
- xineplug_decode_faad_la-decoder.lo \
- xineplug_decode_faad_la-drc.lo \
- xineplug_decode_faad_la-drm_dec.lo \
- xineplug_decode_faad_la-error.lo \
- xineplug_decode_faad_la-filtbank.lo \
- xineplug_decode_faad_la-hcr.lo \
- xineplug_decode_faad_la-huffman.lo \
- xineplug_decode_faad_la-ic_predict.lo \
- xineplug_decode_faad_la-is.lo \
- xineplug_decode_faad_la-lt_predict.lo \
- xineplug_decode_faad_la-mdct.lo xineplug_decode_faad_la-mp4.lo \
- xineplug_decode_faad_la-ms.lo \
- xineplug_decode_faad_la-output.lo \
- xineplug_decode_faad_la-pns.lo \
- xineplug_decode_faad_la-ps_dec.lo \
- xineplug_decode_faad_la-ps_syntax.lo \
- xineplug_decode_faad_la-pulse.lo \
- xineplug_decode_faad_la-rvlc.lo \
- xineplug_decode_faad_la-sbr_dct.lo \
- xineplug_decode_faad_la-sbr_dec.lo \
- xineplug_decode_faad_la-sbr_e_nf.lo \
- xineplug_decode_faad_la-sbr_fbt.lo \
- xineplug_decode_faad_la-sbr_hfadj.lo \
- xineplug_decode_faad_la-sbr_hfgen.lo \
- xineplug_decode_faad_la-sbr_huff.lo \
- xineplug_decode_faad_la-sbr_qmf.lo \
- xineplug_decode_faad_la-sbr_syntax.lo \
- xineplug_decode_faad_la-sbr_tf_grid.lo \
- xineplug_decode_faad_la-specrec.lo \
- xineplug_decode_faad_la-ssr.lo \
- xineplug_decode_faad_la-ssr_fb.lo \
- xineplug_decode_faad_la-ssr_ipqf.lo \
- xineplug_decode_faad_la-syntax.lo \
- xineplug_decode_faad_la-tns.lo \
+am_xineplug_decode_faad_la_OBJECTS = \
xineplug_decode_faad_la-xine_faad_decoder.lo
xineplug_decode_faad_la_OBJECTS = \
$(am_xineplug_decode_faad_la_OBJECTS)
@@ -592,97 +556,11 @@ SUBDIRS = codebook
xineplug_LTLIBRARIES = $(faad_module)
xineplug_decode_faad_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS) -fno-strict-aliasing
xineplug_decode_faad_la_SOURCES = \
- bits.c \
- cfft.c \
- common.c \
- decoder.c \
- drc.c \
- drm_dec.c \
- error.c \
- filtbank.c \
- hcr.c \
- huffman.c \
- ic_predict.c \
- is.c \
- lt_predict.c \
- mdct.c \
- mp4.c \
- ms.c \
- output.c \
- pns.c \
- ps_dec.c \
- ps_syntax.c \
- pulse.c \
- rvlc.c \
- sbr_dct.c \
- sbr_dec.c \
- sbr_e_nf.c \
- sbr_fbt.c \
- sbr_hfadj.c \
- sbr_hfgen.c \
- sbr_huff.c \
- sbr_qmf.c \
- sbr_syntax.c \
- sbr_tf_grid.c \
- specrec.c \
- ssr.c \
- ssr_fb.c \
- ssr_ipqf.c \
- syntax.c \
- tns.c \
xine_faad_decoder.c
xineplug_decode_faad_la_LDFLAGS = $(xineplug_ldflags)
-xineplug_decode_faad_la_LIBADD = -lm $(XINE_LIB)
+xineplug_decode_faad_la_LIBADD = -lm $(XINE_LIB) -lfaad
noinst_HEADERS = \
- analysis.h \
- bits.h \
- cfft.h \
- cfft_tab.h \
- common.h \
- decoder.h \
- drc.h \
- drm_dec.h \
- error.h \
- filtbank.h \
- fixed.h \
- huffman.h \
- ic_predict.h \
- is.h \
- iq_table.h \
- kbd_win.h \
- lt_predict.h \
- mdct.h \
- mdct_tab.h \
- mp4.h \
- ms.h \
- output.h \
- pns.h \
- ps_dec.h \
- ps_tables.h \
- pulse.h \
- rvlc.h \
- sbr_dct.h \
- sbr_dec.h \
- sbr_e_nf.h \
- sbr_fbt.h \
- sbr_hfadj.h \
- sbr_hfgen.h \
- sbr_huff.h \
- sbr_noise.h \
- sbr_qmf.h \
- sbr_qmf_c.h \
- sbr_syntax.h \
- sbr_tf_grid.h \
- sine_win.h \
- specrec.h \
- ssr.h \
- ssr_fb.h \
- ssr_ipqf.h \
- ssr_win.h \
- structs.h \
- syntax.h \
- tns.h
all: all-recursive

View File

@ -0,0 +1,157 @@
$OpenBSD: patch-src_libfaad_xine_faad_decoder_c,v 1.1 2007/09/04 00:44:26 jakemsr Exp $
--- src/libfaad/xine_faad_decoder.c.orig Fri Aug 31 21:54:08 2007
+++ src/libfaad/xine_faad_decoder.c Fri Aug 31 22:26:08 2007
@@ -34,16 +34,21 @@
#define LOG
*/
+#include <faad.h>
+
#include "xine_internal.h"
#include "audio_out.h"
#include "buffer.h"
#include "xineutils.h"
+
+#if 0
#include "common.h"
#include "structs.h"
#include "decoder.h"
#include "syntax.h"
#define FAAD_MIN_STREAMSIZE 768 /* 6144 bits/channel */
+#endif
typedef struct {
audio_decoder_class_t decoder_class;
@@ -55,26 +60,26 @@ typedef struct faad_decoder_s {
xine_stream_t *stream;
/* faad2 stuff */
- NeAACDecHandle faac_dec;
- NeAACDecConfigurationPtr faac_cfg;
- NeAACDecFrameInfo faac_finfo;
+ faacDecHandle faac_dec;
+ faacDecConfigurationPtr faac_cfg;
+ faacDecFrameInfo faac_finfo;
int faac_failed;
int raw_mode;
- unsigned char *buf;
- int size;
+ uint8_t *buf;
+ uint32_t size;
int rec_audio_src_size;
int max_audio_src_size;
int pts;
- unsigned char *dec_config;
- int dec_config_size;
+ uint8_t *dec_config;
+ uint32_t dec_config_size;
uint32_t rate;
int bits_per_sample;
- unsigned char num_channels;
- int sbr;
+ uint8_t num_channels;
+ uint8_t sbr;
uint32_t ao_cap_mode;
int output_open;
@@ -125,33 +130,33 @@ static void faad_meta_info_set ( faad_decoder_t *this
static int faad_open_dec( faad_decoder_t *this ) {
int used;
- this->faac_dec = NeAACDecOpen();
+ this->faac_dec = faacDecOpen();
if( !this->faac_dec ) {
xprintf( this->stream->xine, XINE_VERBOSITY_LOG,
- _("libfaad: libfaad NeAACDecOpen() failed.\n"));
+ _("libfaad: libfaad faacDecOpen() failed.\n"));
this->faac_failed++;
} else {
if( this->dec_config ) {
- used = NeAACDecInit2(this->faac_dec, this->dec_config, this->dec_config_size,
+ used = faacDecInit2(this->faac_dec, this->dec_config, this->dec_config_size,
&this->rate, &this->num_channels);
if( used < 0 ) {
xprintf( this->stream->xine, XINE_VERBOSITY_LOG,
- _("libfaad: libfaad NeAACDecInit2 failed.\n"));
+ _("libfaad: libfaad faacDecInit2 failed.\n"));
this->faac_failed++;
} else
- lprintf( "NeAACDecInit2 returned rate=%"PRId32" channels=%d\n",
+ lprintf( "faacDecInit2 returned rate=%"PRId32" channels=%d\n",
this->rate, this->num_channels );
} else {
- used = NeAACDecInit(this->faac_dec, this->buf, this->size,
+ used = faacDecInit(this->faac_dec, this->buf, this->size,
&this->rate, &this->num_channels);
if( used < 0 ) {
xprintf ( this->stream->xine, XINE_VERBOSITY_LOG,
- _("libfaad: libfaad NeAACDecInit failed.\n"));
+ _("libfaad: libfaad faacDecInit failed.\n"));
this->faac_failed++;
} else {
- lprintf( "NeAACDecInit() returned rate=%"PRId32" channels=%d (used=%d)\n",
+ lprintf( "faacDecInit() returned rate=%"PRId32" channels=%d (used=%d)\n",
this->rate, this->num_channels, used);
this->size -= used;
@@ -165,7 +170,7 @@ static int faad_open_dec( faad_decoder_t *this ) {
if( this->faac_failed ) {
if( this->faac_dec ) {
- NeAACDecClose( this->faac_dec );
+ faacDecClose( this->faac_dec );
this->faac_dec = NULL;
}
_x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_HANDLED, 0);
@@ -189,9 +194,9 @@ static int faad_open_output( faad_decoder_t *this ) {
this->ao_cap_mode = AO_CAP_MODE_5_1CHANNEL;
break;
} else {
- this->faac_cfg = NeAACDecGetCurrentConfiguration(this->faac_dec);
+ this->faac_cfg = faacDecGetCurrentConfiguration(this->faac_dec);
this->faac_cfg->downMatrix = 1;
- NeAACDecSetConfiguration(this->faac_dec, this->faac_cfg);
+ faacDecSetConfiguration(this->faac_dec, this->faac_cfg);
this->num_channels = 2;
}
case 2:
@@ -212,7 +217,7 @@ static void faad_decode_audio ( faad_decoder_t *this,
uint8_t *sample_buffer;
uint8_t *inbuf;
audio_buffer_t *audio_buffer;
- int sample_size = this->size;
+ uint32_t sample_size = this->size;
if( !this->faac_dec )
return;
@@ -221,12 +226,12 @@ static void faad_decode_audio ( faad_decoder_t *this,
while( (!this->raw_mode && end_frame && this->size >= 10) ||
(this->raw_mode && this->size >= this->rec_audio_src_size) ) {
- sample_buffer = NeAACDecDecode(this->faac_dec,
+ sample_buffer = faacDecDecode(this->faac_dec,
&this->faac_finfo, inbuf, sample_size);
if( !sample_buffer ) {
xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
- "libfaad: %s\n", NeAACDecGetErrorMessage(this->faac_finfo.error));
+ "libfaad: %s\n", faacDecGetErrorMessage(this->faac_finfo.error));
used = 1;
} else {
used = this->faac_finfo.bytesconsumed;
@@ -406,7 +411,7 @@ static void faad_dispose (audio_decoder_t *this_gen) {
this->dec_config_size = 0;
if( this->faac_dec )
- NeAACDecClose(this->faac_dec);
+ faacDecClose(this->faac_dec);
this->faac_dec = NULL;
this->faac_failed = 0;