summaryrefslogtreecommitdiff
path: root/gst/rtmp2
diff options
context:
space:
mode:
authorJan Alexander Steffens (heftig) <jsteffens@make.tv>2019-11-27 15:38:50 +0100
committerJan Alexander Steffens (heftig) <jsteffens@make.tv>2019-12-03 14:11:47 +0100
commitfd6c51b2e7eb55cdf43a7cb98f51530314356530 (patch)
treece2322f14ea6c448c78cf3a753d488bee5bc3858 /gst/rtmp2
parent042e4398294bc1c567cb20c0fe295f77b094bc49 (diff)
downloadgstreamer-plugins-bad-fd6c51b2e7eb55cdf43a7cb98f51530314356530.tar.gz
rtmp2sink: Only apply @setDataFrame to onMetaData messages
Only the metadata needs to be made "sticky". Custom data messages should be passed on unmodified. https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/merge_requests/878
Diffstat (limited to 'gst/rtmp2')
-rw-r--r--gst/rtmp2/gstrtmp2sink.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/gst/rtmp2/gstrtmp2sink.c b/gst/rtmp2/gstrtmp2sink.c
index eb62b1736..50201e6f3 100644
--- a/gst/rtmp2/gstrtmp2sink.c
+++ b/gst/rtmp2/gstrtmp2sink.c
@@ -41,6 +41,7 @@
#include "gstrtmp2sink.h"
#include "gstrtmp2locationhandler.h"
+#include "rtmp/amf.h"
#include "rtmp/rtmpclient.h"
#include "rtmp/rtmpmessage.h"
@@ -620,21 +621,6 @@ buffer_to_message (GstRtmp2Sink * self, GstBuffer * buffer, GstBuffer ** outbuf)
GST_BUFFER_DTS (message) = timestamp * GST_MSECOND;
- if (type == GST_RTMP_MESSAGE_TYPE_DATA_AMF0) {
- /* FIXME: HACK: Attach a setDataFrame header.
- * This should be done using a command. */
-
- static const guint8 header[] = {
- 0x02, 0x00, 0x0d, 0x40, 0x73, 0x65, 0x74, 0x44,
- 0x61, 0x74, 0x61, 0x46, 0x72, 0x61, 0x6d, 0x65
- };
-
- GstMemory *memory = gst_memory_new_wrapped (GST_MEMORY_FLAG_READONLY,
- (guint8 *) header, sizeof header, 0, sizeof header, NULL, NULL);
-
- gst_buffer_prepend_memory (message, memory);
- }
-
*outbuf = message;
return TRUE;
}
@@ -660,10 +646,17 @@ static void
send_message (GstRtmp2Sink * self, GstBuffer * message)
{
GstRtmpMeta *meta = gst_buffer_get_rtmp_meta (message);
+
g_return_if_fail (meta != NULL);
g_return_if_fail (self->stream_id != 0);
+
meta->mstream = self->stream_id;
- gst_rtmp_connection_queue_message (self->connection, message);
+
+ if (gst_rtmp_message_is_metadata (message)) {
+ gst_rtmp_connection_set_data_frame (self->connection, message);
+ } else {
+ gst_rtmp_connection_queue_message (self->connection, message);
+ }
}
static void