static void gst_udpsrc_init (GstUDPSrc * udpsrc, GstUDPSrcClass * klass) { udpsrc->uri = g_strdup_printf ("udp://%s:%u", UDP_DEFAULT_MULTICAST_GROUP, UDP_DEFAULT_PORT); udpsrc->host = g_strdup (UDP_DEFAULT_MULTICAST_GROUP); udpsrc->port = UDP_DEFAULT_PORT; udpsrc->socket = UDP_DEFAULT_SOCKET; udpsrc->multi_iface = g_strdup (UDP_DEFAULT_MULTICAST_IFACE); udpsrc->buffer_size = UDP_DEFAULT_BUFFER_SIZE; udpsrc->timeout = UDP_DEFAULT_TIMEOUT; udpsrc->skip_first_bytes = UDP_DEFAULT_SKIP_FIRST_BYTES; udpsrc->close_socket = UDP_DEFAULT_CLOSE_SOCKET; udpsrc->external_socket = (udpsrc->socket != NULL); udpsrc->auto_multicast = UDP_DEFAULT_AUTO_MULTICAST; udpsrc->used_socket = UDP_DEFAULT_USED_SOCKET; udpsrc->reuse = UDP_DEFAULT_REUSE; udpsrc->cancellable = g_cancellable_new (); /* configure basesrc to be a live source */ gst_base_src_set_live (GST_BASE_SRC (udpsrc), TRUE); /* make basesrc output a segment in time */ gst_base_src_set_format (GST_BASE_SRC (udpsrc), GST_FORMAT_TIME); /* make basesrc set timestamps on outgoing buffers based on the running_time * when they were captured */ gst_base_src_set_do_timestamp (GST_BASE_SRC (udpsrc), TRUE); }
static void gst_dv1394src_init (GstDV1394Src * dv1394src, GstDV1394SrcClass * klass) { GstPad *srcpad = GST_BASE_SRC_PAD (dv1394src); gst_base_src_set_live (GST_BASE_SRC (dv1394src), TRUE); gst_base_src_set_format (GST_BASE_SRC (dv1394src), GST_FORMAT_TIME); gst_base_src_set_do_timestamp (GST_BASE_SRC (dv1394src), TRUE); gst_pad_use_fixed_caps (srcpad); dv1394src->port = DEFAULT_PORT; dv1394src->channel = DEFAULT_CHANNEL; dv1394src->consecutive = DEFAULT_CONSECUTIVE; dv1394src->skip = DEFAULT_SKIP; dv1394src->drop_incomplete = DEFAULT_DROP_INCOMPLETE; dv1394src->use_avc = DEFAULT_USE_AVC; dv1394src->guid = DEFAULT_GUID; dv1394src->uri = g_strdup_printf ("dv://%d", dv1394src->port); dv1394src->device_name = g_strdup_printf ("Default"); READ_SOCKET (dv1394src) = -1; WRITE_SOCKET (dv1394src) = -1; /* initialized when first header received */ dv1394src->frame_size = 0; dv1394src->buf = NULL; dv1394src->frame = NULL; dv1394src->frame_sequence = 0; dv1394src->provided_clock = gst_1394_clock_new ("dv1394clock"); }
/** * Initialize the new element instance * * We instantiate our pad and add it to the element * We set the pad calback functions, and initialize instance data for our structure. * \todo shouldn't this code call the base class init also? * * \param me pointer to the new instance * \param gclass pointer to the class definition */ static void gst_ccnxsrc_init (Gstccnxsrc * me, /*@unused@ */ GstccnxsrcClass * gclass) { gint i; me->srcpad = gst_pad_new_from_static_template (&src_factory, "src"); gst_pad_set_getcaps_function (me->srcpad, GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps)); gst_element_add_pad (GST_ELEMENT (me), me->srcpad); me->silent = FALSE; me->uri = g_strdup (CCNX_DEFAULT_URI); me->fifo_head = 0; me->fifo_tail = 0; me->intWindow = 0; me->intStates = calloc (CCN_WINDOW_SIZE, sizeof (CcnxInterestState)); /* init the array of outstanding states */ for (i = 0; i < CCN_WINDOW_SIZE; ++i) me->intStates[i].state = OInterest_idle; me->i_pos = 0; me->i_bufoffset = 0; me->buf = gst_buffer_new_and_alloc (CCN_FIFO_BLOCK_SIZE); gst_base_src_set_format (GST_BASE_SRC (me), GST_FORMAT_TIME); gst_base_src_set_do_timestamp (GST_BASE_SRC (me), TRUE); }
static void gst_avdtp_src_init (GstAvdtpSrc * avdtpsrc) { avdtpsrc->poll = gst_poll_new (TRUE); gst_base_src_set_format (GST_BASE_SRC (avdtpsrc), GST_FORMAT_TIME); gst_base_src_set_live (GST_BASE_SRC (avdtpsrc), TRUE); gst_base_src_set_do_timestamp (GST_BASE_SRC (avdtpsrc), TRUE); }
static void gst_rpi_cam_src_init (GstRpiCamSrc * src) { gst_base_src_set_format (GST_BASE_SRC (src), GST_FORMAT_TIME); gst_base_src_set_live (GST_BASE_SRC (src), TRUE); raspicapture_default_config (&src->capture_config); src->capture_config.intraperiod = KEYFRAME_INTERVAL_DEFAULT; src->capture_config.verbose = 1; g_mutex_init (&src->config_lock); /* Don't let basesrc set timestamps, we'll do it using * buffer PTS and system times */ gst_base_src_set_do_timestamp (GST_BASE_SRC (src), FALSE); }
/* initialize the new element * instantiate pads and add them to element * set pad calback functions * initialize instance structure */ static void gst_vbisrc_init (Gstvbisrc * vbisrc) { vbisrc->srcpad = gst_pad_new_from_static_template (&src_factory, "src"); GST_PAD_SET_PROXY_CAPS (vbisrc->srcpad); gst_element_add_pad (GST_ELEMENT (vbisrc), vbisrc->srcpad); vbisrc->silent = FALSE; vbisrc->services = VBI_SLICED_TELETEXT_B; vbisrc->device = g_strdup("/dev/vbi0"); /* configure to be a live source */ gst_base_src_set_live(GST_BASE_SRC (vbisrc),TRUE); /* output a segment in time */ gst_base_src_set_format(GST_BASE_SRC(vbisrc), GST_FORMAT_TIME); /* set timestamps on outgoing buffers based on the running_time when they were captured. */ gst_base_src_set_do_timestamp(GST_BASE_SRC(vbisrc),TRUE); }
static void gst_nanomsgsrc_init(GstNanomsgSrc *nanomsgsrc) { nanomsgsrc->uri = DEFAULT_URI; nanomsgsrc->timeout = DEFAULT_TIMEOUT; nanomsgsrc->protocol = DEFAULT_PROTOCOL; nanomsgsrc->ipv4only = DEFAULT_IPV4ONLY; nanomsgsrc->rcvbufsize = DEFAULT_RCVBUFSIZE; nanomsgsrc->subscription_topic = DEFAULT_SUBSCRIPTION_TOPIC; nanomsgsrc->main_fd = -1; nanomsgsrc->ctrl_fds[0] = -1; nanomsgsrc->ctrl_fds[1] = -1; nanomsgsrc->flushing = FALSE; g_mutex_init(&(nanomsgsrc->mutex)); gst_base_src_set_format(GST_BASE_SRC(nanomsgsrc), GST_FORMAT_TIME); gst_base_src_set_do_timestamp(GST_BASE_SRC(nanomsgsrc), TRUE); }
/* initialize the new element * instantiate pads and add them to element * set functions * initialize structure */ static void gst_dvbsrc_init (GstDvbSrc * object) { int i = 0; GST_INFO_OBJECT (object, "gst_dvbsrc_init"); /* We are a live source */ gst_base_src_set_live (GST_BASE_SRC (object), TRUE); /* And we wanted timestamped output */ gst_base_src_set_do_timestamp (GST_BASE_SRC (object), TRUE); gst_base_src_set_format (GST_BASE_SRC (object), GST_FORMAT_TIME); object->fd_frontend = -1; object->fd_dvr = -1; for (i = 0; i < MAX_FILTERS; i++) { object->pids[i] = G_MAXUINT16; object->fd_filters[i] = -1; } /* Pid 8192 on DVB gets the whole transport stream */ object->pids[0] = 8192; object->dvb_buffer_size = DEFAULT_DVB_BUFFER_SIZE; object->adapter_number = DEFAULT_ADAPTER; object->frontend_number = DEFAULT_FRONTEND; object->diseqc_src = DEFAULT_DISEQC_SRC; object->send_diseqc = (DEFAULT_DISEQC_SRC != -1); /* object->pol = DVB_POL_H; *//* set via G_PARAM_CONSTRUCT */ object->sym_rate = DEFAULT_SYMBOL_RATE; object->bandwidth = DEFAULT_BANDWIDTH; object->code_rate_hp = DEFAULT_CODE_RATE_HP; object->code_rate_lp = DEFAULT_CODE_RATE_LP; object->guard_interval = DEFAULT_GUARD; object->modulation = DEFAULT_MODULATION; object->transmission_mode = DEFAULT_TRANSMISSION_MODE; object->hierarchy_information = DEFAULT_HIERARCHY; object->inversion = DEFAULT_INVERSION; object->stats_interval = DEFAULT_STATS_REPORTING_INTERVAL; g_mutex_init (&object->tune_mutex); object->timeout = DEFAULT_TIMEOUT; }
static void gst_rpi_cam_src_init (GstRpiCamSrc * src) { GstColorBalanceChannel *channel; gst_base_src_set_format (GST_BASE_SRC (src), GST_FORMAT_TIME); gst_base_src_set_live (GST_BASE_SRC (src), TRUE); raspicapture_default_config (&src->capture_config); src->capture_config.intraperiod = KEYFRAME_INTERVAL_DEFAULT; src->capture_config.verbose = 1; g_mutex_init (&src->config_lock); /* Don't let basesrc set timestamps, we'll do it using * buffer PTS and system times */ gst_base_src_set_do_timestamp (GST_BASE_SRC (src), FALSE); /* Generate the channels list */ channel = g_object_new (GST_TYPE_COLOR_BALANCE_CHANNEL, NULL); channel->label = g_strdup ("CONTRAST"); channel->min_value = -100; channel->max_value = 100; src->channels = g_list_append (src->channels, channel); channel = g_object_new (GST_TYPE_COLOR_BALANCE_CHANNEL, NULL); channel->label = g_strdup ("BRIGHTNESS"); channel->min_value = 0; channel->max_value = 100; src->channels = g_list_append (src->channels, channel); channel = g_object_new (GST_TYPE_COLOR_BALANCE_CHANNEL, NULL); channel->label = g_strdup ("SATURATION"); channel->min_value = -100; channel->max_value = 100; src->channels = g_list_append (src->channels, channel); }