Exemple #1
0
/**
 * owr_session_force_remote_candidate:
 * @session: The session on which the candidate will be forced.
 * @candidate: (transfer none): the candidate to forcibly set
 *
 * Forces the transport agent to use the given candidate. Calling this function will disable all
 * further ICE processing. Keep-alives will continue to be sent.
 */
void owr_session_force_remote_candidate(OwrSession *session, OwrCandidate *candidate)
{
    GHashTable *args;

    g_return_if_fail(OWR_IS_SESSION(session));
    g_return_if_fail(OWR_IS_CANDIDATE(candidate));

    args = _owr_create_schedule_table(OWR_MESSAGE_ORIGIN(session));
    g_hash_table_insert(args, "session", session);
    g_hash_table_insert(args, "candidate", candidate);
    g_hash_table_insert(args, "forced", GINT_TO_POINTER(TRUE));
    g_object_ref(session);
    g_object_ref(candidate);

    _owr_schedule_with_hash_table((GSourceFunc)add_remote_candidate, args);
}
void owr_window_registry_unregister(OwrWindowRegistry *window_registry,
    const gchar *tag)
{
    GHashTable *args;

    g_return_if_fail(OWR_IS_WINDOW_REGISTRY(window_registry));
    g_return_if_fail(tag);

    args = _owr_create_schedule_table(OWR_MESSAGE_ORIGIN(window_registry));
    g_hash_table_insert(args, "window_registry", window_registry);
    g_hash_table_insert(args, "tag", g_strdup(tag));

    g_object_ref(window_registry);

    _owr_schedule_with_hash_table((GSourceFunc)do_unregister, args);
}
static void tee_pad_removed_cb(GstElement *tee, GstPad *old_pad, gpointer user_data)
{
    OwrMediaSource *media_source = user_data;

    OWR_UNUSED(old_pad);

    /* No sink is left, shutdown */
    if (!tee->numsrcpads) {
        GHashTable *args;

        args = _owr_create_schedule_table(OWR_MESSAGE_ORIGIN(media_source));
        g_hash_table_insert(args, "media_source", media_source);
        g_object_ref(media_source);

        _owr_schedule_with_hash_table((GSourceFunc)shutdown_media_source, args);
    }
}
/**
 * owr_media_renderer_set_source:
 * @renderer:
 * @source: (transfer none) (allow-none):
 *
 * Returns:
 */
void owr_media_renderer_set_source(OwrMediaRenderer *renderer, OwrMediaSource *source)
{
    GHashTable *args;

    g_return_if_fail(OWR_IS_MEDIA_RENDERER(renderer));
    g_return_if_fail(!source || OWR_IS_MEDIA_SOURCE(source));

    args = _owr_create_schedule_table(OWR_MESSAGE_ORIGIN(renderer));
    g_hash_table_insert(args, "renderer", renderer);
    g_hash_table_insert(args, "source", source);

    g_object_ref(renderer);
    if (source)
        g_object_ref(source);

    _owr_schedule_with_hash_table((GSourceFunc)set_source, args);
}
Exemple #5
0
/**
 * owr_session_force_candidate_pair:
 * @session: The session on which the candidate will be forced.
 * @local_candidate: (transfer none): the local candidate to forcibly set
 * @remote_candidate: (transfer none): the remote candidate to forcibly set
 *
 * Forces the transport agent to use the given candidate pair. Calling this
 * function will disable all further ICE processing. Keep-alives will continue
 * to be sent.
 */
void owr_session_force_candidate_pair(OwrSession *session, OwrComponentType ctype,
        OwrCandidate *local_candidate, OwrCandidate *remote_candidate)
{
    GHashTable *args;

    g_return_if_fail(OWR_IS_SESSION(session));
    g_return_if_fail(OWR_IS_CANDIDATE(local_candidate));
    g_return_if_fail(OWR_IS_CANDIDATE(remote_candidate));

    args = _owr_create_schedule_table(OWR_MESSAGE_ORIGIN(session));
    g_hash_table_insert(args, "session", session);
    g_hash_table_insert(args, "component-type", GUINT_TO_POINTER(ctype));
    g_hash_table_insert(args, "local-candidate", local_candidate);
    g_hash_table_insert(args, "remote-candidate", remote_candidate);
    g_object_ref(session);
    g_object_ref(local_candidate);
    g_object_ref(remote_candidate);

    _owr_schedule_with_hash_table((GSourceFunc)add_candidate_pair, args);
}
Exemple #6
0
/**
 * owr_session_add_remote_candidate:
 * @session: the session on which the candidate will be added.
 * @candidate: (transfer none): the candidate to add
 *
 * Adds a remote candidate for this session.
 *
 */
void owr_session_add_remote_candidate(OwrSession *session, OwrCandidate *candidate)
{
    GHashTable *args;

    g_return_if_fail(session);
    g_return_if_fail(candidate);

    if (session->priv->rtcp_mux && _owr_candidate_get_component_type(candidate) == OWR_COMPONENT_TYPE_RTCP) {
        g_warning("Trying to adding RTCP component on an rtcp_muxing session. Aborting");
        return;
    }

    args = _owr_create_schedule_table(OWR_MESSAGE_ORIGIN(session));
    g_hash_table_insert(args, "session", session);
    g_hash_table_insert(args, "candidate", candidate);
    g_object_ref(session);
    g_object_ref(candidate);

    _owr_schedule_with_hash_table((GSourceFunc)add_remote_candidate, args);
}