mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
slightly changed the Makefile.am in videoscale libs.
Original commit message from CVS: slightly changed the Makefile.am in videoscale libs. v4lsrc works again A little modification to the videotest programm to use a tee element. added support for multiple paths in --gst-plugin_path=. added ab ENV variable GST_PLUGIN_PATH to specify extra directories to look for plugins.
This commit is contained in:
parent
3a39f8d1d1
commit
58a66780d8
3 changed files with 65 additions and 5 deletions
41
gst/gst.c
41
gst/gst.c
|
@ -35,6 +35,7 @@
|
||||||
#include "gsttypefind.h"
|
#include "gsttypefind.h"
|
||||||
|
|
||||||
|
|
||||||
|
#define MAX_PATH_SPLIT 16
|
||||||
|
|
||||||
gchar *_gst_progname;
|
gchar *_gst_progname;
|
||||||
|
|
||||||
|
@ -89,6 +90,31 @@ gst_init (int *argc, char **argv[])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gst_add_paths_func (gchar *pathlist)
|
||||||
|
{
|
||||||
|
gchar **paths;
|
||||||
|
gint j = 0;
|
||||||
|
gchar *lastpath = g_strdup (pathlist);
|
||||||
|
|
||||||
|
while (lastpath) {
|
||||||
|
paths = g_strsplit (lastpath, G_SEARCHPATH_SEPARATOR_S, MAX_PATH_SPLIT);
|
||||||
|
g_free (lastpath);
|
||||||
|
lastpath = NULL;
|
||||||
|
|
||||||
|
while (paths[j]) {
|
||||||
|
GST_INFO (GST_CAT_GST_INIT, "Adding plugin path: \"%s\"", paths[j]);
|
||||||
|
gst_plugin_add_path (paths[j]);
|
||||||
|
if (++j == MAX_PATH_SPLIT) {
|
||||||
|
lastpath = g_strdup (paths[j]);
|
||||||
|
g_strfreev (paths);
|
||||||
|
j=0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* returns FALSE if the program can be aborted */
|
/* returns FALSE if the program can be aborted */
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_init_check (int *argc,
|
gst_init_check (int *argc,
|
||||||
|
@ -135,7 +161,7 @@ gst_init_check (int *argc,
|
||||||
(*argv)[i] = NULL;
|
(*argv)[i] = NULL;
|
||||||
}
|
}
|
||||||
else if (!strncmp ("--gst-plugin-path=", (*argv)[i], 17)) {
|
else if (!strncmp ("--gst-plugin-path=", (*argv)[i], 17)) {
|
||||||
gst_plugin_add_path ((*argv)[i]+18);
|
gst_add_paths_func ((*argv)[i]+18);
|
||||||
|
|
||||||
(*argv)[i] = NULL;
|
(*argv)[i] = NULL;
|
||||||
}
|
}
|
||||||
|
@ -158,16 +184,25 @@ gst_init_check (int *argc,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* check for ENV variables */
|
||||||
|
{
|
||||||
|
gchar *plugin_path = g_getenv("GST_PLUGIN_PATH");
|
||||||
|
|
||||||
|
gst_add_paths_func (plugin_path);
|
||||||
|
}
|
||||||
|
|
||||||
if (showhelp) {
|
if (showhelp) {
|
||||||
guint i;
|
guint i;
|
||||||
|
|
||||||
g_print ("usage %s [OPTION...]\n", (*argv)[0]);
|
g_print ("usage %s [OPTION...]\n", _gst_progname);
|
||||||
|
|
||||||
g_print ("\nGStreamer options\n");
|
g_print ("\nGStreamer options\n");
|
||||||
g_print (" --gst-info-mask=FLAGS GST info flags to set (current %08x)\n", gst_info_get_categories());
|
g_print (" --gst-info-mask=FLAGS GST info flags to set (current %08x)\n", gst_info_get_categories());
|
||||||
g_print (" --gst-debug-mask=FLAGS GST debugging flags to set\n");
|
g_print (" --gst-debug-mask=FLAGS GST debugging flags to set\n");
|
||||||
g_print (" --gst-plugin-spew Enable printout of errors while loading GST plugins\n");
|
g_print (" --gst-plugin-spew Enable printout of errors while loading GST plugins\n");
|
||||||
g_print (" --gst-plugin-path=PATH Add a directory to the plugin search path\n");
|
g_print (" --gst-plugin-path=PATH Add directories separated with '%s' to the plugin search path\n",
|
||||||
|
G_SEARCHPATH_SEPARATOR_S);
|
||||||
|
|
||||||
g_print ("\n Mask (to be OR'ed) info/debug FLAGS \n");
|
g_print ("\n Mask (to be OR'ed) info/debug FLAGS \n");
|
||||||
g_print ("--------------------------------------------------------\n");
|
g_print ("--------------------------------------------------------\n");
|
||||||
|
|
|
@ -16,4 +16,4 @@ libgstvideoscaleinclude_HEADERS = gstvideoscale.h
|
||||||
noinst_HEADERS = gstscale_x86.h
|
noinst_HEADERS = gstscale_x86.h
|
||||||
|
|
||||||
#CFLAGS += -S -O1 $(FOMIT_FRAME_POINTER) -funroll-all-loops -finline-functions -ffast-math
|
#CFLAGS += -S -O1 $(FOMIT_FRAME_POINTER) -funroll-all-loops -finline-functions -ffast-math
|
||||||
CFLAGS = $(GLIB_CFLAGS) $(GST_CFLAGS) $(XML_CFLAGS) -O5 -fomit-frame-pointer -ffast-math
|
CFLAGS = $(GLIB_CFLAGS) $(GTK_CFLAGS) $(GST_CFLAGS) $(XML_CFLAGS) -O5 -fomit-frame-pointer -ffast-math
|
||||||
|
|
|
@ -6,17 +6,21 @@ extern gboolean _gst_plugin_spew;
|
||||||
gboolean idle_func(gpointer data);
|
gboolean idle_func(gpointer data);
|
||||||
|
|
||||||
GstElement *videosink;
|
GstElement *videosink;
|
||||||
|
GstElement *videosink2;
|
||||||
GstElement *src;
|
GstElement *src;
|
||||||
|
|
||||||
int main(int argc,char *argv[]) {
|
int main(int argc,char *argv[]) {
|
||||||
GstElement *bin;
|
GstElement *bin;
|
||||||
|
GstElement *tee;
|
||||||
GstElementFactory *srcfactory;
|
GstElementFactory *srcfactory;
|
||||||
GstElementFactory *videosinkfactory;
|
GstElementFactory *videosinkfactory;
|
||||||
|
|
||||||
GtkWidget *appwindow;
|
GtkWidget *appwindow;
|
||||||
|
GtkWidget *appwindow2;
|
||||||
GtkWidget *vbox1;
|
GtkWidget *vbox1;
|
||||||
GtkWidget *button;
|
GtkWidget *button;
|
||||||
GtkWidget *draw;
|
GtkWidget *draw;
|
||||||
|
GtkWidget *draw2;
|
||||||
|
|
||||||
|
|
||||||
//_gst_plugin_spew = TRUE;
|
//_gst_plugin_spew = TRUE;
|
||||||
|
@ -34,17 +38,33 @@ int main(int argc,char *argv[]) {
|
||||||
g_return_if_fail(videosinkfactory != NULL);
|
g_return_if_fail(videosinkfactory != NULL);
|
||||||
|
|
||||||
src = gst_elementfactory_create(srcfactory,"src");
|
src = gst_elementfactory_create(srcfactory,"src");
|
||||||
|
gtk_object_set(GTK_OBJECT(src),"format",3,NULL);
|
||||||
|
gtk_object_set(GTK_OBJECT(src),"width",320,"height",240,NULL);
|
||||||
|
|
||||||
videosink = gst_elementfactory_create(videosinkfactory,"videosink");
|
videosink = gst_elementfactory_create(videosinkfactory,"videosink");
|
||||||
|
gtk_object_set(GTK_OBJECT(videosink),"xv_enabled",FALSE,NULL);
|
||||||
gtk_object_set(GTK_OBJECT(videosink),"width",320,"height",240,NULL);
|
gtk_object_set(GTK_OBJECT(videosink),"width",320,"height",240,NULL);
|
||||||
|
|
||||||
|
videosink2 = gst_elementfactory_create(videosinkfactory,"videosink2");
|
||||||
|
gtk_object_set(GTK_OBJECT(videosink2),"xv_enabled",FALSE,NULL);
|
||||||
|
gtk_object_set(GTK_OBJECT(videosink2),"width",320,"height",240,NULL);
|
||||||
|
|
||||||
|
tee = gst_elementfactory_make ("tee", "tee");
|
||||||
|
|
||||||
gst_bin_add(GST_BIN(bin),GST_ELEMENT(src));
|
gst_bin_add(GST_BIN(bin),GST_ELEMENT(src));
|
||||||
|
gst_bin_add(GST_BIN(bin),GST_ELEMENT(tee));
|
||||||
gst_bin_add(GST_BIN(bin),GST_ELEMENT(videosink));
|
gst_bin_add(GST_BIN(bin),GST_ELEMENT(videosink));
|
||||||
|
gst_bin_add(GST_BIN(bin),GST_ELEMENT(videosink2));
|
||||||
|
|
||||||
gst_pad_connect(gst_element_get_pad(src,"src"),
|
gst_pad_connect(gst_element_get_pad(src,"src"),
|
||||||
|
gst_element_get_pad(tee,"sink"));
|
||||||
|
gst_pad_connect(gst_element_request_pad_by_name (tee,"src%d"),
|
||||||
gst_element_get_pad(videosink,"sink"));
|
gst_element_get_pad(videosink,"sink"));
|
||||||
|
gst_pad_connect(gst_element_request_pad_by_name (tee,"src%d"),
|
||||||
|
gst_element_get_pad(videosink2,"sink"));
|
||||||
|
|
||||||
appwindow = gnome_app_new("Videotest","Videotest");
|
appwindow = gnome_app_new("Videotest","Videotest");
|
||||||
|
appwindow2 = gnome_app_new("Videotest2","Videotest2");
|
||||||
|
|
||||||
vbox1 = gtk_vbox_new (FALSE, 0);
|
vbox1 = gtk_vbox_new (FALSE, 0);
|
||||||
gtk_widget_show (vbox1);
|
gtk_widget_show (vbox1);
|
||||||
|
@ -60,15 +80,20 @@ int main(int argc,char *argv[]) {
|
||||||
draw,
|
draw,
|
||||||
TRUE, TRUE, 0);
|
TRUE, TRUE, 0);
|
||||||
gtk_widget_show (draw);
|
gtk_widget_show (draw);
|
||||||
|
|
||||||
|
draw2 = gst_util_get_widget_arg(GTK_OBJECT(videosink2),"widget"),
|
||||||
|
gtk_widget_show (draw2);
|
||||||
|
|
||||||
gnome_app_set_contents(GNOME_APP(appwindow), vbox1);
|
gnome_app_set_contents(GNOME_APP(appwindow), vbox1);
|
||||||
|
|
||||||
|
gnome_app_set_contents(GNOME_APP(appwindow2), draw2);
|
||||||
|
|
||||||
gtk_object_set(GTK_OBJECT(appwindow),"allow_grow",TRUE,NULL);
|
gtk_object_set(GTK_OBJECT(appwindow),"allow_grow",TRUE,NULL);
|
||||||
gtk_object_set(GTK_OBJECT(appwindow),"allow_shrink",TRUE,NULL);
|
gtk_object_set(GTK_OBJECT(appwindow),"allow_shrink",TRUE,NULL);
|
||||||
|
|
||||||
gtk_widget_show_all(appwindow);
|
gtk_widget_show_all(appwindow);
|
||||||
|
gtk_widget_show_all(appwindow2);
|
||||||
|
|
||||||
gst_element_set_state(GST_ELEMENT(bin),GST_STATE_READY);
|
|
||||||
gst_element_set_state(GST_ELEMENT(bin),GST_STATE_PLAYING);
|
gst_element_set_state(GST_ELEMENT(bin),GST_STATE_PLAYING);
|
||||||
|
|
||||||
//gtk_object_set(GTK_OBJECT(src),"tune",133250,NULL);
|
//gtk_object_set(GTK_OBJECT(src),"tune",133250,NULL);
|
||||||
|
|
Loading…
Reference in a new issue