add error handling

Original commit message from CVS:
add error handling
parent f8dd2b32
2004-01-31 Thomas Vander Stichele <thomas at apestaart dot org>
* gst-libs/gst/play/play.c: (gst_play_error_quark),
(gst_play_error_create), (gst_play_error_plugin),
(gst_play_pipeline_setup), (gst_play_init), (gst_play_new):
* gst-libs/gst/play/play.h:
add error handling during creation
* examples/gstplay/player.c: (main):
use new gst_play_new
2004-01-31 Benjamin Otte <in7y118@public.uni-hamburg.de>
* ext/theora/theoradec.c: (theora_dec_chain):
......
......@@ -99,6 +99,7 @@ main (int argc, char *argv[])
{
GstPlay *play;
GstElement *data_src, *video_sink, *audio_sink, *vis_element;
GError *error;
/* Initing GStreamer library */
gst_init (&argc, &argv);
......@@ -111,7 +112,13 @@ main (int argc, char *argv[])
loop = g_main_loop_new (NULL, FALSE);
/* Creating the GstPlay object */
play = gst_play_new ();
play = gst_play_new (&error);
if (error)
{
g_print ("Error: could not create play object:\n%s\n", error->message);
g_error_free (error);
return 1;
}
/* Getting default audio and video plugins from GConf */
audio_sink = gst_element_factory_make ("osssink", "audio_sink");
......
This diff is collapsed.
......@@ -23,6 +23,11 @@
#include <gst/gst.h>
#include <gst/xoverlay/xoverlay.h>
/* GError stuff */
#define GST_PLAY_ERROR gst_play_error_quark ()
/* GObject stuff */
#define GST_TYPE_PLAY (gst_play_get_type())
#define GST_PLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PLAY, GstPlay))
#define GST_PLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PLAY, GstPlayClass))
......@@ -62,7 +67,7 @@ struct _GstPlayClass
};
GType gst_play_get_type (void);
GstPlay * gst_play_new (void);
GstPlay * gst_play_new (GError **error);
gboolean gst_play_set_data_src (GstPlay *play,
GstElement *data_src);
......@@ -82,7 +87,7 @@ char * gst_play_get_location (GstPlay *play);
gboolean gst_play_seek_to_time (GstPlay *play,
gint64 time_nanos);
GstElement * gst_play_get_sink_element (GstPlay *play,
GstElement *element,
GstPlaySinkType sink_type);
......
......@@ -99,6 +99,7 @@ main (int argc, char *argv[])
{
GstPlay *play;
GstElement *data_src, *video_sink, *audio_sink, *vis_element;
GError *error;
/* Initing GStreamer library */
gst_init (&argc, &argv);
......@@ -111,7 +112,13 @@ main (int argc, char *argv[])
loop = g_main_loop_new (NULL, FALSE);
/* Creating the GstPlay object */
play = gst_play_new ();
play = gst_play_new (&error);
if (error)
{
g_print ("Error: could not create play object:\n%s\n", error->message);
g_error_free (error);
return 1;
}
/* Getting default audio and video plugins from GConf */
audio_sink = gst_element_factory_make ("osssink", "audio_sink");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment