Log opusdec!
This commit is contained in:
parent
057b2de49e
commit
00c3618656
1 changed files with 12 additions and 8 deletions
20
src/dcall.c
20
src/dcall.c
|
@ -5,14 +5,14 @@
|
||||||
#include <glib-2.0/glib-unix.h>
|
#include <glib-2.0/glib-unix.h>
|
||||||
#include <gst/rtp/gstrtpbuffer.h>
|
#include <gst/rtp/gstrtpbuffer.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
struct dcall_elements {
|
struct dcall_elements {
|
||||||
GstElement *pipeline;
|
GstElement *pipeline;
|
||||||
GstElement *rx_tap, *rx_jitterbuffer, *rx_depay, *rx_opusdec, *rx_resample, *rx_echocancel, *rx_sink;
|
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;
|
GstElement *tx_tap, *tx_echocancel, *tx_queue, *tx_resample, *tx_opusenc, *tx_pay, *tx_sink;
|
||||||
char* remote_host;
|
char* remote_host;
|
||||||
guint bus_watch_id;
|
guint64 grtppktlost;
|
||||||
guint16 prev_seqnum;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
int create_rx_chain(struct dcall_elements* de) {
|
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;
|
struct dcall_elements *de = user_data;
|
||||||
GstEvent *event = NULL;
|
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);
|
event = gst_pad_probe_info_get_event (info);
|
||||||
if (event == NULL) return GST_PAD_PROBE_OK;
|
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;
|
const GstStructure *struc = NULL;
|
||||||
struc = gst_event_get_structure(event);
|
struc = gst_event_get_structure(event);
|
||||||
if (struc == NULL) return GST_PAD_PROBE_OK;
|
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;
|
const gchar* struc_name = NULL;
|
||||||
struc_name = gst_structure_get_name(struc);
|
struc_name = gst_structure_get_name(struc);
|
||||||
if (struc_name == NULL) return GST_PAD_PROBE_OK;
|
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;
|
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;
|
guint seqnum = 0, retry = 0;
|
||||||
guint64 timestamp = 0, duration = 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", ×tamp);
|
gst_structure_get_uint64(struc, "timestamp", ×tamp);
|
||||||
gst_structure_get_uint64(struc, "duration", &duration);
|
gst_structure_get_uint64(struc, "duration", &duration);
|
||||||
g_print("GstRTPPacketLost{seqnum=%d, retry=%d, duration=%ld, timestamp=%ld}\n", seqnum, retry, duration, timestamp);
|
g_print("GstRTPPacketLost{seqnum=%d, retry=%d, duration=%ld, timestamp=%ld}\n", seqnum, retry, duration, timestamp);
|
||||||
|
de->grtppktlost++;
|
||||||
|
|
||||||
return GST_PAD_PROBE_OK;
|
return GST_PAD_PROBE_OK;
|
||||||
}
|
}
|
||||||
|
@ -138,9 +139,12 @@ gboolean stop_handler(gpointer user_data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
|
setenv("GST_DEBUG_FILE", "dcall.log", 0);
|
||||||
|
setenv("GST_DEBUG", "3,opusdec:5", 0);
|
||||||
|
|
||||||
GMainLoop *loop;
|
GMainLoop *loop;
|
||||||
struct dcall_elements de = {
|
struct dcall_elements de = {
|
||||||
.prev_seqnum = 0
|
.grtppktlost = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Check input arguments */
|
/* Check input arguments */
|
||||||
|
|
Loading…
Reference in a new issue