diff --git a/src/dcall.c b/src/dcall.c index 17bda17..65773ac 100644 --- a/src/dcall.c +++ b/src/dcall.c @@ -139,18 +139,26 @@ static gboolean foreach_buffer (GstBuffer *inbuf, GstMeta **meta, gpointer user_ return TRUE; } -static GstPadProbeReturn jitter_buffer_sink_buffer(GstPad *pad, GstPadProbeInfo *info, gpointer user_data) { +static GstPadProbeReturn extract_buffer(GstPad *pad, GstPadProbeInfo *info, gpointer user_data) { //g_print("Entering rtpjitterbuffer sink pad handler for buffers...\n"); - //@FIXME Dead code, please remove me struct dcall_elements *de = user_data; guint16 seqnum; GstBuffer *out = NULL, *rtp_extracted = NULL; - GstRTPBuffer rtp_buffer = {0}; + //GstRTPBuffer rtp_buffer = {0}; + GstMapInfo map; out = gst_pad_probe_info_get_buffer (info); - if (out == NULL) return GST_PAD_PROBE_OK; - //if (gst_buffer_get_size (buffer) != 172) g_print("buffer size is %ld\n", gst_buffer_get_size (buffer)); + if (out == NULL) { + g_print("Empty buffer \n"); + } else { + //g_print("Buffer of size %ld\n", gst_buffer_get_size (out)); + } + return GST_PAD_PROBE_OK; + //gst_buffer_map (out, &map, GST_MAP_READ); + + //if (gst_buffer_get_size (out) != 172) g_print("buffer size is %ld\n", gst_buffer_get_size (out)); +/* if (G_UNLIKELY (!gst_rtp_buffer_map (out, GST_MAP_READ, &rtp_buffer))) return GST_PAD_PROBE_OK; seqnum = gst_rtp_buffer_get_seq (&rtp_buffer); @@ -161,24 +169,23 @@ static GstPadProbeReturn jitter_buffer_sink_buffer(GstPad *pad, GstPadProbeInfo de->prev_seqnum = seqnum; } - //g_print("Receiving packet %d\n", seqnum); + g_print("Receiving packet %d\n", seqnum); rtp_extracted = gst_rtp_buffer_get_payload_buffer (&rtp_buffer); gst_buffer_foreach_meta (rtp_extracted, foreach_buffer, NULL); - gst_rtp_buffer_unmap (&rtp_buffer); - return GST_PAD_PROBE_OK; + gst_rtp_buffer_unmap (&rtp_buffer);*/ } void register_pad(struct dcall_elements *de) { - GstPad *pad_src, *pad_sink; + GstPad *pad_src, *pad_opusdec; pad_src = gst_element_get_static_pad (de->rx_jitterbuffer, "src"); - pad_sink = gst_element_get_static_pad (de->rx_jitterbuffer, "sink"); + pad_opusdec = gst_element_get_static_pad (de->rx_opusdec, "src"); - gst_pad_add_probe (pad_src, GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM, jitter_buffer_sink_event_down, &de, NULL); + //gst_pad_add_probe (pad_src, GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM, jitter_buffer_sink_event_down, &de, NULL); //gst_pad_add_probe (pad_src, GST_PAD_PROBE_TYPE_EVENT_UPSTREAM, jitter_buffer_sink_event_up, &de, NULL); - gst_pad_add_probe (pad_sink, GST_PAD_PROBE_TYPE_BUFFER, jitter_buffer_sink_buffer, &de, NULL); + gst_pad_add_probe (pad_opusdec, GST_PAD_PROBE_TYPE_BUFFER, extract_buffer, &de, NULL); } static gboolean pipeline_bus_handler (GstBus *bus, GstMessage *message, gpointer data) {