mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
51cbf22624
Original commit message from CVS: This is a megapatch with the following changes: - moved the gchar *name to GstObject, removed the ones in GstElement and GstPad. - moved the parent handling completely into GstObject. This cause *all* of the plugins to fail (except those that used gst_pad_get_parent) - rearanged the XML save handling. - GstObject now has a class function save/restore_thyself. - GstObject has a generic method gst_object_save_thyself, this makes it possible to fire a signal wehever a new object is loaded. This is needed so we can add XML save hooks. - GstXML API has changed slightly. You now have to create a GstXML object first before you can actually load something. This makes it possible to attach a signal to GstXML whenever an object is loaded. I'm not sure we will keep this interface. - GstObject can now print the path_string without knowing about the GstPad and GstElement types. - Added gst_bin_get_by_name_recurse_up to lookup an element in the current element hierarchy. - added XML namespaces to the saved pipelines the namespace is: http://gstreamer.net/gst-core/1.0/ namespaces are needed to distinguish user generated XML from the core XML. Note that the plugins still contain a macro GST_OBJECT_PARENT that will be replaced with gst_pad_get_parent shortly.
41 lines
1.1 KiB
C
41 lines
1.1 KiB
C
#include <sys/types.h>
|
|
#include <sys/stat.h>
|
|
#include <fcntl.h>
|
|
#include <glib.h>
|
|
#include <gst/gst.h>
|
|
|
|
int main(int argc,char *argv[]) {
|
|
int fd;
|
|
GstElement *pipeline, *audiosrc, *fdsink;
|
|
GstElementFactory *audiosrcfactory, *fdsinkfactory;
|
|
GList *padlist;
|
|
|
|
gst_init(&argc,&argv);
|
|
|
|
pipeline = GST_ELEMENT(gst_pipeline_new("pipeline"));
|
|
|
|
audiosrcfactory = gst_elementfactory_find("audiosrc");
|
|
audiosrc = gst_elementfactory_create(audiosrcfactory,"audiosrc");
|
|
|
|
fd = open(argv[1],O_CREAT|O_RDWR);
|
|
|
|
fdsinkfactory = gst_elementfactory_find("fdsink");
|
|
fdsink = gst_elementfactory_create(fdsinkfactory,"fdsink");
|
|
gtk_object_set(GTK_OBJECT(fdsink),"fd",fd,NULL);
|
|
|
|
/* add objects to the main pipeline */
|
|
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(audiosrc));
|
|
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(fdsink));
|
|
|
|
/* connect src to sink */
|
|
gst_pad_connect(gst_element_get_pad(audiosrc,"src"),
|
|
gst_element_get_pad(fdsink,"sink"));
|
|
|
|
g_print("\nok, runnable, hitting 'play'...\n");
|
|
gst_element_set_state(GST_ELEMENT(pipeline),GST_STATE_PLAYING);
|
|
|
|
while(1) {
|
|
gst_bin_iterate(GST_BIN(pipeline));
|
|
}
|
|
}
|
|
|