Log events again...

This commit is contained in:
Quentin 2020-01-29 09:42:13 +01:00
parent 9a7fbb1343
commit 29cf2a85b4
2 changed files with 26 additions and 7 deletions

View file

@ -49,7 +49,6 @@ add_executable(torecho ${CSOURCES} src/tor_echo.c)
add_executable(capdiff ${CSOURCES} src/capdiff.c)
add_executable(capreplay ${CSOURCES} src/capreplay.c)
add_executable(donar_unit_test ${CSOURCES} src/test.c)
add_executable(dcall src/dcall.c)
find_package(PkgConfig REQUIRED)

View file

@ -119,9 +119,28 @@ static GstPadProbeReturn jitter_buffer_sink_event(GstPad *pad, GstPadProbeInfo *
return GST_PAD_PROBE_OK;
}
static GstPadProbeReturn jitter_buffer_sink_event_up(GstPad *pad, GstPadProbeInfo *info, gpointer user_data) {
g_print("upstream event: begin\n");
jitter_buffer_sink_event (pad, info, user_data);
g_print("upstream event: end\n");
return GST_PAD_PROBE_OK;
}
static GstPadProbeReturn jitter_buffer_sink_event_down(GstPad *pad, GstPadProbeInfo *info, gpointer user_data) {
g_print("downstream event: begin\n");
jitter_buffer_sink_event (pad, info, user_data);
g_print("downstream event: end\n");
return GST_PAD_PROBE_OK;
}
static gboolean foreach_buffer (GstBuffer *inbuf, GstMeta **meta, gpointer user_data) {
//@FIXME Dead code, please remove me
return TRUE;
}
static GstPadProbeReturn jitter_buffer_sink_buffer(GstPad *pad, GstPadProbeInfo *info, gpointer user_data) {
//g_print("Entering rtpjitterbuffer sink pad handler for buffers...\n");
//@FIXME Dead code, please remove me
guint16 seqnum;
GstBuffer *out = NULL, *rtp_extracted = NULL;
GstRTPBuffer rtp_buffer = {0};
@ -134,20 +153,21 @@ static GstPadProbeReturn jitter_buffer_sink_buffer(GstPad *pad, GstPadProbeInfo
seqnum = gst_rtp_buffer_get_seq (&rtp_buffer);
g_print("Receiving packet %d\n", seqnum);
gst_rtp_buffer_unmap (&rtp_buffer);
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;
}
void register_pad(struct dcall_elements *de) {
GstPad *pad;
pad = gst_element_get_static_pad (de->rx_jitterbuffer, "sink");
pad = gst_element_get_static_pad (de->rx_jitterbuffer, "src");
//gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM, jitter_buffer_sink_event, &de, NULL);
gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_BUFFER, jitter_buffer_sink_buffer, &de, NULL);
gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM, jitter_buffer_sink_event_down, &de, NULL);
gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_EVENT_UPSTREAM, jitter_buffer_sink_event_up, &de, NULL);
//gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_BUFFER, jitter_buffer_sink_buffer, &de, NULL);
}
static gboolean pipeline_bus_handler (GstBus *bus, GstMessage *message, gpointer data) {