[packages/faad2-plugins] - mpeg4ip and xmms plugins copied from faad2.spec:2.10.1
qboosh
qboosh at pld-linux.org
Sun Mar 3 16:13:33 CET 2024
commit 23a7461db21b8f70c1d290c61fb2026cdc595c1b
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Sun Mar 3 15:35:13 2024 +0100
- mpeg4ip and xmms plugins copied from faad2.spec:2.10.1
faad2-backward_compat.patch | 77 +++++++++++++++++++++++++
faad2-make.patch | 12 ++++
faad2-mp4ff.patch | 15 +++++
faad2-mp4v2.patch | 21 +++++++
faad2-mpeg4ip.patch | 135 ++++++++++++++++++++++++++++++++++++++++++++
faad2-plugins.spec | 124 ++++++++++++++++++++++++++++++++++++++++
6 files changed, 384 insertions(+)
---
diff --git a/faad2-plugins.spec b/faad2-plugins.spec
new file mode 100644
index 0000000..0c1d3d9
--- /dev/null
+++ b/faad2-plugins.spec
@@ -0,0 +1,124 @@
+#
+# Conditional build:
+%bcond_with mpeg4ip # MPEG4IP plugin
+%bcond_without xmms # XMMS plugin
+
+Summary: Freeware Advanced Audio Decoder 2 plugins
+Summary(pl.UTF-8): Wtyczki kodeka Freeware Advanced Audio Decoder 2
+Name: faad2-plugins
+Version: 2.10.1
+Release: 1
+License: GPL v2+
+Group: Applications/Sound
+#Source0: http://downloads.sourceforge.net/faac/%{name}-%{version}.tar.gz
+#Source0Download: https://github.com/knik0/faad2/releases
+Source0: https://github.com/knik0/faad2/archive/%{version}/faad2-%{version}.tar.gz
+# Source0-md5: 62a0427c6ff3a273aa720e27da166758
+Patch0: faad2-make.patch
+Patch1: faad2-mpeg4ip.patch
+Patch3: faad2-backward_compat.patch
+Patch4: faad2-mp4ff.patch
+Patch5: faad2-mp4v2.patch
+URL: https://www.audiocoding.com/
+%{?with_mpeg4ip:BuildRequires: SDL-devel}
+BuildRequires: autoconf >= 2.50
+BuildRequires: automake
+%{?with_xmms:BuildRequires: id3lib-devel >= 3.8.2}
+BuildRequires: libtool >= 2:1.4d-3
+%{?with_xmms:BuildRequires: mp4ff-devel}
+%if %{with mpeg4ip}
+BuildRequires: mp4v2-devel
+BuildRequires: mpeg4ip-devel >= 1:1.6
+%endif
+BuildRequires: rpmbuild(macros) >= 1.721
+%{?with_xmms:BuildRequires: xmms-devel}
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+FAAD 2 is a LC, MAIN and LTP profile, MPEG2 and MPEG-4 AAC decoder,
+completely written from scratch.
+
+%description -l pl.UTF-8
+FAAD 2 to napisany całkowicie od początku dekoder MPEG2 i MPEG-4
+obsługujący profile LC, MAIN i LTP.
+
+%package -n mpeg4ip-plugin-faad2
+Summary: MPEG4IP plugin for AAC files
+Summary(pl.UTF-8): Wtyczka MPEG4IP do plików AAC
+Group: Applications/Sound
+Requires: faad2-libs >= %{version}
+Requires: mpeg4ip
+
+%description -n mpeg4ip-plugin-faad2
+MPEG4IP plugin for AAC files.
+
+%description -n mpeg4ip-plugin-faad2 -l pl.UTF-8
+Wtyczka MPEG4IP do plików AAC.
+
+%package -n xmms-input-faad2
+Summary: XMMS plugin for AAC files
+Summary(pl.UTF-8): Wtyczka XMMS do plików AAC
+Group: X11/Applications/Sound
+Requires: faad2-libs >= %{version}
+Requires: xmms
+
+%description -n xmms-input-faad2
+XMMS plugin for AAC files.
+
+%description -n xmms-input-faad2 -l pl.UTF-8
+Wtyczka XMMS do plików AAC.
+
+%prep
+%setup -q -n faad2-%{version}
+%patch0 -p1
+%patch1 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
+
+%build
+%{__libtoolize}
+%{__aclocal}
+%{__autoconf}
+%{__autoheader}
+%{__automake}
+%configure \
+ --disable-static \
+ --with-xmms%{!?with_xmms:=no} \
+ --with-mpeg4ip%{!?with_mpeg4ip:=no}
+
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} install \
+ DESTDIR=$RPM_BUILD_ROOT
+
+%{__rm} $RPM_BUILD_ROOT%{_bindir}/faad
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/libfaad*
+%{__rm} $RPM_BUILD_ROOT%{_includedir}/*.h
+%{__rm} $RPM_BUILD_ROOT%{_pkgconfigdir}/faad2.pc
+%{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/faad.1
+
+%if %{with xmms}
+%{__rm} $RPM_BUILD_ROOT%{xmms_input_plugindir}/*.la
+%endif
+%if %{with mpeg4ip}
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/mp4player_plugin/*.la
+%endif
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%if %{with xmms}
+%files -n xmms-input-faad2
+%defattr(644,root,root,755)
+%attr(755,root,root) %{xmms_input_plugindir}/libmp4.so
+%endif
+
+%if %{with mpeg4ip}
+%files -n mpeg4ip-plugin-faad2
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/mp4player_plugin/faad2_plugin.so*
+%endif
diff --git a/faad2-backward_compat.patch b/faad2-backward_compat.patch
new file mode 100644
index 0000000..635500c
--- /dev/null
+++ b/faad2-backward_compat.patch
@@ -0,0 +1,77 @@
+--- faad2/libfaad/decoder.c.orig 2007-11-01 13:33:30.000000000 +0100
++++ faad2/libfaad/decoder.c 2007-11-04 12:36:41.315350439 +0100
+@@ -1115,3 +1115,57 @@
+
+ return NULL;
+ }
++
++#ifndef NO_BACKWARD_COMPAT
++# define ALIAS(type, func, target) type NEAACDECAPI func __attribute__((alias(#target)))
++
++#undef faacDecGetErrorMessage
++ALIAS(char*, faacDecGetErrorMessage(uint8_t errcode),
++ NeAACDecGetErrorMessage);
++
++#undef faacDecSetConfiguration
++ALIAS(uint8_t, faacDecSetConfiguration(NeAACDecHandle hDecoder,
++ NeAACDecConfigurationPtr config),
++ NeAACDecSetConfiguration);
++
++#undef faacDecGetCurrentConfiguration
++ALIAS(NeAACDecConfigurationPtr, faacDecGetCurrentConfiguration(NeAACDecHandle hDecoder),
++ NeAACDecGetCurrentConfiguration);
++
++#undef faacDecInit
++ALIAS(int32_t, faacDecInit(NeAACDecHandle hDecoder, uint8_t *buffer,
++ uint32_t buffer_size, uint32_t *samplerate, uint8_t *channels),
++ NeAACDecInit);
++
++#undef faacDecInit2
++ALIAS(int8_t, faacDecInit2(NeAACDecHandle hDecoder, uint8_t *pBuffer,
++ uint32_t SizeOfDecoderSpecificInfo,
++ uint32_t *samplerate, uint8_t *channels),
++ NeAACDecInit2);
++
++#ifdef DRM
++#undef faacDecInitDRM
++ALIAS(int8_t, faacDecInitDRM(NeAACDecHandle *hDecoder, uint32_t samplerate,
++ uint8_t channels),
++ NeAACDecInitDRM);
++#endif
++
++#undef faacDecPostSeekReset
++ALIAS(void, faacDecPostSeekReset(NeAACDecHandle hDecoder, int32_t frame),
++ NeAACDecPostSeekReset);
++
++#undef faacDecOpen
++ALIAS(NeAACDecHandle, faacDecOpen(void),
++ NeAACDecOpen);
++
++#undef faacDecClose
++ALIAS(void, faacDecClose(NeAACDecHandle hDecoder),
++ NeAACDecClose);
++
++#undef faacDecDecode
++ALIAS(void*, faacDecDecode(NeAACDecHandle hDecoder,
++ NeAACDecFrameInfo *hInfo,
++ uint8_t *buffer, uint32_t buffer_size),
++ NeAACDecDecode);
++
++#endif
+--- faad2-2.10.1/libfaad/mp4.c.orig 2023-03-30 20:51:02.976701799 +0200
++++ faad2-2.10.1/libfaad/mp4.c 2023-03-30 20:52:50.676118341 +0200
+@@ -310,3 +310,14 @@ int8_t AudioSpecificConfig2(uint8_t *pBu
+ faad_endbits(&ld);
+ return ret;
+ }
++
++#ifndef NO_BACKWARD_COMPAT
++# define ALIAS(type, func, target) type NEAACDECAPI func __attribute__((alias(#target)))
++
++#undef AudioSpecificConfig
++ALIAS(int8_t, AudioSpecificConfig(uint8_t *pBuffer,
++ uint32_t buffer_size,
++ mp4AudioSpecificConfig *mp4ASC),
++ NeAACDecAudioSpecificConfig);
++
++#endif
diff --git a/faad2-make.patch b/faad2-make.patch
new file mode 100644
index 0000000..c8e54f5
--- /dev/null
+++ b/faad2-make.patch
@@ -0,0 +1,12 @@
+--- faad2/plugins/xmms/src/Makefile.am.orig 2006-09-25 21:52:53.000000000 +0200
++++ faad2/plugins/xmms/src/Makefile.am 2007-11-04 11:45:59.870028348 +0100
+@@ -1,7 +1,7 @@
+ local_CFLAGS=`$(XMMS_CONFIG) --cflags` -Wall
+ local_LDFLAGS=`$(XMMS_CONFIG) --libs`
+-libdir = `$(XMMS_CONFIG) --input-plugin-dir`
+-lib_LTLIBRARIES = libmp4.la
++plugindir = `$(XMMS_CONFIG) --input-plugin-dir`
++plugin_LTLIBRARIES = libmp4.la
+
+ libmp4_la_CFLAGS = $(local_CFLAGS) -Wall \
+ -I$(top_srcdir)/include -I$(top_srcdir)/common/mp4ff
diff --git a/faad2-mp4ff.patch b/faad2-mp4ff.patch
new file mode 100644
index 0000000..4d9d4c1
--- /dev/null
+++ b/faad2-mp4ff.patch
@@ -0,0 +1,15 @@
+--- faad2-2_9_2/plugins/xmms/src/Makefile.am.orig 2020-05-19 18:03:13.548664034 +0200
++++ faad2-2_9_2/plugins/xmms/src/Makefile.am 2020-05-19 18:05:21.617970223 +0200
+@@ -4,10 +4,9 @@
+ plugin_LTLIBRARIES = libmp4.la
+
+ libmp4_la_CFLAGS = $(local_CFLAGS) -Wall \
+- -I$(top_srcdir)/include -I$(top_srcdir)/common/mp4ff
++ -I$(top_srcdir)/include
+
+-libmp4_la_LIBADD = $(top_builddir)/libfaad/libfaad.la \
+- $(top_builddir)/common/mp4ff/libmp4ff.a
++libmp4_la_LIBADD = $(top_builddir)/libfaad/libfaad.la -lmp4ff
+
+ libmp4_la_LDFLAGS = -module -avoid-version $(local_LDFLAGS) -lpthread
+
diff --git a/faad2-mp4v2.patch b/faad2-mp4v2.patch
new file mode 100644
index 0000000..2c01f31
--- /dev/null
+++ b/faad2-mp4v2.patch
@@ -0,0 +1,21 @@
+--- faad2-2.7/plugins/mpeg4ip/faad2.cpp.orig 2012-12-09 09:30:54.613929786 +0100
++++ faad2-2.7/plugins/mpeg4ip/faad2.cpp 2012-12-09 11:02:12.133815617 +0100
+@@ -21,7 +21,7 @@
+ #include "faad2.h"
+ #include <mpeg4_audio_config.h>
+ #include <mpeg4_sdp.h>
+-#include <mp4.h>
++#include <mp4v2/mp4v2.h>
+ #include <SDL/SDL.h>
+
+ #define DEBUG_SYNC 2
+--- faad2-2.7/plugins/mpeg4ip/Makefile.am.orig 2003-08-07 19:21:21.000000000 +0200
++++ faad2-2.7/plugins/mpeg4ip/Makefile.am 2012-12-09 11:12:59.277135462 +0100
+@@ -10,6 +10,7 @@
+
+ faad2_plugin_la_LIBADD = \
+ $(top_builddir)/libfaad/libfaad.la \
++ -lmp4util \
+ -lm
+
+
diff --git a/faad2-mpeg4ip.patch b/faad2-mpeg4ip.patch
new file mode 100644
index 0000000..0c9efed
--- /dev/null
+++ b/faad2-mpeg4ip.patch
@@ -0,0 +1,135 @@
+--- faad2/plugins/mpeg4ip/faad2.cpp.orig 2004-08-20 10:30:53.000000000 +0200
++++ faad2/plugins/mpeg4ip/faad2.cpp 2006-08-24 08:27:51.399489000 +0200
+@@ -35,7 +35,7 @@
+ /*
+ * Create CAACodec class
+ */
+-static codec_data_t *aac_codec_create (const char *compressor,
++static codec_data_t *aac_codec_create (const char *stream_type, const char *compressor,
+ int type,
+ int profile,
+ format_list_t *media_fmt,
+@@ -148,7 +148,7 @@
+ * Decode task call for FAAC
+ */
+ static int aac_decode (codec_data_t *ptr,
+- uint64_t ts,
++ frame_timestamp_t *ts,
+ int from_rtp,
+ int *sync_frame,
+ uint8_t *buffer,
+@@ -163,15 +163,15 @@
+ if (aac->m_record_sync_time) {
+ aac->m_current_frame = 0;
+ aac->m_record_sync_time = 0;
+- aac->m_current_time = ts;
+- aac->m_last_rtp_ts = ts;
++ aac->m_current_time = ts->msec_timestamp;
++ aac->m_last_rtp_ts = ts->msec_timestamp;
+ } else {
+- if (aac->m_last_rtp_ts == ts) {
++ if (aac->m_last_rtp_ts == ts->msec_timestamp) {
+ aac->m_current_time += aac->m_msec_per_frame;
+ aac->m_current_frame++;
+ } else {
+- aac->m_last_rtp_ts = ts;
+- aac->m_current_time = ts;
++ aac->m_last_rtp_ts = ts->msec_timestamp;
++ aac->m_current_time = ts->msec_timestamp;
+ aac->m_current_frame = 0;
+ }
+
+@@ -239,7 +239,7 @@
+ aac->m_chans,
+ (audio_format_t)AUDIO_S16SYS,
+ aac->m_output_frame_size);
+- uint8_t *now = aac->m_vft->audio_get_buffer(aac->m_ifptr);
++ uint8_t *now = aac->m_vft->audio_get_buffer(aac->m_ifptr, (ts->msec_timestamp * aac->m_freq) / 1000, ts->msec_timestamp);
+ aac->m_audio_inited = 1;
+ }
+ /*
+@@ -281,6 +281,7 @@
+ };
+
+ static int aac_codec_check (lib_message_func_t message,
++ const char *stream_type,
+ const char *compressor,
+ int type,
+ int profile,
+@@ -322,7 +323,7 @@
+ }
+ if (userdata != NULL) {
+ mpeg4_audio_config_t audio_config;
+- decode_mpeg4_audio_config(userdata, userdata_size, &audio_config);
++ decode_mpeg4_audio_config(userdata, userdata_size, &audio_config, 1 /* ??? */);
+ message(LOG_DEBUG, "aac", "audio type is %d", audio_config.audio_object_type);
+ if (fmtp != NULL) free_fmtp_parse(fmtp);
+
+--- faad2/plugins/mpeg4ip/aa_file.cpp.orig 2004-01-05 15:05:12.000000000 +0100
++++ faad2/plugins/mpeg4ip/aa_file.cpp 2006-08-24 08:33:42.189412000 +0200
+@@ -77,7 +77,7 @@
+
+ int aac_file_next_frame (codec_data_t *your,
+ uint8_t **buffer,
+- uint64_t *ts)
++ frame_timestamp_t *ts)
+ {
+ aac_codec_t *aac = (aac_codec_t *)your;
+
+@@ -98,7 +98,10 @@
+ uint64_t calc;
+ calc = aac->m_framecount * 1024 * M_LLU;
+ calc /= aac->m_freq;
+- *ts = calc;
++ ts->msec_timestamp = calc;
++ ts->audio_freq_timestamp = calc; /* XXX */
++ ts->audio_freq = 1; /* XXX */
++ ts->timestamp_is_pts = false;
+ *buffer = aac->m_buffer;
+ aac->m_framecount++;
+ return (aac->m_buffer_size);
+--- faad2/plugins/mpeg4ip/faad2.h.orig 2004-01-05 15:05:12.000000000 +0100
++++ faad2/plugins/mpeg4ip/faad2.h 2006-08-24 08:29:23.233228250 +0200
+@@ -81,7 +81,7 @@
+
+ int aac_file_next_frame(codec_data_t *ifptr,
+ uint8_t **buffer,
+- uint64_t *ts);
++ frame_timestamp_t *ts);
+ int aac_file_eof(codec_data_t *ifptr);
+
+ void aac_file_used_for_frame(codec_data_t *ifptr,
+--- faad2/configure.ac.orig 2006-09-25 21:52:53.000000000 +0200
++++ faad2/configure.ac 2007-11-04 11:51:50.486008814 +0100
+@@ -123,6 +123,8 @@
+ if test x$external_mp4v2 = xyes; then
+ AM_CONDITIONAL(HAVE_MPEG4IP_PLUG, true)
+ AC_MSG_NOTICE("Building MPEG4IP plugin")
++ MPEG4IP_PLAYER_PLUGIN_DIR="`mpeg4ip-config --player-plugin-dir`"
++ AC_SUBST(MPEG4IP_PLAYER_PLUGIN_DIR)
+ else
+ AC_MSG_NOTICE("MPEG4IP libmp4v2 is required for MPEG4IP plugin")
+ fi
+--- faad2/plugins/mpeg4ip/faad2.cpp.orig 2007-11-13 21:24:36.000000000 +0100
++++ faad2/plugins/mpeg4ip/faad2.cpp 2007-11-13 21:38:55.000000000 +0100
+@@ -67,7 +67,7 @@
+ // This is not necessarilly right - it is, for the most part, but
+ // we should be reading the fmtp statement, and looking at the config.
+ // (like we do below in the userdata section...
+- aac->m_freq = media_fmt->rtpmap->clock_rate;
++ aac->m_freq = media_fmt->rtpmap_clock_rate;
+ fmtp = parse_fmtp_for_mpeg4(media_fmt->fmt_param, vft->log_msg);
+ if (fmtp != NULL) {
+ userdata = fmtp->config_binary;
+@@ -308,9 +308,8 @@
+ }
+ }
+ if (fptr != NULL &&
+- fptr->rtpmap != NULL &&
+- fptr->rtpmap->encode_name != NULL) {
+- if (strcasecmp(fptr->rtpmap->encode_name, "mpeg4-generic") != 0) {
++ fptr->rtpmap_name != NULL) {
++ if (strcasecmp(fptr->rtpmap_name, "mpeg4-generic") != 0) {
+ return -1;
+ }
+ if (userdata == NULL) {
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/faad2-plugins.git/commitdiff/23a7461db21b8f70c1d290c61fb2026cdc595c1b
More information about the pld-cvs-commit
mailing list