hi guys~
I have realized the function about capturing the picture and transmit it by
the command line gst-launch ~but now i want to realize it by a farsight
problem~but it has many faults i can not solve these~
If i can have your help ,it is my greatest honor.
my program is as following :
#define GTK_ENABLE_BROKEN
#include <gtk/gtk.h>
#include <gst/gst.h>
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <signal.h>
#include <wait.h>
#include <errno.h>
#include <pthread.h>
#include <glib.h>
char receiveclientaddr[1024];
char buffer[1024];
GMainLoop *loop;
GstElement *main_pipe;
GstElement *udp_sink;
GstPad *main_pipepad;
GtkWidget *okbutton;
GtkWidget *cancelbutton;
GtkWidget *refreshbutton;
GtkWidget *listenbutton;
GtkWidget *text;
GdkFont *fixed_font;
int listenfd,connectfd;
struct sockaddr_in server;
struct sockaddr_in client;
int sin_size;
static gboolean
bus_callback(GstBus *bus,
GstMessage *msg,
gpointer data)
{
GMainLoop *loop = data;
switch (GST_MESSAGE_TYPE(msg)) {
case GST_MESSAGE_EOS:
g_print("End-of-stream\n");
g_main_loop_quit(loop);
break;
case GST_MESSAGE_ERROR:
{
gchar *debug;
GError *err;
gst_message_parse_error(msg, &err, &debug);
g_free(debug);
g_print("Error: %s\n", err->message);
g_error_free(err);
g_main_loop_quit(loop);
break;
}
default:
break;
}
return TRUE;
}
int main (int argc, char *argv[])
{
gst_init(&argc,&argv);
loop = g_main_loop_new (NULL, FALSE);
printf("execute here");
main_pipe = gst_parse_launch("v4lsrc ! videoscale !
video/x-raw-yuv,width=352,height=288 ! videorate !
video/x-raw-yuv,framerate=20/1 ! videobalance brightness=0.3 contrast=1.5 !
ffmpegcolorspace ! ffenc_h263 ! video/x-h263 ! rtph263pay",NULL);
udp_sink = gst_element_factory_make ("udpsink", "udp_sink");
printf("receiveclientaddr is address %s",receiveclientaddr);
g_object_set (G_OBJECT (udp_sink), "host",receiveclientaddr, NULL);
g_object_set (G_OBJECT (udp_sink),"post","5000",NULL);
gst_bin_add (GST_BIN (main_pipe), udp_sink);
g_assert (udp_sink != NULL);
//gst_element_get_pad(udp_sink, "sink");
//main_pipepad = gst_element_request_pad_by_name (main_pipe,"src");
//gst_pad_connect(main_pipepad,gst_element_get_pad(udp_sink,"sink"));
gst_pad_connect (gst_element_get_pad (main_pipe, "src"),
gst_element_get_pad (udp_sink, "sink"));
gst_bus_add_watch(gst_pipeline_get_bus(GST_PIPELINE(main_pipe)),
bus_callback, loop);
gst_element_set_state (GST_ELEMENT (main_pipe), GST_STATE_PLAYING);
g_print("iterate\n");
gst_bin_iterate (GST_BIN (main_pipe));
gst_element_set_state (main_pipe,GST_STATE_PAUSED);
return 0;
}
the fault is as following:
"undefined reference to `gst_pad_connect'"
when deleting this sentence "gst_pad_connect (gst_element_get_pad (main_pipe,
"src"), gst_element_get_pad (udp_sink, "sink"));" and turn it into
"gst_element_get_pad(udp_sink, "sink");" and add it into base bin the fault is
as following:
Internal data flow error. Errors in the red Letters~
i can not solve this problem but have no idea ,has anybody seen this fault
and give some advices thank you
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Farsight-devel mailing list
Farsight-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/farsight-devel