mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-22 17:51:16 +00:00
Added LAME encoder. Wow.
Original commit message from CVS: Added LAME encoder. Wow.
This commit is contained in:
parent
ffbc7201a7
commit
5f7a20ff6f
7 changed files with 61 additions and 5 deletions
|
@ -429,6 +429,8 @@ plugins/mp3decode/xa/Makefile
|
||||||
plugins/mp3decode/xing/Makefile
|
plugins/mp3decode/xing/Makefile
|
||||||
plugins/mp3decode/mpg123/Makefile
|
plugins/mp3decode/mpg123/Makefile
|
||||||
plugins/mp3decode/parse/Makefile
|
plugins/mp3decode/parse/Makefile
|
||||||
|
plugins/mp3encode/Makefile
|
||||||
|
plugins/mp3encode/lame/Makefile
|
||||||
plugins/mpeg2/Makefile
|
plugins/mpeg2/Makefile
|
||||||
plugins/mpeg2/parse/Makefile
|
plugins/mpeg2/parse/Makefile
|
||||||
plugins/mpeg2/ac3parse/Makefile
|
plugins/mpeg2/ac3parse/Makefile
|
||||||
|
|
|
@ -116,8 +116,10 @@ gst_fdsink_chain (GstPad *pad, GstBuffer *buf)
|
||||||
|
|
||||||
g_return_if_fail (fdsink->fd >= 0);
|
g_return_if_fail (fdsink->fd >= 0);
|
||||||
|
|
||||||
if (GST_BUFFER_DATA (buf))
|
if (GST_BUFFER_DATA (buf)) {
|
||||||
|
DEBUG("writing %d bytes to file descriptor %d\n",GST_BUFFER_SIZE (buf), fdsink->fd);
|
||||||
write (fdsink->fd, GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf));
|
write (fdsink->fd, GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf));
|
||||||
|
}
|
||||||
|
|
||||||
gst_buffer_unref (buf);
|
gst_buffer_unref (buf);
|
||||||
}
|
}
|
||||||
|
|
|
@ -794,7 +794,7 @@ gst_bin_create_plan_func (GstBin *bin)
|
||||||
gst_bin_create_plan (GST_BIN (element));
|
gst_bin_create_plan (GST_BIN (element));
|
||||||
|
|
||||||
} else if (GST_IS_SRC (element)) {
|
} else if (GST_IS_SRC (element)) {
|
||||||
DEBUG("adding '%s' as entry point\n",gst_element_get_name (element));
|
DEBUG("adding '%s' as entry point, because it's a source\n",gst_element_get_name (element));
|
||||||
bin->entries = g_list_prepend (bin->entries,element);
|
bin->entries = g_list_prepend (bin->entries,element);
|
||||||
bin->numentries++;
|
bin->numentries++;
|
||||||
cothread_setfunc(element->threadstate,gst_bin_src_wrapper,0,(char **)element);
|
cothread_setfunc(element->threadstate,gst_bin_src_wrapper,0,(char **)element);
|
||||||
|
@ -859,7 +859,7 @@ GST_DEBUG_PAD_NAME(pad->peer),GST_DEBUG_PAD_NAME(pad),&pad->pullfunc);
|
||||||
gst_bin_create_plan (GST_BIN (element));
|
gst_bin_create_plan (GST_BIN (element));
|
||||||
}
|
}
|
||||||
if (GST_IS_SRC (element)) {
|
if (GST_IS_SRC (element)) {
|
||||||
g_print("gstbin: adding '%s' as entry point\n",gst_element_get_name (element));
|
g_print("adding '%s' as entry point, because it's a source\n",gst_element_get_name (element));
|
||||||
bin->entries = g_list_prepend (bin->entries, element);
|
bin->entries = g_list_prepend (bin->entries, element);
|
||||||
bin->numentries++;
|
bin->numentries++;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -270,6 +270,7 @@ gboolean gst_plugin_load_absolute(gchar *name) {
|
||||||
GstPlugin *gst_plugin_new(gchar *name) {
|
GstPlugin *gst_plugin_new(gchar *name) {
|
||||||
GstPlugin *plugin = (GstPlugin *)g_malloc(sizeof(GstPlugin));
|
GstPlugin *plugin = (GstPlugin *)g_malloc(sizeof(GstPlugin));
|
||||||
|
|
||||||
|
// FIXME need to make sure the plugin hasn't already loaded
|
||||||
plugin->name = g_strdup(name);
|
plugin->name = g_strdup(name);
|
||||||
plugin->longname = NULL;
|
plugin->longname = NULL;
|
||||||
plugin->types = NULL;
|
plugin->types = NULL;
|
||||||
|
|
|
@ -116,8 +116,10 @@ gst_fdsink_chain (GstPad *pad, GstBuffer *buf)
|
||||||
|
|
||||||
g_return_if_fail (fdsink->fd >= 0);
|
g_return_if_fail (fdsink->fd >= 0);
|
||||||
|
|
||||||
if (GST_BUFFER_DATA (buf))
|
if (GST_BUFFER_DATA (buf)) {
|
||||||
|
DEBUG("writing %d bytes to file descriptor %d\n",GST_BUFFER_SIZE (buf), fdsink->fd);
|
||||||
write (fdsink->fd, GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf));
|
write (fdsink->fd, GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf));
|
||||||
|
}
|
||||||
|
|
||||||
gst_buffer_unref (buf);
|
gst_buffer_unref (buf);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
noinst_PROGRAMS = init loadall simplefake states caps queue registry paranoia
|
noinst_PROGRAMS = init loadall simplefake states caps queue registry paranoia rip
|
||||||
|
|
||||||
LDADD = $(GLIB_LIBS) $(GTK_LIBS) $(top_builddir)/gst/libgst.la
|
LDADD = $(GLIB_LIBS) $(GTK_LIBS) $(top_builddir)/gst/libgst.la
|
||||||
CFLAGS = -Wall
|
CFLAGS = -Wall
|
||||||
|
|
49
tests/rip.c
Normal file
49
tests/rip.c
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
#include <gst/gst.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
|
||||||
|
int main(int argc,char *argv[]) {
|
||||||
|
GstPipeline *pipeline;
|
||||||
|
GstElement *paranoia,*lame,*sink;
|
||||||
|
int i;
|
||||||
|
int outfile;
|
||||||
|
|
||||||
|
DEBUG_ENTER("(%d)",argc);
|
||||||
|
|
||||||
|
gst_init(&argc,&argv);
|
||||||
|
|
||||||
|
unlink(argv[1]);
|
||||||
|
outfile = open(argv[1],O_CREAT | O_RDWR | O_TRUNC);
|
||||||
|
if (!outfile) {
|
||||||
|
fprintf(stderr,"couldn't open file\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
fprintf(stderr,"outfile is fd %d\n",outfile);
|
||||||
|
|
||||||
|
pipeline = gst_pipeline_new("ripper");
|
||||||
|
paranoia = gst_elementfactory_make("cdparanoia","paranoia");
|
||||||
|
g_return_val_if_fail(1,paranoia != NULL);
|
||||||
|
lame = gst_elementfactory_make("lame","lame");
|
||||||
|
g_return_val_if_fail(2,lame != NULL);
|
||||||
|
gtk_object_set(GTK_OBJECT(lame),"bitrate",320,NULL);
|
||||||
|
sink = gst_elementfactory_make("fdsink","fdsink");
|
||||||
|
g_return_val_if_fail(3,sink != NULL);
|
||||||
|
gtk_object_set(GTK_OBJECT(sink),"fd",outfile,NULL);
|
||||||
|
|
||||||
|
fprintf(stderr,"paranoia is %p, lame is %p, sink is %p\n",paranoia,lame,sink);
|
||||||
|
gst_bin_add(GST_BIN(pipeline),paranoia);
|
||||||
|
gst_bin_add(GST_BIN(pipeline),lame);
|
||||||
|
gst_bin_add(GST_BIN(pipeline),sink);
|
||||||
|
|
||||||
|
gst_element_connect(paranoia,"src",lame,"sink");
|
||||||
|
gst_element_connect(lame,"src",sink,"sink");
|
||||||
|
|
||||||
|
gst_element_set_state(GST_ELEMENT(pipeline),GST_STATE_PLAYING);
|
||||||
|
if (GST_STATE(paranoia) != GST_STATE_PLAYING) fprintf(stderr,"error: state not set\n");
|
||||||
|
|
||||||
|
for (i=0;i<((argc >= 3)?atoi(argv[2]):4500);i++) {
|
||||||
|
fprintf(stderr,"\n");
|
||||||
|
gst_bin_iterate(GST_BIN(pipeline));
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue