diff options
author | David Schleef <ds@schleef.org> | 2014-08-31 23:16:59 -0700 |
---|---|---|
committer | David Schleef <ds@schleef.org> | 2014-08-31 23:16:59 -0700 |
commit | ba84cd7539033ac7b6ef32751e9fcc720ed07d90 (patch) | |
tree | 49d9c17f114b4207a84007e981eec0efd0a977c8 | |
parent | 95ee0e382db7e4e99a3aba6195374cceb8eac25e (diff) |
hacking
-rw-r--r-- | plugins/gstrtmp2src.c | 8 | ||||
-rw-r--r-- | rtmp/rtmpconnection.c | 2 | ||||
-rw-r--r-- | tools/client-test.c | 64 | ||||
-rw-r--r-- | tools/proxy-server.c | 2 |
4 files changed, 39 insertions, 37 deletions
diff --git a/plugins/gstrtmp2src.c b/plugins/gstrtmp2src.c index 446249a..2537fa6 100644 --- a/plugins/gstrtmp2src.c +++ b/plugins/gstrtmp2src.c @@ -129,11 +129,10 @@ GST_STATIC_PAD_TEMPLATE ("src", G_DEFINE_TYPE_WITH_CODE (GstRtmp2Src, gst_rtmp2_src, GST_TYPE_PUSH_SRC, do { - G_IMPLEMENT_INTERFACE (GST_TYPE_URI_HANDLER, + G_IMPLEMENT_INTERFACE (GST_TYPE_URI_HANDLER, gst_rtmp2_src_uri_handler_init); GST_DEBUG_CATEGORY_INIT (gst_rtmp2_src_debug_category, "rtmp2src", 0, - "debug category for rtmp2src element"); - } while (0)); + "debug category for rtmp2src element");} while (0)); static void gst_rtmp2_src_class_init (GstRtmp2SrcClass * klass) @@ -403,7 +402,8 @@ connect_done (GObject * source, GAsyncResult * result, gpointer user_data) ret = gst_rtmp_client_connect_finish (rtmp2src->client, result, &error); if (!ret) { - GST_ERROR ("error: %s", error->message); + GST_ELEMENT_ERROR (rtmp2src, RESOURCE, OPEN_READ, + ("Could not connect to server"), ("%s", error->message)); g_error_free (error); return; } diff --git a/rtmp/rtmpconnection.c b/rtmp/rtmpconnection.c index a497c75..c4277c5 100644 --- a/rtmp/rtmpconnection.c +++ b/rtmp/rtmpconnection.c @@ -967,7 +967,7 @@ gst_rtmp_connection_send_ack (GstRtmpConnection * connection) chunk = gst_rtmp_chunk_new (); chunk->stream_id = 2; chunk->timestamp = 0; - chunk->message_type_id = 3; + chunk->message_type_id = 5; chunk->info = 0; data = g_malloc (4); diff --git a/tools/client-test.c b/tools/client-test.c index 1250526..1f8eb60 100644 --- a/tools/client-test.c +++ b/tools/client-test.c @@ -45,20 +45,22 @@ static GOptionEntry entries[] = { static void connect_done (GObject * source, GAsyncResult * result, gpointer user_data); -static void cmd_connect_done (GstRtmpConnection *connection, GstRtmpChunk *chunk, - const char *command_name, int transaction_id, GstAmfNode *command_object, - GstAmfNode *optional_args, gpointer user_data); +static void cmd_connect_done (GstRtmpConnection * connection, + GstRtmpChunk * chunk, const char *command_name, int transaction_id, + GstAmfNode * command_object, GstAmfNode * optional_args, + gpointer user_data); static void send_connect (void); static void got_chunk (GstRtmpConnection * connection, GstRtmpChunk * chunk, gpointer user_data); static void send_create_stream (void); -static void create_stream_done (GstRtmpConnection *connection, GstRtmpChunk *chunk, - const char *command_name, int transaction_id, GstAmfNode *command_object, - GstAmfNode *optional_args, gpointer user_data); +static void create_stream_done (GstRtmpConnection * connection, + GstRtmpChunk * chunk, const char *command_name, int transaction_id, + GstAmfNode * command_object, GstAmfNode * optional_args, + gpointer user_data); static void send_play (void); -static void play_done (GstRtmpConnection *connection, GstRtmpChunk *chunk, - const char *command_name, int transaction_id, GstAmfNode *command_object, - GstAmfNode *optional_args, gpointer user_data); +static void play_done (GstRtmpConnection * connection, GstRtmpChunk * chunk, + const char *command_name, int transaction_id, GstAmfNode * command_object, + GstAmfNode * optional_args, gpointer user_data); int main (int argc, char *argv[]) @@ -172,13 +174,14 @@ send_connect (void) // "audioCodecs": 3191, // "videoCodecs": 252, // "videoFunction": 1, - gst_rtmp_connection_send_command (connection, 3, "connect", 1, node, NULL, cmd_connect_done, NULL); + gst_rtmp_connection_send_command (connection, 3, "connect", 1, node, NULL, + cmd_connect_done, NULL); } static void -cmd_connect_done (GstRtmpConnection *connection, GstRtmpChunk *chunk, - const char *command_name, int transaction_id, GstAmfNode *command_object, - GstAmfNode *optional_args, gpointer user_data) +cmd_connect_done (GstRtmpConnection * connection, GstRtmpChunk * chunk, + const char *command_name, int transaction_id, GstAmfNode * command_object, + GstAmfNode * optional_args, gpointer user_data) { gboolean ret; @@ -196,7 +199,7 @@ cmd_connect_done (GstRtmpConnection *connection, GstRtmpChunk *chunk, } if (ret) { - GST_ERROR("success"); + GST_ERROR ("success"); send_create_stream (); } @@ -208,26 +211,27 @@ send_create_stream (void) GstAmfNode *node; node = gst_amf_node_new (GST_AMF_TYPE_NULL); - gst_rtmp_connection_send_command (connection, 3, "createStream", 2, node, NULL, create_stream_done, NULL); + gst_rtmp_connection_send_command (connection, 3, "createStream", 2, node, + NULL, create_stream_done, NULL); } static void -create_stream_done (GstRtmpConnection *connection, GstRtmpChunk *chunk, - const char *command_name, int transaction_id, GstAmfNode *command_object, - GstAmfNode *optional_args, gpointer user_data) +create_stream_done (GstRtmpConnection * connection, GstRtmpChunk * chunk, + const char *command_name, int transaction_id, GstAmfNode * command_object, + GstAmfNode * optional_args, gpointer user_data) { gboolean ret; int stream_id; ret = FALSE; if (optional_args) { - stream_id = gst_amf_node_get_number (optional_args); - ret = TRUE; + stream_id = gst_amf_node_get_number (optional_args); + ret = TRUE; } if (ret) { - GST_ERROR("createStream success, stream_id=%d", stream_id); + GST_ERROR ("createStream success, stream_id=%d", stream_id); send_play (); } @@ -245,29 +249,27 @@ send_play (void) gst_amf_node_set_string (n2, "myStream"); n3 = gst_amf_node_new (GST_AMF_TYPE_NUMBER); gst_amf_node_set_number (n3, 0); - gst_rtmp_connection_send_command2 (connection, 8, 1, "play", 3, n1, n2, n3, NULL, play_done, NULL); + gst_rtmp_connection_send_command2 (connection, 8, 1, "play", 3, n1, n2, n3, + NULL, play_done, NULL); } static void -play_done (GstRtmpConnection *connection, GstRtmpChunk *chunk, - const char *command_name, int transaction_id, GstAmfNode *command_object, - GstAmfNode *optional_args, gpointer user_data) +play_done (GstRtmpConnection * connection, GstRtmpChunk * chunk, + const char *command_name, int transaction_id, GstAmfNode * command_object, + GstAmfNode * optional_args, gpointer user_data) { gboolean ret; int stream_id; ret = FALSE; if (optional_args) { - stream_id = gst_amf_node_get_number (optional_args); - ret = TRUE; + stream_id = gst_amf_node_get_number (optional_args); + ret = TRUE; } if (ret) { - GST_ERROR("play success, stream_id=%d", stream_id); + GST_ERROR ("play success, stream_id=%d", stream_id); } } - - - diff --git a/tools/proxy-server.c b/tools/proxy-server.c index 0d78fcb..e43196c 100644 --- a/tools/proxy-server.c +++ b/tools/proxy-server.c @@ -85,7 +85,7 @@ main (int argc, char *argv[]) client = gst_rtmp_client_new (); gst_rtmp_client_set_server_address (client, - "ec2-54-185-55-241.us-west-2.compute.amazonaws.com"); + "ec2-54-185-123-199.us-west-2.compute.amazonaws.com"); cancellable = g_cancellable_new (); if (verbose) |