Commit 80d8eb35 authored by Wim Taymans's avatar Wim Taymans
Browse files

Lots of compile fixes against glib2.0

Original commit message from CVS:
Lots of compile fixes against glib2.0
parent 17be662a
......@@ -30,7 +30,7 @@ int main(int argc,char *argv[]) {
src = gst_elementfactory_create(srcfactory,"src");
g_return_val_if_fail(src != NULL, -1);
gtk_object_set(GTK_OBJECT(src),"location",argv[1],"bytesperread",4096,NULL);
g_object_set(G_OBJECT(src),"location",argv[1],"bytesperread",4096,NULL);
g_print("should be using file '%s'\n",argv[1]);
parse = gst_elementfactory_create(parsefactory,"parse");
g_return_val_if_fail(parse != NULL, -1);
......
......@@ -23,7 +23,7 @@ int main(int argc,char *argv[]) {
src = gst_elementfactory_make("disksrc","src");
g_return_val_if_fail(src != NULL, -1);
gtk_object_set(GTK_OBJECT(src),"location",argv[1],NULL);
g_object_set(G_OBJECT(src),"location",argv[1],NULL);
// g_print("should be using file '%s'\n",argv[1]);
parse = gst_elementfactory_make("ac3parse","parse");
g_return_val_if_fail(parse != NULL, -1);
......@@ -58,7 +58,7 @@ int main(int argc,char *argv[]) {
xmlSaveFile("ac3play.gst", gst_xml_write(GST_ELEMENT(pipeline)));
// set thread start state
gtk_object_set(GTK_OBJECT(decodethread),"create_thread",TRUE,NULL);
g_object_set(G_OBJECT(decodethread),"create_thread",TRUE,NULL);
g_print("setting to READY state\n");
gst_element_set_state(GST_ELEMENT(pipeline),GST_STATE_PLAYING);
......
......@@ -40,7 +40,7 @@ void new_pad_created(GstElement *parse,GstPad *pad,GstElement *pipeline) {
g_return_if_fail(audio_thread != NULL);
gst_bin_add(GST_BIN(audio_thread),GST_ELEMENT(audio_encode));
gtk_object_set(GTK_OBJECT(mux),"audio","00",NULL);
g_object_set(G_OBJECT(mux),"audio","00",NULL);
// set up pad connections
gst_element_add_ghost_pad(GST_ELEMENT(audio_thread),
......@@ -50,7 +50,7 @@ void new_pad_created(GstElement *parse,GstPad *pad,GstElement *pipeline) {
// construct queue and connect everything in the main pipelie
audio_queue = gst_elementfactory_make("queue","audio_queue");
gtk_object_set(GTK_OBJECT(audio_queue),"max_level",BUFFER,NULL);
g_object_set(G_OBJECT(audio_queue),"max_level",BUFFER,NULL);
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(audio_queue));
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(audio_thread));
gst_pad_connect(pad,
......@@ -60,7 +60,7 @@ void new_pad_created(GstElement *parse,GstPad *pad,GstElement *pipeline) {
// set up thread state and kick things off
gtk_object_set(GTK_OBJECT(audio_thread),"create_thread",TRUE,NULL);
g_object_set(G_OBJECT(audio_thread),"create_thread",TRUE,NULL);
g_print("setting to READY state\n");
gst_element_set_state(GST_ELEMENT(audio_thread),GST_STATE_READY);
} else if (strncmp(gst_pad_get_name(pad), "video_", 6) == 0) {
......@@ -74,17 +74,17 @@ void new_pad_created(GstElement *parse,GstPad *pad,GstElement *pipeline) {
g_return_if_fail(smooth != NULL);
median = gst_elementfactory_make("median","median");
g_return_if_fail(median != NULL);
gtk_object_set(GTK_OBJECT(median),"filtersize",5,NULL);
gtk_object_set(GTK_OBJECT(median),"active",TRUE,NULL);
g_object_set(G_OBJECT(median),"filtersize",5,NULL);
g_object_set(G_OBJECT(median),"active",TRUE,NULL);
gtk_object_set(GTK_OBJECT(smooth),"filtersize",16,NULL);
gtk_object_set(GTK_OBJECT(smooth),"tolerance",16,NULL);
gtk_object_set(GTK_OBJECT(smooth),"active",FALSE,NULL);
g_object_set(G_OBJECT(smooth),"filtersize",16,NULL);
g_object_set(G_OBJECT(smooth),"tolerance",16,NULL);
g_object_set(G_OBJECT(smooth),"active",FALSE,NULL);
encode = gst_elementfactory_make("mpeg2enc","encode");
g_return_if_fail(encode != NULL);
gtk_object_set(GTK_OBJECT(mux),"video","00",NULL);
g_object_set(G_OBJECT(mux),"video","00",NULL);
// create the thread and pack stuff into it
video_thread = gst_thread_new("video_thread");
......@@ -105,7 +105,7 @@ void new_pad_created(GstElement *parse,GstPad *pad,GstElement *pipeline) {
// construct queue and connect everything in the main pipeline
video_queue = gst_elementfactory_make("queue","video_queue");
gtk_object_set(GTK_OBJECT(video_queue),"max_level",BUFFER,NULL);
g_object_set(G_OBJECT(video_queue),"max_level",BUFFER,NULL);
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(video_queue));
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(video_thread));
gst_pad_connect(pad,
......@@ -114,7 +114,7 @@ void new_pad_created(GstElement *parse,GstPad *pad,GstElement *pipeline) {
gst_element_get_pad(video_thread,"sink"));
// set up thread state and kick things off
gtk_object_set(GTK_OBJECT(video_thread),"create_thread",TRUE,NULL);
g_object_set(G_OBJECT(video_thread),"create_thread",TRUE,NULL);
g_print("setting to READY state\n");
gst_element_set_state(GST_ELEMENT(video_thread),GST_STATE_READY);
}
......@@ -139,7 +139,7 @@ int main(int argc,char *argv[]) {
src = gst_elementfactory_make("disksrc","src");
g_return_val_if_fail(src != NULL, -1);
gtk_object_set(GTK_OBJECT(src),"location",argv[1],NULL);
g_object_set(G_OBJECT(src),"location",argv[1],NULL);
g_print("should be using file '%s'\n",argv[1]);
parse = gst_elementfactory_make("avidecoder","parse");
g_return_val_if_fail(parse != NULL, -1);
......@@ -153,18 +153,18 @@ int main(int argc,char *argv[]) {
g_return_val_if_fail(fdsinkfactory != NULL, -1);
fdsink = gst_elementfactory_create(fdsinkfactory,"fdsink");
g_return_val_if_fail(fdsink != NULL, -1);
gtk_object_set(GTK_OBJECT(fdsink),"fd",fd,NULL);
g_object_set(G_OBJECT(fdsink),"fd",fd,NULL);
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(src));
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(parse));
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(mux));
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(fdsink));
gtk_signal_connect(GTK_OBJECT(parse),"new_pad",
GTK_SIGNAL_FUNC(new_pad_created),pipeline);
g_signal_connectc(G_OBJECT(parse),"new_pad",
G_CALLBACK(new_pad_created),pipeline, FALSE);
gtk_signal_connect(GTK_OBJECT(src),"eos",
GTK_SIGNAL_FUNC(eof),NULL);
g_signal_connectc(G_OBJECT(src),"eos",
G_CALLBACK(eof),NULL, FALSE);
gst_pad_connect(gst_element_get_pad(src,"src"),
gst_element_get_pad(parse,"sink"));
......@@ -178,9 +178,7 @@ int main(int argc,char *argv[]) {
g_idle_add(idle_func,pipeline);
gdk_threads_enter();
gtk_main();
gdk_threads_leave();
//gtk_main();
return 0;
}
......
......@@ -24,13 +24,13 @@ int main(int argc,char *argv[]) {
src = gst_elementfactory_make("dvdsrc","src");
g_return_val_if_fail(src != NULL, -1);
gtk_object_set(GTK_OBJECT(src),"location",argv[1],NULL);
g_object_set(G_OBJECT(src),"location",argv[1],NULL);
if (argc >= 3)
gtk_object_set(GTK_OBJECT(src),"offset",atoi(argv[2]),NULL);
g_object_set(G_OBJECT(src),"offset",atoi(argv[2]),NULL);
sink = gst_elementfactory_make("fdsink","sink");
g_return_val_if_fail(sink != NULL, -1);
gtk_object_set(GTK_OBJECT(sink),"fd",fd,NULL);
g_object_set(G_OBJECT(sink),"fd",fd,NULL);
// construct the outer pipeline
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(src));
......
......@@ -41,7 +41,7 @@ GstElement *identity_add(GstPipeline *pipeline, GstElement *first, int count) {
snprintf(buf, 20, "identity_%03d", i);
ident = gst_elementfactory_make("identity",buf);
g_return_val_if_fail(ident != NULL,NULL);
gtk_object_set(GTK_OBJECT(ident),"silent",TRUE,NULL);
g_object_set(G_OBJECT(ident),"silent",TRUE,NULL);
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(ident));
gst_pad_connect(gst_element_get_pad(last,"src"),
gst_element_get_pad(ident,"sink"));
......@@ -56,10 +56,10 @@ GstElement *fakesrc() {
src = gst_elementfactory_make("fakesrc","src");
g_return_val_if_fail(src != NULL,NULL);
gtk_object_set(GTK_OBJECT(src),"silent",TRUE,NULL);
gtk_object_set(GTK_OBJECT(src),"num_buffers",iterations,NULL);
gtk_signal_connect(GTK_OBJECT(src),
"handoff",GTK_SIGNAL_FUNC(handoff_src),NULL);
g_object_set(G_OBJECT(src),"silent",TRUE,NULL);
g_object_set(G_OBJECT(src),"num_buffers",iterations,NULL);
g_signal_connectc(G_OBJECT(src),
"handoff",G_CALLBACK(handoff_src),NULL,FALSE);
return src;
}
......@@ -69,9 +69,9 @@ GstElement *fakesink() {
sink = gst_elementfactory_make("fakesink","fakesink");
g_return_val_if_fail(sink != NULL,NULL);
gtk_object_set(GTK_OBJECT(sink),"silent",TRUE,NULL);
gtk_signal_connect(GTK_OBJECT(sink),
"handoff",GTK_SIGNAL_FUNC(handoff_sink),NULL);
g_object_set(G_OBJECT(sink),"silent",TRUE,NULL);
g_signal_connectc(G_OBJECT(sink),
"handoff",G_CALLBACK(handoff_sink),NULL,FALSE);
return sink;
}
......
......@@ -54,7 +54,7 @@ void mp2tomp1(GstElement *parser,GstPad *pad, GstElement *pipeline) {
// construct queue and connect everything in the main pipelie
audio_queue = gst_elementfactory_make("queue","audio_queue");
gtk_object_set(GTK_OBJECT(audio_queue),"max_level",30,NULL);
g_object_set(G_OBJECT(audio_queue),"max_level",30,NULL);
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(audio_queue));
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(audio_thread));
gst_pad_connect(pad,
......@@ -63,7 +63,7 @@ void mp2tomp1(GstElement *parser,GstPad *pad, GstElement *pipeline) {
gst_element_get_pad(audio_thread,"sink"));
// set up thread state and kick things off
gtk_object_set(GTK_OBJECT(audio_thread),"create_thread",TRUE,NULL);
g_object_set(G_OBJECT(audio_thread),"create_thread",TRUE,NULL);
g_print("setting to READY state\n");
gst_element_set_state(GST_ELEMENT(audio_thread),GST_STATE_READY);
g_print("setting to PLAYING state\n");
......@@ -96,7 +96,7 @@ void mp2tomp1(GstElement *parser,GstPad *pad, GstElement *pipeline) {
// construct queue and connect everything in the main pipelie
audio_queue = gst_elementfactory_make("queue","audio_queue");
gtk_object_set(GTK_OBJECT(audio_queue),"max_level",30,NULL);
g_object_set(G_OBJECT(audio_queue),"max_level",30,NULL);
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(audio_queue));
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(audio_thread));
gst_pad_connect(pad,
......@@ -105,7 +105,7 @@ void mp2tomp1(GstElement *parser,GstPad *pad, GstElement *pipeline) {
gst_element_get_pad(audio_thread,"sink"));
// set up thread state and kick things off
gtk_object_set(GTK_OBJECT(audio_thread),"create_thread",TRUE,NULL);
g_object_set(G_OBJECT(audio_thread),"create_thread",TRUE,NULL);
g_print("setting to READY state\n");
gst_element_set_state(GST_ELEMENT(audio_thread),GST_STATE_READY);
g_print("setting to PLAYING state\n");
......@@ -123,14 +123,14 @@ void mp2tomp1(GstElement *parser,GstPad *pad, GstElement *pipeline) {
g_return_if_fail(decode_video != NULL);
encode = gst_elementfactory_make("mpeg2enc","encode");
g_return_if_fail(encode != NULL);
//gtk_object_set(GTK_OBJECT(show),"width",640, "height", 480,NULL);
//g_object_set(G_OBJECT(show),"width",640, "height", 480,NULL);
fd = open(outfile,O_CREAT|O_RDWR|O_TRUNC);
fdsinkfactory = gst_elementfactory_find("fdsink");
g_return_if_fail(fdsinkfactory != NULL);
fdsink = gst_elementfactory_create(fdsinkfactory,"fdsink");
g_return_if_fail(fdsink != NULL);
gtk_object_set(GTK_OBJECT(fdsink),"fd",fd,NULL);
g_object_set(G_OBJECT(fdsink),"fd",fd,NULL);
// create the thread and pack stuff into it
video_thread = gst_thread_new("video_thread");
......@@ -152,7 +152,7 @@ void mp2tomp1(GstElement *parser,GstPad *pad, GstElement *pipeline) {
// construct queue and connect everything in the main pipeline
video_queue = gst_elementfactory_make("queue","video_queue");
gtk_object_set(GTK_OBJECT(video_queue),"max_level",30,NULL);
g_object_set(G_OBJECT(video_queue),"max_level",30,NULL);
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(video_queue));
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(video_thread));
gst_pad_connect(pad,
......@@ -161,7 +161,7 @@ void mp2tomp1(GstElement *parser,GstPad *pad, GstElement *pipeline) {
gst_element_get_pad(video_thread,"sink"));
// set up thread state and kick things off
gtk_object_set(GTK_OBJECT(video_thread),"create_thread",TRUE,NULL);
g_object_set(G_OBJECT(video_thread),"create_thread",TRUE,NULL);
g_print("setting to READY state\n");
gst_element_set_state(GST_ELEMENT(video_thread),GST_STATE_READY);
g_print("setting to PLAYING state\n");
......@@ -188,7 +188,7 @@ int main(int argc,char *argv[]) {
src = gst_elementfactory_make("disksrc","src");
g_return_val_if_fail(src != NULL, -1);
gtk_object_set(GTK_OBJECT(src),"location",argv[1],NULL);
g_object_set(G_OBJECT(src),"location",argv[1],NULL);
g_print("should be using file '%s'\n",argv[1]);
g_print("should be using output file '%s'\n",argv[2]);
......@@ -200,9 +200,9 @@ int main(int argc,char *argv[]) {
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(src));
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(parse));
gtk_signal_connect(GTK_OBJECT(parse),"new_pad",mp2tomp1, pipeline);
g_signal_connectc(G_OBJECT(parse),"new_pad",mp2tomp1, pipeline, FALSE);
gtk_signal_connect(GTK_OBJECT(src),"eos",GTK_SIGNAL_FUNC(eof),NULL);
g_signal_connectc(G_OBJECT(src),"eos",G_CALLBACK(eof),NULL, FALSE);
gst_pad_connect(gst_element_get_pad(src,"src"),
gst_element_get_pad(parse,"sink"));
......
......@@ -18,7 +18,7 @@ void frame_encoded(GstElement *element, gint framenum, gpointer data) {
gulong frame_size;
static gulong total = 0;
frame_size = gst_util_get_long_arg(GTK_OBJECT(element),"last_frame_size");
frame_size = gst_util_get_long_arg(G_OBJECT(element),"last_frame_size");
total+=frame_size;
......@@ -45,17 +45,17 @@ void mp2tomp1(GstElement *parser,GstPad *pad, GstElement *pipeline) {
// construct internal pipeline elements
parse_audio = gst_elementfactory_make("ac3parse","parse_audio");
g_return_if_fail(parse_audio != NULL);
gtk_object_set(GTK_OBJECT(parse_audio),"skip", 15, NULL);
g_object_set(G_OBJECT(parse_audio),"skip", 15, NULL);
decode = gst_elementfactory_make("ac3dec","decode_audio");
g_return_if_fail(decode != NULL);
audio_resample = gst_elementfactory_make("audioscale","audioscale");
g_return_if_fail(audio_resample != NULL);
gtk_object_set(GTK_OBJECT(audio_resample),"frequency", 44100, NULL);
g_object_set(G_OBJECT(audio_resample),"frequency", 44100, NULL);
audio_encode = gst_elementfactory_make("mpegaudio","audio_encode");
//audio_encode = gst_elementfactory_make("pipefilter","audio_encode");
g_return_if_fail(audio_encode != NULL);
//gtk_object_set(GTK_OBJECT(audio_encode),"command", "lame -x - -", NULL);
//g_object_set(G_OBJECT(audio_encode),"command", "lame -x - -", NULL);
// create the thread and pack stuff into it
audio_thread = gst_thread_new("audio_thread");
......@@ -65,7 +65,7 @@ void mp2tomp1(GstElement *parser,GstPad *pad, GstElement *pipeline) {
gst_bin_add(GST_BIN(audio_thread),GST_ELEMENT(audio_resample));
gst_bin_add(GST_BIN(audio_thread),GST_ELEMENT(audio_encode));
gtk_object_set(GTK_OBJECT(mux),"audio","00",NULL);
g_object_set(G_OBJECT(mux),"audio","00",NULL);
// set up pad connections
gst_element_add_ghost_pad(GST_ELEMENT(audio_thread),
......@@ -81,7 +81,7 @@ void mp2tomp1(GstElement *parser,GstPad *pad, GstElement *pipeline) {
// construct queue and connect everything in the main pipelie
audio_queue = gst_elementfactory_make("queue","audio_queue");
gtk_object_set(GTK_OBJECT(audio_queue),"max_level",1,NULL);
g_object_set(G_OBJECT(audio_queue),"max_level",1,NULL);
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(audio_queue));
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(audio_thread));
gst_pad_connect(pad,
......@@ -90,7 +90,7 @@ void mp2tomp1(GstElement *parser,GstPad *pad, GstElement *pipeline) {
gst_element_get_pad(audio_thread,"sink"));
// set up thread state and kick things off
gtk_object_set(GTK_OBJECT(audio_thread),"create_thread",TRUE,NULL);
g_object_set(G_OBJECT(audio_thread),"create_thread",TRUE,NULL);
g_print("setting to READY state\n");
gst_element_set_state(GST_ELEMENT(audio_thread),GST_STATE_READY);
} else if (strncmp(gst_pad_get_name(pad), "subtitle_stream_4", 17) == 0) {
......@@ -125,7 +125,7 @@ void mp2tomp1(GstElement *parser,GstPad *pad, GstElement *pipeline) {
// construct queue and connect everything in the main pipelie
audio_queue = gst_elementfactory_make("queue","audio_queue");
gtk_object_set(GTK_OBJECT(audio_queue),"max_level",1,NULL);
g_object_set(G_OBJECT(audio_queue),"max_level",1,NULL);
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(audio_queue));
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(audio_thread));
gst_pad_connect(pad,
......@@ -134,7 +134,7 @@ void mp2tomp1(GstElement *parser,GstPad *pad, GstElement *pipeline) {
gst_element_get_pad(audio_thread,"sink"));
// set up thread state and kick things off
gtk_object_set(GTK_OBJECT(audio_thread),"create_thread",TRUE,NULL);
g_object_set(G_OBJECT(audio_thread),"create_thread",TRUE,NULL);
g_print("setting to READY state\n");
gst_element_set_state(GST_ELEMENT(audio_thread),GST_STATE_READY);
} else if (strncmp(gst_pad_get_name(pad), "video_", 6) == 0) {
......@@ -157,27 +157,27 @@ void mp2tomp1(GstElement *parser,GstPad *pad, GstElement *pipeline) {
g_return_if_fail(merge_subtitles != NULL);
videoscale = gst_elementfactory_make("videoscale","videoscale");
g_return_if_fail(videoscale != NULL);
//gtk_object_set(GTK_OBJECT(videoscale),"width",352, "height", 288,NULL);
gtk_object_set(GTK_OBJECT(videoscale),"width",640, "height", 480,NULL);
//g_object_set(G_OBJECT(videoscale),"width",352, "height", 288,NULL);
g_object_set(G_OBJECT(videoscale),"width",640, "height", 480,NULL);
median = gst_elementfactory_make("median","median");
g_return_if_fail(median != NULL);
gtk_object_set(GTK_OBJECT(median),"filtersize",9,NULL);
gtk_object_set(GTK_OBJECT(median),"active",TRUE,NULL);
g_object_set(G_OBJECT(median),"filtersize",9,NULL);
g_object_set(G_OBJECT(median),"active",TRUE,NULL);
smooth = gst_elementfactory_make("smooth","smooth");
g_return_if_fail(smooth != NULL);
gtk_object_set(GTK_OBJECT(smooth),"filtersize",5,NULL);
gtk_object_set(GTK_OBJECT(smooth),"tolerance",9,NULL);
gtk_object_set(GTK_OBJECT(smooth),"active",FALSE,NULL);
g_object_set(G_OBJECT(smooth),"filtersize",5,NULL);
g_object_set(G_OBJECT(smooth),"tolerance",9,NULL);
g_object_set(G_OBJECT(smooth),"active",FALSE,NULL);
encode = gst_elementfactory_make("winenc","encode");
g_return_if_fail(encode != NULL);
gtk_signal_connect(GTK_OBJECT(encode),"frame_encoded",GTK_SIGNAL_FUNC(frame_encoded),NULL);
gtk_object_set(GTK_OBJECT(encode),"bitrate",800*4,NULL);
gtk_object_set(GTK_OBJECT(encode),"quality",10000,NULL);
//gtk_object_set(GTK_OBJECT(encode),"compression",NULL,NULL);
g_signal_connectc(G_OBJECT(encode),"frame_encoded",G_CALLBACK(frame_encoded),NULL,FALSE);
g_object_set(G_OBJECT(encode),"bitrate",800*4,NULL);
g_object_set(G_OBJECT(encode),"quality",10000,NULL);
//g_object_set(G_OBJECT(encode),"compression",NULL,NULL);
//encode = gst_elementfactory_make("mpeg1encoder","encode");
//gtk_object_set(GTK_OBJECT(show),"width",640, "height", 480,NULL);
//g_object_set(G_OBJECT(show),"width",640, "height", 480,NULL);
gtk_object_set(GTK_OBJECT(mux),"video","00:DIV3",NULL);
g_object_set(G_OBJECT(mux),"video","00:DIV3",NULL);
// create the thread and pack stuff into it
video_thread = gst_thread_new("video_thread");
......@@ -210,7 +210,7 @@ void mp2tomp1(GstElement *parser,GstPad *pad, GstElement *pipeline) {
// construct queue and connect everything in the main pipeline
video_queue = gst_elementfactory_make("queue","video_queue");
gtk_object_set(GTK_OBJECT(video_queue),"max_level",1,NULL);
g_object_set(G_OBJECT(video_queue),"max_level",1,NULL);
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(video_queue));
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(video_thread));
gst_pad_connect(pad,
......@@ -219,7 +219,7 @@ void mp2tomp1(GstElement *parser,GstPad *pad, GstElement *pipeline) {
gst_element_get_pad(video_thread,"sink"));
// set up thread state and kick things off
gtk_object_set(GTK_OBJECT(video_thread),"create_thread",TRUE,NULL);
g_object_set(G_OBJECT(video_thread),"create_thread",TRUE,NULL);
g_print("setting to READY state\n");
gst_element_set_state(GST_ELEMENT(video_thread),GST_STATE_READY);
}
......@@ -249,7 +249,7 @@ int main(int argc,char *argv[]) {
src = gst_elementfactory_make("disksrc","src");
g_return_val_if_fail(src != NULL, -1);
gtk_object_set(GTK_OBJECT(src),"location",argv[1],NULL);
g_object_set(G_OBJECT(src),"location",argv[1],NULL);
g_print("should be using file '%s'\n",argv[1]);
g_print("should be using output file '%s'\n",argv[2]);
......@@ -264,16 +264,16 @@ int main(int argc,char *argv[]) {
g_return_val_if_fail(fdsinkfactory != NULL, -1);
fdsink = gst_elementfactory_create(fdsinkfactory,"fdsink");
g_return_val_if_fail(fdsink != NULL, -1);
gtk_object_set(GTK_OBJECT(fdsink),"fd",fd,NULL);
g_object_set(G_OBJECT(fdsink),"fd",fd,NULL);
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(src));
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(parse));
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(mux));
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(fdsink));
gtk_signal_connect(GTK_OBJECT(parse),"new_pad",mp2tomp1, pipeline);
g_signal_connectc(G_OBJECT(parse),"new_pad",mp2tomp1, pipeline, FALSE);
gtk_signal_connect(GTK_OBJECT(src),"eos",GTK_SIGNAL_FUNC(eof),NULL);
g_signal_connectc(G_OBJECT(src),"eos",G_CALLBACK(eof),NULL, FALSE);
gst_pad_connect(gst_element_get_pad(src,"src"),
gst_element_get_pad(parse,"sink"));
......
......@@ -29,7 +29,7 @@ create_muxer (GstElement *pipeline, gchar *type, gchar *number)
gst_pad_connect(gst_element_get_pad(mux,"src"),
gst_element_get_pad(fdsink,"sink"));
}
gtk_object_set(GTK_OBJECT(mux), type, number,NULL);
g_object_set(G_OBJECT(mux), type, number,NULL);
return gst_element_get_pad(mux,g_strconcat (type, "_", number, NULL));
}
......@@ -55,12 +55,12 @@ mp2tomp1 (GstElement *parser, GstPad *pad, GstElement *pipeline)
g_return_if_fail(decode != NULL);
audio_resample = gst_elementfactory_make("audioscale","audioscale");
g_return_if_fail(audio_resample != NULL);
gtk_object_set(GTK_OBJECT(audio_resample),"frequency", 44100, NULL);
g_object_set(G_OBJECT(audio_resample),"frequency", 44100, NULL);
audio_encode = gst_elementfactory_make("mpegaudio","audio_encode");
//audio_encode = gst_elementfactory_make("pipefilter","audio_encode");
g_return_if_fail(audio_encode != NULL);
//gtk_object_set(GTK_OBJECT(audio_encode),"command", "lame -x - -", NULL);
//g_object_set(G_OBJECT(audio_encode),"command", "lame -x - -", NULL);
// create the thread and pack stuff into it
audio_thread = gst_thread_new("audio_thread");
......@@ -83,7 +83,7 @@ mp2tomp1 (GstElement *parser, GstPad *pad, GstElement *pipeline)
// construct queue and connect everything in the main pipelie
audio_queue = gst_elementfactory_make("queue","audio_queue");
gtk_object_set(GTK_OBJECT(audio_queue),"max_level",1,NULL);
g_object_set(G_OBJECT(audio_queue),"max_level",1,NULL);
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(audio_queue));
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(audio_thread));
gst_pad_connect(pad,
......@@ -92,7 +92,7 @@ mp2tomp1 (GstElement *parser, GstPad *pad, GstElement *pipeline)
gst_element_get_pad(audio_thread,"sink"));
// set up thread state and kick things off
gtk_object_set(GTK_OBJECT(audio_thread),"create_thread",TRUE,NULL);
g_object_set(G_OBJECT(audio_thread),"create_thread",TRUE,NULL);
g_print("setting to READY state\n");
gst_element_set_state(GST_ELEMENT(audio_thread),GST_STATE_READY);
} else if (strncmp(gst_pad_get_name(pad), "subtitle_stream_4", 17) == 0) {
......@@ -120,7 +120,7 @@ mp2tomp1 (GstElement *parser, GstPad *pad, GstElement *pipeline)
// construct queue and connect everything in the main pipelie
audio_queue = gst_elementfactory_make("queue","audio_queue");
gtk_object_set(GTK_OBJECT(audio_queue),"max_level",1,NULL);
g_object_set(G_OBJECT(audio_queue),"max_level",1,NULL);
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(audio_queue));
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(audio_thread));
gst_pad_connect(pad,
......@@ -129,7 +129,7 @@ mp2tomp1 (GstElement *parser, GstPad *pad, GstElement *pipeline)
gst_element_get_pad(audio_thread,"sink"));
// set up thread state and kick things off
gtk_object_set(GTK_OBJECT(audio_thread),"create_thread",TRUE,NULL);
g_object_set(G_OBJECT(audio_thread),"create_thread",TRUE,NULL);
g_print("setting to READY state\n");
gst_element_set_state(GST_ELEMENT(audio_thread),GST_STATE_READY);
} else if (strncmp(gst_pad_get_name(pad), "video_", 6) == 0) {
......@@ -143,22 +143,22 @@ mp2tomp1 (GstElement *parser, GstPad *pad, GstElement *pipeline)
//g_return_if_fail(merge_subtitles != NULL);
videoscale = gst_elementfactory_make("videoscale","videoscale");
g_return_if_fail(videoscale != NULL);
gtk_object_set(GTK_OBJECT(videoscale),"width",352, "height", 288,NULL);
g_object_set(G_OBJECT(videoscale),"width",352, "height", 288,NULL);
median = gst_elementfactory_make("median","median");
g_return_if_fail(median != NULL);
gtk_object_set(GTK_OBJECT(median),"filtersize",5,NULL);
gtk_object_set(GTK_OBJECT(median),"active",TRUE,NULL);
g_object_set(G_OBJECT(median),"filtersize",5,NULL);
g_object_set(G_OBJECT(median),"active",TRUE,NULL);
smooth = gst_elementfactory_make("smooth","smooth");
g_return_if_fail(smooth != NULL);
gtk_object_set(GTK_OBJECT(smooth),"filtersize",5,NULL);
gtk_object_set(GTK_OBJECT(smooth),"tolerance",9,NULL);
gtk_object_set(GTK_OBJECT(smooth),"active",FALSE,NULL);
g_object_set(G_OBJECT(smooth),"filtersize",5,NULL);
g_object_set(G_OBJECT(smooth),"tolerance",9,NULL);
g_object_set(G_OBJECT(smooth),"active",FALSE,NULL);
encode = gst_elementfactory_make("mpeg2enc","encode");
g_return_if_fail(encode != NULL);
gtk_object_set(GTK_OBJECT(encode),"frames_per_second",25.0,NULL);
//gtk_object_set(GTK_OBJECT(encode),"frames_per_second",29.97,NULL);
g_object_set(G_OBJECT(encode),"frames_per_second",25.0,NULL);
//g_object_set(G_OBJECT(encode),"frames_per_second",29.97,NULL);
//encode = gst_elementfactory_make("mpeg1encoder","encode");
//gtk_object_set(GTK_OBJECT(show),"width",640, "height", 480,NULL);
//g_object_set(G_OBJECT(show),"width",640, "height", 480,NULL);
muxerpad = create_muxer (pipeline, "video", "00");
g_return_if_fail(muxerpad != NULL);
......@@ -192,7 +192,7 @@ mp2tomp1 (GstElement *parser, GstPad *pad, GstElement *pipeline)
// construct queue and connect everything in the main pipeline
video_queue = gst_elementfactory_make("queue","video_queue");
gtk_object_set(GTK_OBJECT(video_queue),"max_level",1,NULL);
g_object_set(G_OBJECT(video_queue),"max_level",1,NULL);
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(video_queue));
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(video_thread));
gst_pad_connect(pad,
......@@ -201,7 +201,7 @@ mp2tomp1 (GstElement *parser, GstPad *pad, GstElement *pipeline)
gst_element_get_pad(video_thread,"sink"));
// set up thread state and kick things off
gtk_object_set(GTK_OBJECT(video_thread),"create_thread",TRUE,NULL);
g_object_set(G_OBJECT(video_thread),"create_thread",TRUE,NULL);
g_print("setting to READY state\n");
gst_element_set_state(GST_ELEMENT(video_thread),GST_STATE_READY);
}
......@@ -228,7 +228,7 @@ int main(int argc,char *argv[]) {
src = gst_elementfactory_make("disksrc","src");
g_return_val_if_fail(src != NULL, -1);
gtk_object_set(GTK_OBJECT(src),"location",argv[1],NULL);
g_object_set(G_OBJECT(src),"location",argv[1],NULL);
g_print("should be using file '%s'\n",argv[1]);
g_print("should be using output file '%s'\n",argv[2]);
......@@ -242,15 +242,15 @@ int main(int argc,char *argv[]) {
g_return_val_if_fail(fdsinkfactory != NULL, -1);
fdsink = gst_elementfactory_create(fdsinkfactory,"fdsink");
g_return_val_if_fail(fdsink != NULL, -1);
gtk_object_set(GTK_OBJECT(fdsink),"fd",fd,NULL);
g_object_set(G_OBJECT(fdsink),"fd",fd,NULL);
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(src));
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(parse));
gtk_signal_connect(GTK_OBJECT(parse),"new_pad",mp2tomp1, pipeline);
g_signal_connectc(G_OBJECT(parse),"new_pad",mp2tomp1, pipeline, FALSE);
gtk_signal_connect(GTK_OBJECT(src),"eos",GTK_SIGNAL_FUNC(eof),NULL);
g_signal_connectc(G_OBJECT(src),"eos",G_CALLBACK(eof),NULL, FALSE);
gst_pad_connect(gst_element_get_pad(src,"src"),
gst_element_get_pad(parse,"sink"));
......
......@@ -34,7 +34,7 @@ int main(int argc,char *argv[]) {
src = gst_elementfactory_create(srcfactory,"src");
g_return_val_if_fail(src != NULL, -1);
gtk_object_set(GTK_OBJECT(src),"location",argv[1],NULL);
g_object_set(G_OBJECT(src),"location",argv[1]);
mp3 = gst_elementfactory_create(mp3factory,"mp3");
g_return_val_if_fail(mp3 != NULL, -1);
sink = gst_elementfactory_create(sinkfactory,"sink");
......@@ -49,8 +49,8 @@ int main(int argc,char *argv[]) {
gst_pad_connect(gst_element_get_pad(mp3,"src"),
gst_element_get_pad(sink,"sink"));
gtk_signal_connect(GTK_OBJECT(src),"eof",
GTK_SIGNAL_FUNC(eof),NULL);
g_signal_connectc(G_OBJECT(src),"eof",
G_CALLBACK(eof),NULL,FALSE);
gst_element_set_state(GST_ELEMENT(bin),GST_STATE_READY);
gst_element_set_state(GST_ELEMENT(bin),GST_STATE_PLAYING);
......
......@@ -21,7 +21,7 @@ int main(int argc,char *argv[]) {
src = gst_elementfactory_create(srcfactory,"src");
g_return_val_if_fail(src != NULL, -1);
gtk_object_set(GTK_OBJECT(src),"location",argv[1],NULL);
g_object_set(G_OBJECT(src),"location",argv[1],NULL);
g_print("should be using file '%s'\n",argv[1]);
decode = gst_elementfactory_create(decodefactory,"decode");
g_return_val_if_fail(decode != NULL, -1);
......
......@@ -35,7 +35,7 @@ int main(int argc,char *argv[]) {