summaryrefslogtreecommitdiff
path: root/tools/proxy-server.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/proxy-server.c')
-rw-r--r--tools/proxy-server.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/tools/proxy-server.c b/tools/proxy-server.c
index db177e2..6a77377 100644
--- a/tools/proxy-server.c
+++ b/tools/proxy-server.c
@@ -24,6 +24,7 @@
#include <gst/gst.h>
#include <gio/gio.h>
#include <stdlib.h>
+#include "amf.h"
#include "rtmpserver.h"
#include "rtmpclient.h"
#include "rtmputils.h"
@@ -189,6 +190,25 @@ periodic (gpointer user_data)
}
static void
+dump_command (GstRtmpChunk * chunk)
+{
+ GstAmfNode *amf;
+ gsize size;
+ const guint8 *data;
+ gsize n_parsed;
+ int offset;
+
+ offset = 0;
+ data = g_bytes_get_data (chunk->payload, &size);
+ while (offset < size) {
+ amf = gst_amf_node_new_parse (data + offset, size - offset, &n_parsed);
+ gst_amf_node_dump (amf);
+ gst_amf_node_free (amf);
+ offset += n_parsed;
+ }
+}
+
+static void
dump_chunk (GstRtmpChunk * chunk, gboolean dir)
{
if (!dump)
@@ -199,5 +219,9 @@ dump_chunk (GstRtmpChunk * chunk, gboolean dir)
chunk->stream_id,
chunk->timestamp,
chunk->message_length, chunk->message_type_id, chunk->info);
+ if (chunk->stream_id == 3 &&
+ chunk->message_type_id == 20) {
+ dump_command (chunk);
+ }
gst_rtmp_dump_data (gst_rtmp_chunk_get_payload (chunk));
}