mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 03:19:40 +00:00
lame: remove lame element, it's been superseded by lamemp3enc
This commit is contained in:
parent
42a7484cea
commit
713f4bc700
7 changed files with 6 additions and 1451 deletions
|
@ -1,6 +1,6 @@
|
|||
plugin_LTLIBRARIES = libgstlame.la
|
||||
|
||||
libgstlame_la_SOURCES = gstlame.c gstlamemp3enc.c plugin.c
|
||||
libgstlame_la_SOURCES = gstlamemp3enc.c plugin.c
|
||||
libgstlame_la_CFLAGS = -DGST_USE_UNSTABLE_API \
|
||||
$(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) $(LAME_CFLAGS)
|
||||
libgstlame_la_LIBADD = $(LAME_LIBS) $(GST_PLUGINS_BASE_LIBS) \
|
||||
|
@ -8,4 +8,4 @@ libgstlame_la_LIBADD = $(LAME_LIBS) $(GST_PLUGINS_BASE_LIBS) \
|
|||
libgstlame_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
||||
libgstlame_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
noinst_HEADERS = gstlame.h gstlamemp3enc.h
|
||||
noinst_HEADERS = gstlamemp3enc.h
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
The lame plugin uses the lame library available at:
|
||||
lame.sourceforge.net
|
||||
|
||||
lame is available under the terms of the LGPL license
|
1215
ext/lame/gstlame.c
1215
ext/lame/gstlame.c
File diff suppressed because it is too large
Load diff
|
@ -1,111 +0,0 @@
|
|||
/* GStreamer
|
||||
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __GST_LAME_H__
|
||||
#define __GST_LAME_H__
|
||||
|
||||
|
||||
#include <gst/gst.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#include <lame/lame.h>
|
||||
#include <gst/audio/gstaudioencoder.h>
|
||||
|
||||
#define GST_TYPE_LAME \
|
||||
(gst_lame_get_type())
|
||||
#define GST_LAME(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_LAME,GstLame))
|
||||
#define GST_LAME_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_LAME,GstLameClass))
|
||||
#define GST_IS_LAME(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_LAME))
|
||||
#define GST_IS_LAME_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_LAME))
|
||||
|
||||
typedef struct _GstLame GstLame;
|
||||
typedef struct _GstLameClass GstLameClass;
|
||||
|
||||
/**
|
||||
* GstLame:
|
||||
*
|
||||
* Opaque data structure.
|
||||
*/
|
||||
struct _GstLame {
|
||||
GstAudioEncoder element;
|
||||
|
||||
/*< private >*/
|
||||
|
||||
gint samplerate;
|
||||
gint num_channels;
|
||||
gboolean setup;
|
||||
|
||||
gint bitrate;
|
||||
gfloat compression_ratio;
|
||||
gint quality;
|
||||
gint mode; /* actual mode in use now */
|
||||
gint requested_mode; /* requested mode by user/app */
|
||||
gboolean force_ms;
|
||||
gboolean free_format;
|
||||
gboolean copyright;
|
||||
gboolean original;
|
||||
gboolean error_protection;
|
||||
gboolean extension;
|
||||
gboolean strict_iso;
|
||||
gboolean disable_reservoir;
|
||||
gint vbr;
|
||||
gint vbr_quality;
|
||||
gint vbr_mean_bitrate;
|
||||
gint vbr_min_bitrate;
|
||||
gint vbr_max_bitrate;
|
||||
gint vbr_hard_min;
|
||||
gint lowpass_freq;
|
||||
gint lowpass_width;
|
||||
gint highpass_freq;
|
||||
gint highpass_width;
|
||||
gboolean ath_only;
|
||||
gboolean ath_short;
|
||||
gboolean no_ath;
|
||||
gint ath_type;
|
||||
gint ath_lower;
|
||||
gboolean allow_diff_short;
|
||||
gboolean no_short_blocks;
|
||||
gboolean emphasis;
|
||||
gint preset;
|
||||
|
||||
/* track this so we don't send a last buffer in eos handler after error */
|
||||
GstFlowReturn last_flow;
|
||||
|
||||
lame_global_flags *lgf;
|
||||
|
||||
/* time tracker */
|
||||
guint64 last_ts, last_offs, last_duration, eos_ts;
|
||||
};
|
||||
|
||||
struct _GstLameClass {
|
||||
GstAudioEncoderClass parent_class;
|
||||
};
|
||||
|
||||
GType gst_lame_get_type(void);
|
||||
gboolean gst_lame_register (GstPlugin * plugin);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GST_LAME_H__ */
|
|
@ -24,7 +24,6 @@
|
|||
#include <gst/gst.h>
|
||||
#include <gst/gst-i18n-plugin.h>
|
||||
|
||||
#include "gstlame.h"
|
||||
#include "gstlamemp3enc.h"
|
||||
|
||||
static gboolean
|
||||
|
@ -35,10 +34,7 @@ plugin_init (GstPlugin * plugin)
|
|||
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
|
||||
#endif /* ENABLE_NLS */
|
||||
|
||||
if (!gst_lamemp3enc_register (plugin) || !gst_lame_register (plugin))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
return gst_lamemp3enc_register (plugin);
|
||||
}
|
||||
|
||||
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
||||
|
|
|
@ -1,111 +0,0 @@
|
|||
#include <gst/gst.h>
|
||||
|
||||
|
||||
/*
|
||||
* this example uses tee, fakesrc, fakesink and lame
|
||||
*
|
||||
* it requests a new pad from tee and attaches lame and fakesink
|
||||
* after iterating
|
||||
* it requests another one
|
||||
* this is to test if the encoder is initialized ok when adding to a
|
||||
* pipe that has played
|
||||
*/
|
||||
|
||||
static void
|
||||
error_callback (GObject * object, GstObject * orig, gchar * error)
|
||||
{
|
||||
g_print ("ERROR: %s: %s\n", GST_OBJECT_NAME (orig), error);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
GstElement *pipeline;
|
||||
GstElement *src, *tee, *encoder1, *encoder2, *sink1, *sink2;
|
||||
GstPad *teepad1, *teepad2;
|
||||
GstCaps *caps;
|
||||
|
||||
|
||||
gst_init (&argc, &argv);
|
||||
|
||||
/* create elements */
|
||||
if (!(pipeline = gst_element_factory_make ("pipeline", "pipeline")))
|
||||
return 1;
|
||||
if (!(src = gst_element_factory_make ("fakesrc", "source")))
|
||||
return 1;
|
||||
if (!(tee = gst_element_factory_make ("tee", "tee")))
|
||||
return 1;
|
||||
if (!(encoder1 = gst_element_factory_make ("lame", "lame1")))
|
||||
return 1;
|
||||
if (!(encoder2 = gst_element_factory_make ("lame", "lame2")))
|
||||
return 1;
|
||||
if (!(sink1 = gst_element_factory_make ("fakesink", "sink1")))
|
||||
return 1;
|
||||
if (!(sink2 = gst_element_factory_make ("fakesink", "sink2")))
|
||||
return 1;
|
||||
|
||||
pipeline = gst_pipeline_new ("pipeline");
|
||||
g_signal_connect (pipeline, "error", G_CALLBACK (error_callback), NULL);
|
||||
|
||||
/* set up input */
|
||||
g_print ("setting up input\n");
|
||||
gst_bin_add (GST_BIN (pipeline), src);
|
||||
gst_bin_add (GST_BIN (pipeline), tee);
|
||||
gst_pad_link (gst_element_get_pad (src, "src"),
|
||||
gst_element_get_pad (tee, "sink"));
|
||||
|
||||
/* set up fakesrc */
|
||||
g_object_set (G_OBJECT (src), "filltype", 3, NULL);
|
||||
g_object_set (G_OBJECT (src), "sizetype", 3, NULL);
|
||||
|
||||
/* set caps on fakesrc */
|
||||
caps = GST_CAPS_NEW ("input audio",
|
||||
"audio/raw",
|
||||
"format", GST_PROPS_STRING ("int"),
|
||||
"rate", GST_PROPS_INT (44100),
|
||||
"width", GST_PROPS_INT (16),
|
||||
"depth", GST_PROPS_INT (16),
|
||||
"law", GST_PROPS_INT (0),
|
||||
"signed", GST_PROPS_BOOLEAN (TRUE), "channels", GST_PROPS_INT (1)
|
||||
);
|
||||
|
||||
g_object_set (G_OBJECT (src), "sizetype", 3, "filltype", 3, NULL);
|
||||
|
||||
|
||||
gst_element_set_state (pipeline, GST_STATE_READY);
|
||||
g_print ("Setting caps on fakesrc's src pad\n");
|
||||
if (gst_pad_try_set_caps (gst_element_get_pad (src, "src"), caps) <= 0)
|
||||
g_print ("Could not set caps !\n");
|
||||
|
||||
/* request first pad from tee and connect */
|
||||
g_print ("attaching first output pipe to tee\n");
|
||||
teepad1 = gst_element_request_pad_by_name (tee, "src%d");
|
||||
|
||||
gst_bin_add (GST_BIN (pipeline), encoder1);
|
||||
gst_bin_add (GST_BIN (pipeline), sink1);
|
||||
gst_pad_link (teepad1, gst_element_get_pad (encoder1, "sink"));
|
||||
gst_pad_link (gst_element_get_pad (encoder1, "src"),
|
||||
gst_element_get_pad (sink1, "sink"));
|
||||
|
||||
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
||||
/* iterate */
|
||||
g_print ("iterate\n");
|
||||
gst_bin_iterate (GST_BIN (pipeline));
|
||||
gst_element_set_state (pipeline, GST_STATE_PAUSED);
|
||||
|
||||
/* request second pad and connect */
|
||||
g_print ("attaching second output pipe to tee\n");
|
||||
teepad2 = gst_element_request_pad_by_name (tee, "src%d");
|
||||
|
||||
gst_bin_add (GST_BIN (pipeline), encoder2);
|
||||
gst_bin_add (GST_BIN (pipeline), sink2);
|
||||
gst_pad_link (teepad2, gst_element_get_pad (encoder2, "sink"));
|
||||
gst_pad_link (gst_element_get_pad (encoder2, "src"),
|
||||
gst_element_get_pad (sink2, "sink"));
|
||||
|
||||
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
||||
g_print ("iterate\n");
|
||||
gst_bin_iterate (GST_BIN (pipeline));
|
||||
g_print ("done\n");
|
||||
return 0;
|
||||
}
|
|
@ -34,8 +34,8 @@ GST_START_TEST (test_format)
|
|||
GError *error = NULL;
|
||||
|
||||
pipe_str = g_strdup_printf ("audiotestsrc num-buffers=1 "
|
||||
"! audio/x-raw-int, rate=22050, channels=1 "
|
||||
"! lame bitrate=24 mode=3 " "! audio/mpeg,rate=22050 ! fakesink");
|
||||
"! audio/x-raw, rate=22050, channels=1 "
|
||||
"! lamemp3enc bitrate=24 ! audio/mpeg,rate=22050 ! fakesink");
|
||||
|
||||
bin = gst_parse_launch (pipe_str, &error);
|
||||
fail_unless (bin != NULL, "Error parsing pipeline: %s",
|
||||
|
@ -74,7 +74,7 @@ GST_START_TEST (test_caps_proxy)
|
|||
GError *error = NULL;
|
||||
|
||||
pipe_str = g_strdup_printf ("audiotestsrc num-buffers=1 "
|
||||
"! audio/x-raw-int,rate=48000,channels=1 "
|
||||
"! audio/x-raw,rate=48000,channels=1 "
|
||||
"! audioresample "
|
||||
"! lamemp3enc ! audio/mpeg,rate=(int){22050,44100} ! fakesink");
|
||||
|
||||
|
|
Loading…
Reference in a new issue