diff --git a/REQUIREMENTS b/REQUIREMENTS
index 0c5accd53c..140e8245c0 100644
--- a/REQUIREMENTS
+++ b/REQUIREMENTS
@@ -164,6 +164,12 @@ DebianPackage: libtag1-dev
Plugins: taglib (id3v2mux)
URL: http://taglib.github.io/
+Package: twolame
+Version: >= 0.3.13
+DebianPackage: libtwolame-dev
+Plugins: twolame (twolamemp2enc)
+URL: http://www.twolame.org
+
Package: zlib
DebianPackage: zlib1g-dev
Plugins: isomp4 (qtdemux), matroska (matroskademux)
diff --git a/configure.ac b/configure.ac
index ea1c91c13f..3aaa27d510 100644
--- a/configure.ac
+++ b/configure.ac
@@ -810,6 +810,18 @@ AG_GST_CHECK_FEATURE(TAGLIB, [taglib tagging library], taglib, [
fi
])
+dnl *** twolame ***
+translit(dnm, m, l) AM_CONDITIONAL(USE_TWOLAME, true)
+AG_GST_CHECK_FEATURE(TWOLAME, [twolame], twolame, [
+ PKG_CHECK_MODULES(TWOLAME, twolame >= 0.3.10, [
+ HAVE_TWOLAME="yes"], [
+ HAVE_TWOLAME="no"
+ ])
+ AC_SUBST(TWOLAME_CFLAGS)
+ AC_SUBST(TWOLAME_LIBS)
+])
+
+
dnl *** vpx ***
translit(dnm, m, l) AM_CONDITIONAL(USE_VPX, vpx)
AG_GST_CHECK_FEATURE(VPX, [VPX decoder], vpx, [
@@ -913,6 +925,7 @@ AM_CONDITIONAL(USE_SHOUT2, false)
AM_CONDITIONAL(USE_SOUP, false)
AM_CONDITIONAL(USE_SPEEX, false)
AM_CONDITIONAL(USE_TAGLIB, false)
+AM_CONDITIONAL(USE_TWOLAME, false)
AM_CONDITIONAL(USE_VPX, false)
AM_CONDITIONAL(USE_WAVEFORM, false)
AM_CONDITIONAL(USE_WAVPACK, false)
@@ -1052,6 +1065,7 @@ ext/shout2/Makefile
ext/soup/Makefile
ext/speex/Makefile
ext/taglib/Makefile
+ext/twolame/Makefile
ext/vpx/Makefile
ext/wavpack/Makefile
sys/Makefile
diff --git a/docs/plugins/Makefile.am b/docs/plugins/Makefile.am
index ae34a1ce14..942a0bd4db 100644
--- a/docs/plugins/Makefile.am
+++ b/docs/plugins/Makefile.am
@@ -74,6 +74,7 @@ EXTRA_HFILES = \
$(top_srcdir)/ext/soup/gstsouphttpsrc.h \
$(top_srcdir)/ext/taglib/gstapev2mux.h \
$(top_srcdir)/ext/taglib/gstid3v2mux.h \
+ $(top_srcdir)/ext/twolame/gsttwolamemp2enc.h \
$(top_srcdir)/ext/pulse/pulsesink.h \
$(top_srcdir)/ext/pulse/pulsesrc.h \
$(top_srcdir)/ext/speex/gstspeexenc.h \
diff --git a/docs/plugins/gst-plugins-good-plugins-docs.sgml b/docs/plugins/gst-plugins-good-plugins-docs.sgml
index 2ba9612ea9..d1371c88f8 100644
--- a/docs/plugins/gst-plugins-good-plugins-docs.sgml
+++ b/docs/plugins/gst-plugins-good-plugins-docs.sgml
@@ -263,6 +263,7 @@
+
@@ -353,6 +354,7 @@
+
diff --git a/docs/plugins/gst-plugins-good-plugins-sections.txt b/docs/plugins/gst-plugins-good-plugins-sections.txt
index 506f63a0e1..880f3eb9e6 100644
--- a/docs/plugins/gst-plugins-good-plugins-sections.txt
+++ b/docs/plugins/gst-plugins-good-plugins-sections.txt
@@ -3874,6 +3874,20 @@ GST_TYPE_TEST
gst_test_get_type
+
+element-twolamemp2enc
+twolame
+GstTwoLame
+
+GstTwoLameClass
+GST_TWO_LAME
+GST_TWO_LAME_CLASS
+GST_IS_TWO_LAME
+GST_IS_TWO_LAME_CLASS
+GST_TYPE_TWO_LAME
+gst_two_lame_get_type
+
+
element-udpsink
udpsink
diff --git a/docs/plugins/gst-plugins-good-plugins.args b/docs/plugins/gst-plugins-good-plugins.args
index 4a6b3c6bda..33910b2331 100644
--- a/docs/plugins/gst-plugins-good-plugins.args
+++ b/docs/plugins/gst-plugins-good-plugins.args
@@ -24348,3 +24348,153 @@
Quality
+
+GstTwoLame::ath-level
+gfloat
+
+rw
+ATH Level
+ATH Level in dB.
+0
+
+
+
+GstTwoLame::bitrate
+gint
+[8,384]
+rw
+Bitrate (kb/s)
+Bitrate in kbit/sec (8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, 192, 224, 256, 320, 384).
+192
+
+
+
+GstTwoLame::copyright
+gboolean
+
+rw
+Copyright
+Mark as copyright.
+FALSE
+
+
+
+GstTwoLame::emphasis
+GstTwoLameEmphasis
+
+rw
+Emphasis
+Pre-emphasis to apply to the decoded audio.
+No emphasis
+
+
+
+GstTwoLame::energy-level-extension
+gboolean
+
+rw
+Energy Level Extension
+Write peak PCM level to each frame.
+FALSE
+
+
+
+GstTwoLame::error-protection
+gboolean
+
+rw
+Error protection
+Adds checksum to every frame.
+FALSE
+
+
+
+GstTwoLame::mode
+GstTwoLameMode
+
+rw
+Mode
+Encoding mode.
+Joint Stereo
+
+
+
+GstTwoLame::original
+gboolean
+
+rw
+Original
+Mark as original.
+TRUE
+
+
+
+GstTwoLame::padding
+GstTwoLamePadding
+
+rw
+Padding
+Padding type.
+No Padding
+
+
+
+GstTwoLame::psymodel
+gint
+[G_MAXULONG,4]
+rw
+Psychoacoustic Model
+Psychoacoustic model used to encode the audio.
+3
+
+
+
+GstTwoLame::quick-mode
+gboolean
+
+rw
+Quick mode
+Calculate Psymodel every frames.
+FALSE
+
+
+
+GstTwoLame::quick-mode-count
+gint
+>= 0
+rw
+Quick mode count
+Calculate Psymodel every n frames.
+10
+
+
+
+GstTwoLame::vbr
+gboolean
+
+rw
+VBR
+Enable variable bitrate mode.
+FALSE
+
+
+
+GstTwoLame::vbr-level
+gfloat
+[-10,10]
+rw
+VBR Level
+VBR Level.
+5
+
+
+
+GstTwoLame::vbr-max-bitrate
+gint
+[0,384]
+rw
+VBR max bitrate
+Specify maximum VBR bitrate (0=off, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, 192, 224, 256, 320, 384).
+0
+
+
diff --git a/docs/plugins/gst-plugins-good-plugins.hierarchy b/docs/plugins/gst-plugins-good-plugins.hierarchy
index 6e101cbf28..7e17ed3aae 100644
--- a/docs/plugins/gst-plugins-good-plugins.hierarchy
+++ b/docs/plugins/gst-plugins-good-plugins.hierarchy
@@ -36,6 +36,7 @@ GObject
GstLameMP3Enc
GstMuLawEnc
GstSpeexEnc
+ GstTwoLame
GstWavpackEnc
GstAudioVisualizer
GstGoom
diff --git a/docs/plugins/gst-plugins-good-plugins.interfaces b/docs/plugins/gst-plugins-good-plugins.interfaces
index 2025f2b4a7..1c6eca5274 100644
--- a/docs/plugins/gst-plugins-good-plugins.interfaces
+++ b/docs/plugins/gst-plugins-good-plugins.interfaces
@@ -88,6 +88,7 @@ GstSwitchSink GstChildProxy
GstSwitchSrc GstChildProxy
GstTagLibMux GstTagSetter
GstTagMux GstTagSetter
+GstTwoLame GstPreset
GstUDPSink GstURIHandler
GstUDPSrc GstURIHandler
GstV4l2Radio GstURIHandler GstImplementsInterface GstTuner GstPropertyProbe
diff --git a/docs/plugins/inspect/plugin-twolame.xml b/docs/plugins/inspect/plugin-twolame.xml
new file mode 100644
index 0000000000..5f0a9bdb6d
--- /dev/null
+++ b/docs/plugins/inspect/plugin-twolame.xml
@@ -0,0 +1,34 @@
+
+ twolame
+ Encode MP2s with TwoLAME
+ ../../ext/twolame/.libs/libgsttwolame.so
+ libgsttwolame.so
+ 1.13.0.1
+ LGPL
+ gst-plugins-good
+ GStreamer Good Plug-ins git
+ Unknown package origin
+
+
+ twolamemp2enc
+ TwoLAME mp2 encoder
+ Codec/Encoder/Audio
+ High-quality free MP2 encoder
+ Sebastian Dröge <sebastian.droege@collabora.co.uk>
+
+
+ sink
+ sink
+ always
+ audio/x-raw, format=(string){ F32LE, S16LE }, layout=(string)interleaved, rate=(int){ 16000, 22050, 24000, 32000, 44100, 48000 }, channels=(int)1; audio/x-raw, format=(string){ F32LE, S16LE }, layout=(string)interleaved, rate=(int){ 16000, 22050, 24000, 32000, 44100, 48000 }, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
+
+
+ src
+ source
+ always
+ audio/mpeg, mpegversion=(int)1, layer=(int)2, rate=(int){ 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 fee653f55e..7d34902055 100644
--- a/ext/Makefile.am
+++ b/ext/Makefile.am
@@ -101,6 +101,12 @@ else
TAGLIB_DIR =
endif
+if USE_TWOLAME
+TWOLAME_DIR = twolame
+else
+TWOLAME_DIR =
+endif
+
if USE_VPX
VPX_DIR=vpx
else
@@ -132,6 +138,7 @@ SUBDIRS = \
$(SOUP_DIR) \
$(SPEEX_DIR) \
$(TAGLIB_DIR) \
+ $(TWOLAME_DIR) \
$(VPX_DIR) \
$(WAVPACK_DIR)
@@ -153,6 +160,7 @@ DIST_SUBDIRS = \
soup \
speex \
taglib \
+ twolame \
vpx \
wavpack
diff --git a/ext/meson.build b/ext/meson.build
index 3bc8c8212e..2758877a51 100644
--- a/ext/meson.build
+++ b/ext/meson.build
@@ -23,5 +23,6 @@ if cc.get_id() == 'msvc'
else
subdir('taglib')
endif
+subdir('twolame')
subdir('vpx')
subdir('wavpack')
diff --git a/ext/twolame/meson.build b/ext/twolame/meson.build
index 029a00eb4b..cabab63adc 100644
--- a/ext/twolame/meson.build
+++ b/ext/twolame/meson.build
@@ -3,7 +3,7 @@ twolame_dep = dependency('twolame', version : '>= 0.3.10', required : false)
if twolame_dep.found()
twolame = library('gsttwolame',
['gsttwolamemp2enc.c'],
- c_args : ugly_args,
+ c_args : gst_plugins_good_args,
include_directories : [configinc, libsinc],
dependencies : [gstaudio_dep, twolame_dep],
install : true,
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 895c7fe0b9..d99dfde4e2 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -7,6 +7,7 @@ ext/libpng/gstpngdec.c
ext/pulse/pulsesink.c
ext/shout2/gstshout2.c
ext/soup/gstsouphttpsrc.c
+ext/twolame/gsttwolamemp2enc.c
gst/audioparsers/gstwavpackparse.c
gst/avi/gstavidemux.c
gst/avi/gstavimux.c