Fixed a couple of compiler warnings.

Original commit message from CVS:
Fixed a couple of compiler warnings.
This commit is contained in:
Wim Taymans 2001-06-01 18:24:41 +00:00
parent 87f9d504d5
commit 42ebe8b588
14 changed files with 46 additions and 37 deletions

View file

@ -12,7 +12,7 @@ main (int argc, char *argv[])
GstElement *element; GstElement *element;
GstElement *videosink, *osssink; GstElement *videosink, *osssink;
GstAutoplug *autoplugger; GstAutoplug *autoplugger;
GList *testcaps; GstCaps *testcaps;
gst_init(&argc,&argv); gst_init(&argc,&argv);
@ -21,13 +21,12 @@ main (int argc, char *argv[])
videosink = gst_elementfactory_make ("videosink", "videosink"); videosink = gst_elementfactory_make ("videosink", "videosink");
g_assert (videosink != NULL); g_assert (videosink != NULL);
testcaps = g_list_append (NULL, testcaps = gst_caps_new ("test_caps",
gst_caps_new ("test_caps",
"video/mpeg", "video/mpeg",
gst_props_new ( gst_props_new (
"mpegversion", GST_PROPS_INT (1), "mpegversion", GST_PROPS_INT (1),
"systemstream", GST_PROPS_BOOLEAN (TRUE), "systemstream", GST_PROPS_BOOLEAN (TRUE),
NULL))); NULL));
autoplugger = gst_autoplugfactory_make ("static"); autoplugger = gst_autoplugfactory_make ("static");

View file

