Пример #1
0
static gboolean
gst_sctp_enc_src_activate_mode (GstPad * pad, GstObject * parent,
                                GstPadMode mode, gboolean active)
{
    GstSctpEnc *self = GST_SCTP_ENC(parent);
    gboolean ret = FALSE;

    switch (mode) {
    case GST_PAD_MODE_PUSH:
        if (active) {
            self->need_segment = self->need_stream_start_caps = TRUE;
            gst_data_queue_set_flushing(self->outbound_sctp_packet_queue, FALSE);
            gst_pad_start_task(self->src_pad,
                               (GstTaskFunction)gst_sctp_enc_srcpad_loop, self->src_pad, NULL);
            ret = configure_association(self);
        } else {
            sctpenc_cleanup(self);
            ret = TRUE;
        }
        GST_DEBUG_OBJECT (self, "activate_mode: active %d, ret %d", active, ret);
        break;
    default:
        break;
    }

    return ret;
}
Пример #2
0
static GstStateChangeReturn gst_sctp_dec_change_state(GstElement *element,
    GstStateChange transition)
{
    GstSctpDec *self = GST_SCTP_DEC(element);
    GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;

    switch (transition) {
    case GST_STATE_CHANGE_READY_TO_PAUSED:
        if (!configure_association(self))
            ret = GST_STATE_CHANGE_FAILURE;
        break;
    case GST_STATE_CHANGE_PAUSED_TO_READY:
        sctpdec_cleanup(self);
        break;
    default:
        break;
    }

    if (ret != GST_STATE_CHANGE_FAILURE)
        ret = GST_ELEMENT_CLASS(parent_class)->change_state(element, transition);

    return ret;
}