program crashes after g_main_loop_run()
leon
dudi.reuveni at comm-it.co.il
Sun Apr 6 06:29:35 PDT 2014
Hi, thank you for your reply.
Im not sure how to use the gdb..
I load pcap file and push the h.264 stream to the buffer.
the callbacks functions:
static void *start_feed *(GstElement * pipeline, guint size, gst_app_t *app)
{
if (app->sourceid == 0) {
GST_DEBUG ("start feeding");
app->sourceid = g_idle_add ((GSourceFunc) *read_data*, app);
}
}
static gboolean *read_data*(gst_app_t *app)
{
GstBuffer *buffer;
void *ptr;
int size;
GstFlowReturn ret;
struct pcap_pkthdr *header;
const u_char *data;
u_char *RTP_ptr;
int returnValue = pcap_next_ex(pcap, &header, &data);
if (returnValue >= 0)
{
RTP_ptr= (u_char *)data + 42; // pointer to the start of RTP + H.264
size = (header->caplen)-42; //prt: holds the actual data (destination)
//app->file: holds the pcap
file (source)
if(size == 0){
ret = gst_app_src_end_of_stream(app->src);
g_debug("eos returned %d at %d\n", ret, __LINE__);
return FALSE;
}
buffer =gst_buffer_new_wrapped (RTP_ptr,size);
ret = gst_app_src_push_buffer(app->src, buffer);
if(ret != GST_FLOW_OK){
g_debug("push buffer returned %d for %d bytes \n", ret, size);
return FALSE;
}
}
else printf("return value of \"next packet\" is not o.k");
return TRUE;
}
static void *stop_feed* (GstElement * pipeline, gst_app_t *app)
{
if (app->sourceid != 0) {
GST_DEBUG ("stop feeding");
g_source_remove (app->sourceid);
app->sourceid = 0;
}
}
thanks!
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/program-crashes-after-g-main-loop-run-tp4666311p4666316.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list