Log opusdec!

This commit is contained in:
Quentin 2020-01-30 16:29:45 +01:00
parent 057b2de49e
commit 00c3618656

View file

@ -5,14 +5,14 @@
#include <glib-2.0/glib-unix.h>
#include <gst/rtp/gstrtpbuffer.h>
#include <unistd.h>
#include <stdlib.h>
struct dcall_elements {
GstElement *pipeline;
GstElement *rx_tap, *rx_jitterbuffer, *rx_depay, *rx_opusdec, *rx_resample, *rx_echocancel, *rx_sink;
GstElement *tx_tap, *tx_echocancel, *tx_queue, *tx_resample, *tx_opusenc, *tx_pay, *tx_sink;
char* remote_host;
guint bus_watch_id;
guint16 prev_seqnum;
guint64 grtppktlost;
};
int create_rx_chain(struct dcall_elements* de) {
@ -101,24 +101,24 @@ static GstPadProbeReturn jitter_buffer_sink_event(GstPad *pad, GstPadProbeInfo *
struct dcall_elements *de = user_data;
GstEvent *event = NULL;
g_print("Entering rtpjitterbuffer sink pad handler for events...\n");
//g_print("Entering rtpjitterbuffer sink pad handler for events...\n");
event = gst_pad_probe_info_get_event (info);
if (event == NULL) return GST_PAD_PROBE_OK;
g_print("We successfully extracted an event from the pad... \n");
//g_print("We successfully extracted an event from the pad... \n");
const GstStructure *struc = NULL;
struc = gst_event_get_structure(event);
if (struc == NULL) return GST_PAD_PROBE_OK;
g_print("We successfully extracted a structure from the event... \n");
//g_print("We successfully extracted a structure from the event... \n");
const gchar* struc_name = NULL;
struc_name = gst_structure_get_name(struc);
if (struc_name == NULL) return GST_PAD_PROBE_OK;
g_print("We extracted the structure \"%s\"...\n", struc_name);
//g_print("We extracted the structure \"%s\"...\n", struc_name);
if (strcmp(struc_name, "GstRTPPacketLost") != 0) return GST_PAD_PROBE_OK;
g_print("And that's the structure we want !\n");
//g_print("And that's the structure we want !\n");
guint seqnum = 0, retry = 0;
guint64 timestamp = 0, duration = 0;
@ -127,6 +127,7 @@ static GstPadProbeReturn jitter_buffer_sink_event(GstPad *pad, GstPadProbeInfo *
gst_structure_get_uint64(struc, "timestamp", &timestamp);
gst_structure_get_uint64(struc, "duration", &duration);
g_print("GstRTPPacketLost{seqnum=%d, retry=%d, duration=%ld, timestamp=%ld}\n", seqnum, retry, duration, timestamp);
de->grtppktlost++;
return GST_PAD_PROBE_OK;
}
@ -138,9 +139,12 @@ gboolean stop_handler(gpointer user_data) {
}
int main(int argc, char *argv[]) {
setenv("GST_DEBUG_FILE", "dcall.log", 0);
setenv("GST_DEBUG", "3,opusdec:5", 0);
GMainLoop *loop;
struct dcall_elements de = {
.prev_seqnum = 0
.grtppktlost = 0
};
/* Check input arguments */