static void gst_switch_server_start_case (GstCase *cas, GstSwitchServer *srv) { gboolean is_branch = FALSE; switch (cas->type) { case GST_CASE_BRANCH_A: case GST_CASE_BRANCH_B: case GST_CASE_BRANCH_a: case GST_CASE_BRANCH_p: is_branch = TRUE; default: break; } if (srv->controller && is_branch) { GST_SWITCH_SERVER_LOCK_CONTROLLER (srv); if (srv->controller && is_branch) { gst_switch_controller_tell_preview_port (srv->controller, cas->sink_port, cas->serve_type, cas->type); if (cas->type == GST_CASE_BRANCH_a) { gst_switch_controller_tell_audio_port (srv->controller, cas->sink_port); } } GST_SWITCH_SERVER_UNLOCK_CONTROLLER (srv); } }
static gpointer gst_switch_server_controller (GstSwitchServer *srv) { GSocket *socket; GError *error; gint bound_port; srv->controller_socket = gst_switch_server_listen (srv, srv->controller_port, &bound_port); if (!srv->controller_socket) { return NULL; } while (srv->controller_thread && srv->controller_socket && srv->cancellable) { socket = g_socket_accept (srv->controller_socket, srv->cancellable, &error); if (!socket) { ERROR ("accept: %s", error->message); continue; } gst_switch_server_allow_tcp_control (srv, socket); } GST_SWITCH_SERVER_LOCK_CONTROLLER (srv); g_thread_unref (srv->controller_thread); srv->controller_thread = NULL; GST_SWITCH_SERVER_UNLOCK_CONTROLLER (srv); return NULL; }
static void gst_switch_server_start_output (GstWorker *worker, GstSwitchServer * srv) { g_return_if_fail (GST_IS_WORKER (worker)); GST_SWITCH_SERVER_LOCK_CONTROLLER (srv); if (srv->controller) { gst_switch_controller_tell_compose_port (srv->controller, srv->composite->sink_port); } GST_SWITCH_SERVER_UNLOCK_CONTROLLER (srv); }
/** * gst_switch_server_end_transition: * * The composite worker has finished a transition of modes. */ static void gst_switch_server_end_transition (GstWorker * worker, GstSwitchServer * srv) { g_return_if_fail (GST_IS_WORKER (worker)); GST_SWITCH_SERVER_LOCK_CONTROLLER (srv); if (srv->controller) { gint mode = srv->composite->mode; gst_switch_controller_tell_new_mode_onlne (srv->controller, mode); } GST_SWITCH_SERVER_UNLOCK_CONTROLLER (srv); }
static void gst_switch_server_prepare_bus_controller (GstSwitchServer * srv) { if (srv->controller == NULL) { GST_SWITCH_SERVER_LOCK_CONTROLLER (srv); if (srv->controller == NULL) { srv->controller = GST_SWITCH_CONTROLLER (g_object_new ( GST_TYPE_SWITCH_CONTROLLER, NULL)); srv->controller->server = srv; } GST_SWITCH_SERVER_UNLOCK_CONTROLLER (srv); } }