@ -2,7 +2,6 @@
int main(int argc,char *argv[]) int main(int argc,char *argv[])
{ {
gboolean testret;
xmlDocPtr doc; xmlDocPtr doc;
xmlNodePtr parent; xmlNodePtr parent;
GstElement *mpg123; GstElement *mpg123;

View file

@ -10,8 +10,8 @@ int main(int argc,char *argv[]) {
gst_debug_set_categories(-1); gst_debug_set_categories(-1);
g_print("\n\nConstructing stuff:\n"); g_print("\n\nConstructing stuff:\n");
thread = gst_pipeline_new("thread"); thread = GST_BIN (gst_pipeline_new("thread"));
bin = gst_bin_new("bin"); bin = GST_BIN (gst_bin_new("bin"));
src = gst_elementfactory_make("fakesrc","src"); src = gst_elementfactory_make("fakesrc","src");
identity = gst_elementfactory_make("identity","identity"); identity = gst_elementfactory_make("identity","identity");
sink = gst_elementfactory_make("fakesink","sink"); sink = gst_elementfactory_make("fakesink","sink");
@ -132,4 +132,6 @@ int main(int argc,char *argv[]) {
g_print("\n\nIterating:\n"); g_print("\n\nIterating:\n");
gst_bin_iterate(thread); gst_bin_iterate(thread);
return 0;
} }

View file

@ -2,9 +2,10 @@
int main(int argc,char *argv[]) { int main(int argc,char *argv[]) {
GstElement *element; GstElement *element;
int i;
gst_init(&argc,&argv); gst_init(&argc,&argv);
element = gst_elementfactory_make(argv[1],"element"); element = gst_elementfactory_make(argv[1],"element");
return 0;
} }

View file

@ -3,4 +3,6 @@
int main(int argc,char *argv[]) { int main(int argc,char *argv[]) {
gst_init(&argc,&argv); gst_init(&argc,&argv);
gst_plugin_load_all(); gst_plugin_load_all();
return 0;
} }

View file

@ -1,3 +1,4 @@
#include <string.h>
#include <gst/gst.h> #include <gst/gst.h>
GstElement *audiothread; GstElement *audiothread;
@ -38,7 +39,7 @@ void new_pad(GstElement *parse,GstPad *pad,GstElement *pipeline) {
int main(int argc,char *argv[]) { int main(int argc,char *argv[]) {
GstElement *pipeline, *sourcethread, *src, *parse; GstElement *pipeline, *sourcethread, *src, *parse;
int i; //int i;
gst_init(&argc,&argv); gst_init(&argc,&argv);

View file

@ -8,7 +8,7 @@
int main(int argc,char *argv[]) { int main(int argc,char *argv[]) {
GstPipeline *pipeline; GstPipeline *pipeline;
GstElement *src,*lame,*sink; GstElement *src,*lame,*sink;
int bitrate; int bitrate = 128000;
int fdin = -1; int fdin = -1;
int fdout = -1; int fdout = -1;
int i; int i;
@ -22,8 +22,8 @@ int main(int argc,char *argv[]) {
switch (argv[i][1]) { switch (argv[i][1]) {
case 'b': bitrate = atoi(argv[++i]);break; case 'b': bitrate = atoi(argv[++i]);break;
case 0: { case 0: {
if (fdin == -1) fdin = stdin; if (fdin == -1) fdin = STDIN_FILENO;
else if (fdout == -1) fdout = stdout; else if (fdout == -1) fdout = STDOUT_FILENO;
else fprintf(stderr,"unknown argument\n");exit(1); else fprintf(stderr,"unknown argument\n");exit(1);
break; break;
} }
@ -52,7 +52,7 @@ int main(int argc,char *argv[]) {
} }
} }
pipeline = gst_pipeline_new("mp3encode"); pipeline = GST_PIPELINE (gst_pipeline_new("mp3encode"));
src = gst_elementfactory_make("fdsrc","src"); src = gst_elementfactory_make("fdsrc","src");
g_return_val_if_fail(src != NULL,1); g_return_val_if_fail(src != NULL,1);
@ -81,4 +81,6 @@ int main(int argc,char *argv[]) {
fprintf(stderr,"\n"); fprintf(stderr,"\n");
gst_bin_iterate(GST_BIN(pipeline)); gst_bin_iterate(GST_BIN(pipeline));
} }
return 0;
} }

View file

@ -3,15 +3,15 @@
/* this is an example of the src pad dictating the caps /* this is an example of the src pad dictating the caps
* the sink pad only accepts audio/raw */ * the sink pad only accepts audio/raw */
static GstCaps* static GstPadNegotiateReturn
negotiate (GstPad *pad, GstCaps *caps, gint count) negotiate (GstPad *pad, GstCaps **caps, gpointer *count)
{ {
g_print ("negotiation entered\n"); g_print ("negotiation entered\n");
if (!strcmp (gst_caps_get_mime (caps), "audio/raw")) if (!strcmp (gst_caps_get_mime (*caps), "audio/raw"))
return caps; return GST_PAD_NEGOTIATE_AGREE;
return NULL; return GST_PAD_NEGOTIATE_FAIL;
} }
int int

View file

@ -8,8 +8,7 @@ void paranoia_eos(GstPad *pad) {
int main(int argc,char *argv[]) { int main(int argc,char *argv[]) {
GstPipeline *pipeline; GstPipeline *pipeline;
GstElement *paranoia,*queue,*audio_thread,*osssink; GstElement *paranoia,*queue,*audio_thread,*osssink;
int i; //int track = (argc == 2) ? atoi(argv[1]) : 1;
int track = (argc == 2) ? atoi(argv[1]) : 1;
GST_DEBUG_ENTER("(%d)",argc); GST_DEBUG_ENTER("(%d)",argc);

View file

@ -9,8 +9,8 @@ int main(int argc,char *argv[]) {
gst_info_set_categories(-1); gst_info_set_categories(-1);
gst_debug_set_categories(-1); gst_debug_set_categories(-1);
pipeline = gst_pipeline_new("pipeline"); pipeline = GST_BIN (gst_pipeline_new("pipeline"));
thread = gst_thread_new("thread"); thread = GST_BIN (gst_thread_new("thread"));
src = gst_elementfactory_make("fakesrc","src"); src = gst_elementfactory_make("fakesrc","src");
queue1 = gst_elementfactory_make("queue","queue"); queue1 = gst_elementfactory_make("queue","queue");
sink = gst_elementfactory_make("fakesink","sink"); sink = gst_elementfactory_make("fakesink","sink");
@ -23,13 +23,15 @@ int main(int argc,char *argv[]) {
gst_element_add_ghost_pad(GST_ELEMENT(thread),gst_element_get_pad(sink,"sink"),"sink"); gst_element_add_ghost_pad(GST_ELEMENT(thread),gst_element_get_pad(sink,"sink"),"sink");
gst_element_connect (src,"src",queue1,"sink"); gst_element_connect (src,"src",queue1,"sink");
gst_element_connect (queue1, "src", thread, "sink"); gst_element_connect (queue1, "src", GST_ELEMENT (thread), "sink");
fprintf(stderr,"\n\n\n"); fprintf(stderr,"\n\n\n");
gst_element_set_state (pipeline, GST_STATE_READY); gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_READY);
fprintf(stderr,"\n\n\n"); fprintf(stderr,"\n\n\n");
gst_element_set_state (pipeline, GST_STATE_NULL); gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_NULL);
return 0;
} }

View file

@ -95,7 +95,7 @@ static void
print_some_providers (gchar *mime) print_some_providers (gchar *mime)
{ {
guint16 type; guint16 type;
GList *srcs, *sinks; //GList *srcs, *sinks;
type = gst_type_find_by_mime (mime); type = gst_type_find_by_mime (mime);
/* /*
@ -147,4 +147,6 @@ int main(int argc,char *argv[])
dump_factory ("lame"); dump_factory ("lame");
dump_factory ("mpeg_play"); dump_factory ("mpeg_play");
return 0;
} }

View file

@ -42,7 +42,7 @@ int main(int argc,char *argv[])
g_print ("\n *** using testfile %s\n", argv[1]); g_print ("\n *** using testfile %s\n", argv[1]);
xml = gst_xml_new(); xml = gst_xml_new();
xml = gst_xml_parse_file (xml, argv[1], NULL); gst_xml_parse_file (xml, argv[1], NULL);
toplevelelements = gst_xml_get_topelements (xml); toplevelelements = gst_xml_get_topelements (xml);

View file

@ -3,14 +3,14 @@
int main(int argc,char *argv[]) { int main(int argc,char *argv[]) {
GstBin *pipeline, *thread; GstBin *pipeline, *thread;
GstElement *src, *queue1, *sink; GstElement *src, *sink;
gst_info_set_categories(-1); gst_info_set_categories(-1);
gst_debug_set_categories(-1); gst_debug_set_categories(-1);
gst_init(&argc,&argv); gst_init(&argc,&argv);
pipeline = gst_pipeline_new("pipeline"); pipeline = GST_BIN (gst_pipeline_new("pipeline"));
thread = gst_thread_new("thread"); thread = GST_BIN (gst_thread_new("thread"));
src = gst_elementfactory_make("fakesrc","src"); src = gst_elementfactory_make("fakesrc","src");
gtk_object_set(GTK_OBJECT(src),"silent",TRUE,NULL); gtk_object_set(GTK_OBJECT(src),"silent",TRUE,NULL);
sink = gst_elementfactory_make("fakesink","sink"); sink = gst_elementfactory_make("fakesink","sink");
@ -28,10 +28,10 @@ int main(int argc,char *argv[]) {
while (1) { while (1) {
fprintf(stderr,"\nSWITCHING to PLAYING:\n"); fprintf(stderr,"\nSWITCHING to PLAYING:\n");
gst_element_set_state (thread, GST_STATE_PLAYING); gst_element_set_state (GST_ELEMENT (thread), GST_STATE_PLAYING);
sleep(1); sleep(1);
fprintf(stderr,"\nSWITCHING to PAUSED:\n"); fprintf(stderr,"\nSWITCHING to PAUSED:\n");
gst_element_set_state (thread, GST_STATE_PAUSED); gst_element_set_state (GST_ELEMENT (thread), GST_STATE_PAUSED);
// sleep(1); // sleep(1);
} }
} }