diff --git a/REQUIREMENTS b/REQUIREMENTS index d399ea05a5..0c5accd53c 100644 --- a/REQUIREMENTS +++ b/REQUIREMENTS @@ -125,6 +125,12 @@ DebianPackage: libdv4-dev Plugins: dv (dvdec) URL: http://libdv.sourceforge.net/ +Package: liblame +Version: >= 3.98 +DebianPackage: libmp3lame-dev +Plugins: lame (lamemp3enc) +URL: http://www.mp3dev.org/mp3/ + Package: libmpg123 Version: >= 1.3 DebianPackage: libpng12-dev diff --git a/configure.ac b/configure.ac index 9dc76c8eb6..ea1c91c13f 100644 --- a/configure.ac +++ b/configure.ac @@ -665,6 +665,26 @@ AG_GST_CHECK_FEATURE(JPEG, [jpeg library], jpeg, [ AC_SUBST(JPEG_LIBS) ]) +dnl *** lame *** +translit(dnm, m, l) AM_CONDITIONAL(USE_LAME, true) +AG_GST_CHECK_FEATURE(LAME, [lame mp3 encoder library], lame, [ + AG_GST_CHECK_LIBHEADER(LAME, mp3lame, lame_init, $LIBM, lame/lame.h, + [ + HAVE_LAME="yes" + LAME_LIBS="-lmp3lame $LIBM" + dnl is lame presets available + LAME_CFLAGS="" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[ int preset = MEDIUM ]])],[LAME_CFLAGS="-DGSTLAME_PRESET"],[LAME_CFLAGS="" + ]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[ + void *ptr = &lame_set_VBR_quality + ]])],[LAME_CFLAGS="$LAME_CFLAGS -DHAVE_LAME_SET_VBR_QUALITY"],[LAME_CFLAGS="$LAME_CFLAGS" + ]) + AC_SUBST(LAME_CFLAGS) + AC_SUBST(LAME_LIBS) + ]) +]) + dnl *** libcaca *** translit(dnm, m, l) AM_CONDITIONAL(USE_LIBCACA, true) AG_GST_CHECK_FEATURE(LIBCACA, [libcaca coloured ASCII art], cacasink, [ @@ -878,6 +898,7 @@ AM_CONDITIONAL(USE_FLAC, false) AM_CONDITIONAL(USE_GDK_PIXBUF, false) AM_CONDITIONAL(USE_JACK, false) AM_CONDITIONAL(USE_JPEG, false) +AM_CONDITIONAL(USE_LAME, false) AM_CONDITIONAL(USE_LIBCACA, false) AM_CONDITIONAL(USE_LIBDV, false) AM_CONDITIONAL(USE_LIBIEC61883, false) @@ -1021,6 +1042,7 @@ ext/flac/Makefile ext/gdk_pixbuf/Makefile ext/jack/Makefile ext/jpeg/Makefile +ext/lame/Makefile ext/libcaca/Makefile ext/libpng/Makefile ext/mpg123/Makefile diff --git a/docs/plugins/Makefile.am b/docs/plugins/Makefile.am index 54069c7254..ae34a1ce14 100644 --- a/docs/plugins/Makefile.am +++ b/docs/plugins/Makefile.am @@ -64,6 +64,7 @@ EXTRA_HFILES = \ $(top_srcdir)/ext/jack/gstjackaudiosink.h \ $(top_srcdir)/ext/jpeg/gstjpegdec.h \ $(top_srcdir)/ext/jpeg/gstjpegenc.h \ + $(top_srcdir)/ext/lame/gstlamemp3enc.h \ $(top_srcdir)/ext/libcaca/gstcacasink.h \ $(top_srcdir)/ext/libpng/gstpngdec.h \ $(top_srcdir)/ext/libpng/gstpngenc.h \ diff --git a/docs/plugins/gst-plugins-good-plugins-docs.sgml b/docs/plugins/gst-plugins-good-plugins-docs.sgml index 48bca35026..2ba9612ea9 100644 --- a/docs/plugins/gst-plugins-good-plugins-docs.sgml +++ b/docs/plugins/gst-plugins-good-plugins-docs.sgml @@ -99,6 +99,7 @@ + @@ -326,6 +327,7 @@ + diff --git a/docs/plugins/gst-plugins-good-plugins-sections.txt b/docs/plugins/gst-plugins-good-plugins-sections.txt index 851706146b..506f63a0e1 100644 --- a/docs/plugins/gst-plugins-good-plugins-sections.txt +++ b/docs/plugins/gst-plugins-good-plugins-sections.txt @@ -1283,6 +1283,21 @@ GST_TYPE_JPEG_ENC gst_jpeg_enc_get_type +
+element-lamemp3enc +lamemp3enc +GstLameMP3Enc + +GstLameMP3EncClass +GST_LAMEMP3ENC +GST_LAMEMP3ENC_CLASS +GST_IS_LAMEMP3ENC +GST_IS_LAMEMP3ENC_CLASS +GST_TYPE_LAMEMP3ENC +gst_lamemp3enc_get_type +gst_lamemp3enc_register +
+
element-level level diff --git a/docs/plugins/gst-plugins-good-plugins.args b/docs/plugins/gst-plugins-good-plugins.args index ad60b1e58b..4a6b3c6bda 100644 --- a/docs/plugins/gst-plugins-good-plugins.args +++ b/docs/plugins/gst-plugins-good-plugins.args @@ -24288,3 +24288,63 @@ NULL + +GstLameMP3Enc::bitrate +gint +[8,320] +rwx +Bitrate (kb/s) +Bitrate in kbit/sec (Only valid if target is bitrate, for CBR one of 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256 or 320). +128 + + + +GstLameMP3Enc::cbr +gboolean + +rwx +CBR +Enforce constant bitrate encoding (Only valid if target is bitrate). +FALSE + + + +GstLameMP3Enc::encoding-engine-quality +GstLameMP3EncEncodingEngineQuality + +rwx +Encoding Engine Quality +Quality/speed of the encoding engine, this does not affect the bitrate!. +Standard + + + +GstLameMP3Enc::mono +gboolean + +rwx +Mono +Enforce mono encoding. +FALSE + + + +GstLameMP3Enc::quality +gfloat +[0,9.999] +rwx +Quality +VBR Quality from 0 to 10, 0 being the best (Only valid if target is quality). +4 + + + +GstLameMP3Enc::target +GstLameMP3EncTarget + +rwx +Target +Optimize for quality or bitrate. +Quality + + diff --git a/docs/plugins/gst-plugins-good-plugins.hierarchy b/docs/plugins/gst-plugins-good-plugins.hierarchy index a928dc5e1f..6e101cbf28 100644 --- a/docs/plugins/gst-plugins-good-plugins.hierarchy +++ b/docs/plugins/gst-plugins-good-plugins.hierarchy @@ -33,6 +33,7 @@ GObject GstAudioEncoder GstALawEnc GstFlacEnc + GstLameMP3Enc GstMuLawEnc GstSpeexEnc GstWavpackEnc diff --git a/docs/plugins/gst-plugins-good-plugins.interfaces b/docs/plugins/gst-plugins-good-plugins.interfaces index 14fe6cd30f..2025f2b4a7 100644 --- a/docs/plugins/gst-plugins-good-plugins.interfaces +++ b/docs/plugins/gst-plugins-good-plugins.interfaces @@ -45,6 +45,7 @@ GstIirEqualizer3Bands GstChildProxy GstPreset GstIirEqualizerNBands GstChildProxy GstIirEqualizerNBands GstChildProxy GstPreset GstJpegEnc GstPreset +GstLameMP3Enc GstPreset GstMJ2Mux GstTagSetter GstTagXmpWriter GstMJ2Mux GstTagSetter GstTagXmpWriter GstPreset GstMP4Mux GstTagSetter GstTagXmpWriter diff --git a/docs/plugins/inspect/plugin-lame.xml b/docs/plugins/inspect/plugin-lame.xml new file mode 100644 index 0000000000..67fc2e6053 --- /dev/null +++ b/docs/plugins/inspect/plugin-lame.xml @@ -0,0 +1,34 @@ + + lame + Encode MP3s with LAME + ../../ext/lame/.libs/libgstlame.so + libgstlame.so + 1.13.0.1 + LGPL + gst-plugins-good + GStreamer Good Plug-ins git + Unknown package origin + + + lamemp3enc + L.A.M.E. mp3 encoder + Codec/Encoder/Audio + High-quality free MP3 encoder + Sebastian Dröge <sebastian.droege@collabora.co.uk> + + + sink + sink + always +
audio/x-raw, format=(string)S16LE, layout=(string)interleaved, rate=(int){ 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000 }, channels=(int)1; audio/x-raw, format=(string)S16LE, layout=(string)interleaved, rate=(int){ 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000 }, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
+
+ + src + source + always +
audio/mpeg, mpegversion=(int)1, layer=(int)3, rate=(int){ 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000 }, channels=(int)[ 1, 2 ]
+
+
+
+
+
\ No newline at end of file diff --git a/ext/Makefile.am b/ext/Makefile.am index 1bb540bb55..fee653f55e 100644 --- a/ext/Makefile.am +++ b/ext/Makefile.am @@ -34,6 +34,12 @@ else JPEG_DIR = endif +if USE_LAME +LAME_DIR = lame +else +LAME_DIR = +endif + if USE_LIBCACA LIBCACA_DIR = libcaca else @@ -115,6 +121,7 @@ SUBDIRS = \ $(GDK_PIXBUF_DIR) \ $(JACK_DIR) \ $(JPEG_DIR) \ + $(LAME_DIR) \ $(LIBCACA_DIR) \ $(LIBDV_DIR) \ $(LIBMNG_DIR) \ @@ -136,6 +143,7 @@ DIST_SUBDIRS = \ gdk_pixbuf \ jack \ jpeg \ + lame \ libcaca \ libpng \ mpg123 \ diff --git a/ext/lame/Makefile.am b/ext/lame/Makefile.am index 5e5b3a02de..46198c8ec0 100644 --- a/ext/lame/Makefile.am +++ b/ext/lame/Makefile.am @@ -3,7 +3,7 @@ plugin_LTLIBRARIES = libgstlame.la libgstlame_la_SOURCES = gstlamemp3enc.c plugin.c libgstlame_la_CFLAGS = \ $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(LAME_CFLAGS) -libgstlame_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS) -lgstaudio-$(GST_API_VERSION) \ +libgstlame_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) -lgstaudio-$(GST_API_VERSION) \ $(GST_BASE_LIBS) $(GST_LIBS) $(LAME_LIBS) libgstlame_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) diff --git a/ext/lame/meson.build b/ext/lame/meson.build index 2812cb9306..e3e61b68fe 100644 --- a/ext/lame/meson.build +++ b/ext/lame/meson.build @@ -10,7 +10,7 @@ if lame_dep.found() and cc.has_header_symbol('lame/lame.h', 'lame_init') endif lame = library('gstlame', ['gstlamemp3enc.c', 'plugin.c'], - c_args : ugly_args + lame_extra_c_args, + c_args : gst_plugins_good_args + lame_extra_c_args, include_directories : [configinc, libsinc], dependencies : [gstaudio_dep, lame_dep], install : true, diff --git a/ext/meson.build b/ext/meson.build index 92f75ef10e..3bc8c8212e 100644 --- a/ext/meson.build +++ b/ext/meson.build @@ -4,6 +4,7 @@ subdir('flac') subdir('gdk_pixbuf') subdir('jack') subdir('jpeg') +subdir('lame') subdir('libcaca') # FIXME: dv plugin fails to link with msvc, wants pthread.lib if cc.get_id() != 'msvc' diff --git a/po/POTFILES.in b/po/POTFILES.in index 747b208eb2..895c7fe0b9 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -2,6 +2,7 @@ ext/flac/gstflacdec.c ext/jack/gstjackaudiosink.c ext/jack/gstjackaudiosrc.c ext/jpeg/gstjpegdec.c +ext/lame/gstlamemp3enc.c ext/libpng/gstpngdec.c ext/pulse/pulsesink.c ext/shout2/gstshout2.c diff --git a/tests/check/Makefile.am b/tests/check/Makefile.am index b18bc9be15..6dd397947f 100644 --- a/tests/check/Makefile.am +++ b/tests/check/Makefile.am @@ -188,6 +188,12 @@ else check_jpeg = endif +if USE_LAME +check_lame = pipelines/lame +else +check_lame = +endif + if USE_PLUGIN_LEVEL check_level = elements/level else @@ -372,6 +378,7 @@ check_PROGRAMS = \ $(check_imagefreeze) \ $(check_interleave) \ $(check_jpeg) \ + $(check_lame) \ $(check_law) \ $(check_level) \ $(check_matroska) \ diff --git a/tests/check/gst-plugins-good.supp b/tests/check/gst-plugins-good.supp index e86794df45..33737bf5a1 100644 --- a/tests/check/gst-plugins-good.supp +++ b/tests/check/gst-plugins-good.supp @@ -143,3 +143,15 @@ fun:gst_value_deserialize_double } +## lame + +{ + + Memcheck:Cond + fun:L3psycho_anal_vbr + fun:lame_encode_mp3_frame + ... + fun:lame_encode_flush + fun:gst_lamemp3enc_sink_event +} + diff --git a/tests/check/meson.build b/tests/check/meson.build index a4335a14bd..a005326561 100644 --- a/tests/check/meson.build +++ b/tests/check/meson.build @@ -94,6 +94,7 @@ good_tests = [ [ 'elements/vp8enc', not vpx_dep.found() or not have_vp8_encoder ], [ 'elements/vp8dec', not vpx_dep.found() or not have_vp8_decoder ], [ 'elements/vp9enc', not vpx_dep.found() or not have_vp9_encoder ], + [ 'pipelines/lame', not lame_dep.found() ], [ 'pipelines/wavenc' ], [ 'elements/wavpackdec', not wavpack_dep.found() ], [ 'elements/wavpackenc', not wavpack_dep.found() ],