summaryrefslogtreecommitdiff
path: root/network
diff options
context:
space:
mode:
authorLuis de Arquer <ldearquer@gmail.com>2015-02-21 13:04:19 +0000
committerLuis de Arquer <ldearquer@gmail.com>2015-02-21 13:04:19 +0000
commitbb90ddfad112f6b5178afe40befe76c268aed546 (patch)
treea8b196429d98bbe3da1041141f5569b1fbfc95eb /network
parent9da0c1427371cb2f7498c986577041b07c3f7ed7 (diff)
network/http-launch: Content-type boundary tag is now taken from the multipartmux "boundary" property
Diffstat (limited to 'network')
-rw-r--r--network/http-launch/http-launch.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/network/http-launch/http-launch.c b/network/http-launch/http-launch.c
index 23519f1..c2eea6c 100644
--- a/network/http-launch/http-launch.c
+++ b/network/http-launch/http-launch.c
@@ -41,7 +41,7 @@ static GList *clients = NULL;
static GstElement *pipeline = NULL;
static GstElement *multisocketsink = NULL;
static gboolean started = FALSE;
-static gchar content_type[256];
+static gchar *content_type;
static void
remove_client (Client * client)
@@ -384,13 +384,22 @@ main (gint argc, gchar ** argv)
* Make the HTTP header 'Content-type' if we are trying to create a
* MJPEG (or any other multipart) stream.
*/
+ content_type = g_strdup ("");
+
if ( strcmp ("GstMultipartMux", g_type_name(G_OBJECT_TYPE(stream)) ) == 0 ) {
- strcpy (content_type, "Content-Type: "
- "multipart/x-mixed-replace;boundary=--ThisRandomString\r\n");
- } else {
- strcpy (content_type, "");
+ gchar *boundary = NULL;
+ g_object_get (stream, "boundary", &boundary, NULL);
+ if (boundary == NULL) {
+ g_print ("Warning: \"boundary\" property not found in mutipartmux\n");
+ } else {
+ /* Free default empty string "" created above, and create new string */
+ g_free(content_type);
+ content_type = g_strdup_printf ("Content-Type: "
+ "multipart/x-mixed-replace;boundary=--%s\r\n", boundary);
+ }
}
+
srcpad = gst_element_get_static_pad (stream, "src");
if (!srcpad) {
g_print ("no \"src\" pad in element \"stream\" found\n");