本文整理汇总了C++中GST_ELEMENT_GET_CLASS函数的典型用法代码示例。如果您正苦于以下问题:C++ GST_ELEMENT_GET_CLASS函数的具体用法?C++ GST_ELEMENT_GET_CLASS怎么用?C++ GST_ELEMENT_GET_CLASS使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GST_ELEMENT_GET_CLASS函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: gst_unaligned_audio_parse_init
static void
gst_unaligned_audio_parse_init (GstUnalignedAudioParse * unaligned_audio_parse)
{
GstPad *inner_pad;
GstPad *ghostpad;
unaligned_audio_parse->inner_parser =
gst_element_factory_make ("rawaudioparse", "inner_parser");
g_assert (unaligned_audio_parse->inner_parser != NULL);
g_object_set (G_OBJECT (unaligned_audio_parse->inner_parser),
"use-sink-caps", TRUE, NULL);
gst_bin_add (GST_BIN (unaligned_audio_parse),
unaligned_audio_parse->inner_parser);
inner_pad =
gst_element_get_static_pad (unaligned_audio_parse->inner_parser, "sink");
ghostpad =
gst_ghost_pad_new_from_template ("sink", inner_pad,
gst_element_class_get_pad_template (GST_ELEMENT_GET_CLASS
(unaligned_audio_parse), "sink"));
gst_element_add_pad (GST_ELEMENT (unaligned_audio_parse), ghostpad);
gst_object_unref (GST_OBJECT (inner_pad));
inner_pad = gst_element_get_static_pad (unaligned_audio_parse->inner_parser,
"src");
ghostpad =
gst_ghost_pad_new_from_template ("src", inner_pad,
gst_element_class_get_pad_template (GST_ELEMENT_GET_CLASS
(unaligned_audio_parse), "src"));
gst_element_add_pad (GST_ELEMENT (unaligned_audio_parse), ghostpad);
gst_object_unref (GST_OBJECT (inner_pad));
}
示例2: gst_video_parse_init
static void
gst_video_parse_init (GstVideoParse * vp)
{
GstPad *inner_pad;
GstPad *ghostpad;
vp->rawvideoparse =
gst_element_factory_make ("rawvideoparse", "inner_rawvideoparse");
g_assert (vp->rawvideoparse != NULL);
gst_bin_add (GST_BIN (vp), vp->rawvideoparse);
inner_pad = gst_element_get_static_pad (vp->rawvideoparse, "sink");
ghostpad =
gst_ghost_pad_new_from_template ("sink", inner_pad,
gst_element_class_get_pad_template (GST_ELEMENT_GET_CLASS (vp), "sink"));
gst_element_add_pad (GST_ELEMENT (vp), ghostpad);
gst_object_unref (GST_OBJECT (inner_pad));
inner_pad = gst_element_get_static_pad (vp->rawvideoparse, "src");
ghostpad =
gst_ghost_pad_new_from_template ("src", inner_pad,
gst_element_class_get_pad_template (GST_ELEMENT_GET_CLASS (vp), "src"));
gst_element_add_pad (GST_ELEMENT (vp), ghostpad);
gst_object_unref (GST_OBJECT (inner_pad));
}
示例3: kms_recording_profile_create_ksr_profile
static GstEncodingContainerProfile *
kms_recording_profile_create_ksr_profile (gboolean has_audio,
gboolean has_video)
{
GstEncodingContainerProfile *cprof;
GstPadTemplate *templ;
GstElement *mux;
GstCaps *pc;
pc = gst_caps_from_string ("application/x-ksr");
cprof = gst_encoding_container_profile_new ("Ksr", NULL, pc, NULL);
gst_caps_unref (pc);
/* Use matroska caps to define this profile */
mux = gst_element_factory_make ("matroskamux", NULL);
if (has_audio) {
GstCaps *ac;
templ =
gst_element_class_get_pad_template (GST_ELEMENT_GET_CLASS (mux),
"audio_%u");
ac = gst_pad_template_get_caps (templ);
gst_encoding_container_profile_add_profile (cprof, (GstEncodingProfile *)
gst_encoding_audio_profile_new (ac, NULL, NULL, 0));
gst_caps_unref (ac);
}
if (has_video) {
GstCaps *vc;
templ =
gst_element_class_get_pad_template (GST_ELEMENT_GET_CLASS (mux),
"video_%u");
vc = gst_pad_template_get_caps (templ);
gst_encoding_container_profile_add_profile (cprof, (GstEncodingProfile *)
gst_encoding_video_profile_new (vc, NULL, NULL, 0));
gst_caps_unref (vc);
}
g_object_unref (mux);
return cprof;
}
示例4: gst_osx_video_src_get_caps
static GstCaps *
gst_osx_video_src_get_caps (GstBaseSrc * src)
{
GstElementClass *gstelement_class;
GstOSXVideoSrc *self;
GstPadTemplate *pad_template;
GstCaps *caps;
GstStructure *structure;
gint width, height;
gstelement_class = GST_ELEMENT_GET_CLASS (src);
self = GST_OSX_VIDEO_SRC (src);
/* if we don't have the resolution set up, return template caps */
if (!self->world)
return NULL;
pad_template = gst_element_class_get_pad_template (gstelement_class, "src");
/* i don't think this can actually fail... */
if (!pad_template)
return NULL;
width = self->rect.right;
height = self->rect.bottom;
caps = gst_caps_copy (gst_pad_template_get_caps (pad_template));
structure = gst_caps_get_structure (caps, 0);
gst_structure_set (structure, "width", G_TYPE_INT, width, NULL);
gst_structure_set (structure, "height", G_TYPE_INT, height, NULL);
return caps;
}
示例5: gst_rtp_rtx_receive_init
static void
gst_rtp_rtx_receive_init (GstRtpRtxReceive * rtx)
{
GstElementClass *klass = GST_ELEMENT_GET_CLASS (rtx);
rtx->srcpad =
gst_pad_new_from_template (gst_element_class_get_pad_template (klass,
"src"), "src");
GST_PAD_SET_PROXY_CAPS (rtx->srcpad);
GST_PAD_SET_PROXY_ALLOCATION (rtx->srcpad);
gst_pad_set_event_function (rtx->srcpad,
GST_DEBUG_FUNCPTR (gst_rtp_rtx_receive_src_event));
gst_element_add_pad (GST_ELEMENT (rtx), rtx->srcpad);
rtx->sinkpad =
gst_pad_new_from_template (gst_element_class_get_pad_template (klass,
"sink"), "sink");
GST_PAD_SET_PROXY_CAPS (rtx->sinkpad);
GST_PAD_SET_PROXY_ALLOCATION (rtx->sinkpad);
gst_pad_set_chain_function (rtx->sinkpad,
GST_DEBUG_FUNCPTR (gst_rtp_rtx_receive_chain));
gst_element_add_pad (GST_ELEMENT (rtx), rtx->sinkpad);
rtx->ssrc2_ssrc1_map = g_hash_table_new (g_direct_hash, g_direct_equal);
rtx->seqnum_ssrc1_map = g_hash_table_new_full (g_direct_hash, g_direct_equal,
NULL, (GDestroyNotify) ssrc_assoc_free);
rtx->rtx_pt_map = g_hash_table_new (g_direct_hash, g_direct_equal);
}
示例6: gst_rtp_ssrc_demux_init
static void
gst_rtp_ssrc_demux_init (GstRtpSsrcDemux * demux)
{
GstElementClass *klass = GST_ELEMENT_GET_CLASS (demux);
demux->rtp_sink =
gst_pad_new_from_template (gst_element_class_get_pad_template (klass,
"sink"), "sink");
gst_pad_set_chain_function (demux->rtp_sink, gst_rtp_ssrc_demux_chain);
gst_pad_set_event_function (demux->rtp_sink, gst_rtp_ssrc_demux_sink_event);
gst_pad_set_iterate_internal_links_function (demux->rtp_sink,
gst_rtp_ssrc_demux_iterate_internal_links_sink);
gst_element_add_pad (GST_ELEMENT_CAST (demux), demux->rtp_sink);
demux->rtcp_sink =
gst_pad_new_from_template (gst_element_class_get_pad_template (klass,
"rtcp_sink"), "rtcp_sink");
gst_pad_set_chain_function (demux->rtcp_sink, gst_rtp_ssrc_demux_rtcp_chain);
gst_pad_set_event_function (demux->rtcp_sink, gst_rtp_ssrc_demux_sink_event);
gst_pad_set_iterate_internal_links_function (demux->rtcp_sink,
gst_rtp_ssrc_demux_iterate_internal_links_sink);
gst_element_add_pad (GST_ELEMENT_CAST (demux), demux->rtcp_sink);
g_rec_mutex_init (&demux->padlock);
}
示例7: gst_wildmidi_init
/* initialize the new element
* instantiate pads and add them to element
* set functions
* initialize structure
*/
static void
gst_wildmidi_init (GstWildmidi * filter, GstWildmidiClass * g_class)
{
GstElementClass *klass = GST_ELEMENT_GET_CLASS (filter);
filter->sinkpad =
gst_pad_new_from_template (gst_element_class_get_pad_template (klass,
"sink"), "sink");
gst_pad_set_activatepull_function (filter->sinkpad,
gst_wildmidi_activatepull);
gst_pad_set_activate_function (filter->sinkpad, gst_wildmidi_activate);
gst_pad_set_event_function (filter->sinkpad, gst_wildmidi_sink_event);
gst_pad_set_chain_function (filter->sinkpad, gst_wildmidi_chain);
gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad);
filter->srcpad =
gst_pad_new_from_template (gst_element_class_get_pad_template (klass,
"src"), "src");
gst_pad_set_query_function (filter->srcpad, gst_wildmidi_src_query);
gst_pad_set_event_function (filter->srcpad, gst_wildmidi_src_event);
gst_pad_use_fixed_caps (filter->srcpad);
gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad);
gst_segment_init (filter->o_segment, GST_FORMAT_DEFAULT);
filter->adapter = gst_adapter_new ();
filter->bytes_per_frame = WILDMIDI_BPS;
}
示例8: gst_rtp_ssrc_demux_init
static void
gst_rtp_ssrc_demux_init (GstRtpSsrcDemux * demux,
GstRtpSsrcDemuxClass * g_class)
{
GstElementClass *klass = GST_ELEMENT_GET_CLASS (demux);
demux->rtp_sink =
gst_pad_new_from_template (gst_element_class_get_pad_template (klass,
"sink"), "sink");
gst_pad_set_chain_function (demux->rtp_sink, gst_rtp_ssrc_demux_chain);
gst_pad_set_event_function (demux->rtp_sink, gst_rtp_ssrc_demux_sink_event);
gst_element_add_pad (GST_ELEMENT_CAST (demux), demux->rtp_sink);
demux->rtcp_sink =
gst_pad_new_from_template (gst_element_class_get_pad_template (klass,
"rtcp_sink"), "rtcp_sink");
gst_pad_set_chain_function (demux->rtcp_sink, gst_rtp_ssrc_demux_rtcp_chain);
gst_pad_set_event_function (demux->rtcp_sink,
gst_rtp_ssrc_demux_rtcp_sink_event);
gst_element_add_pad (GST_ELEMENT_CAST (demux), demux->rtcp_sink);
demux->padlock = g_mutex_new ();
gst_segment_init (&demux->segment, GST_FORMAT_UNDEFINED);
}
示例9: mfw_gst_vpuenc_init
static void
mfw_gst_vpuenc_init(GstVPU_Enc * vpu_enc, GstVPU_EncClass * gclass)
{
GST_DEBUG("mfw_gst_vpuenc_init");
GstElementClass *klass = GST_ELEMENT_GET_CLASS(vpu_enc);
/* create the sink and src pads */
vpu_enc->sinkpad =
gst_pad_new_from_template(gst_element_class_get_pad_template
(klass, "sink"), "sink");
vpu_enc->srcpad =
gst_pad_new_from_template(gst_element_class_get_pad_template
(klass, "src"), "src");
gst_element_add_pad(GST_ELEMENT(vpu_enc), vpu_enc->sinkpad);
gst_element_add_pad(GST_ELEMENT(vpu_enc), vpu_enc->srcpad);
vpu_enc->parent_class = g_type_class_peek_parent(gclass);
gst_pad_set_chain_function(vpu_enc->sinkpad, mfw_gst_vpuenc_chain);
gst_pad_set_event_function(vpu_enc->sinkpad,
GST_DEBUG_FUNCPTR
(mfw_gst_vpuenc_sink_event));
gst_pad_set_setcaps_function(vpu_enc->sinkpad, mfw_gst_vpuenc_setcaps);
vpu_enc->codec = STD_AVC;
vpu_enc->device = g_strdup(VPU_DEVICE);
vpu_enc->framerate = DEFAULT_FRAME_RATE;
vpu_enc->bitrate = 0;
vpu_enc->gopsize = 0;
vpu_enc->codecTypeProvided = FALSE;
vpu_enc->memory = V4L2_MEMORY_USERPTR;
vpu_enc->mjpeg_quality = 50;
}
示例10: gst_alsasink_getcaps
static GstCaps *
gst_alsasink_getcaps (GstBaseSink * bsink)
{
GstElementClass *element_class;
GstPadTemplate *pad_template;
GstAlsaSink *sink = GST_ALSA_SINK (bsink);
GstCaps *caps;
if (sink->handle == NULL) {
GST_DEBUG_OBJECT (sink, "device not open, using template caps");
return NULL; /* base class will get template caps for us */
}
if (sink->cached_caps) {
GST_LOG_OBJECT (sink, "Returning cached caps");
return gst_caps_ref (sink->cached_caps);
}
element_class = GST_ELEMENT_GET_CLASS (sink);
pad_template = gst_element_class_get_pad_template (element_class, "sink");
g_return_val_if_fail (pad_template != NULL, NULL);
caps = gst_alsa_probe_supported_formats (GST_OBJECT (sink), sink->device,
sink->handle, gst_pad_template_get_caps (pad_template));
if (caps) {
sink->cached_caps = gst_caps_ref (caps);
}
GST_INFO_OBJECT (sink, "returning caps %" GST_PTR_FORMAT, caps);
return caps;
}
示例11: gst_rdt_manager_request_new_pad
static GstPad *
gst_rdt_manager_request_new_pad (GstElement * element,
GstPadTemplate * templ, const gchar * name, const GstCaps * caps)
{
GstRDTManager *rdtmanager;
GstElementClass *klass;
GstPad *result;
g_return_val_if_fail (templ != NULL, NULL);
g_return_val_if_fail (GST_IS_RDT_MANAGER (element), NULL);
rdtmanager = GST_RDT_MANAGER (element);
klass = GST_ELEMENT_GET_CLASS (element);
/* figure out the template */
if (templ == gst_element_class_get_pad_template (klass, "recv_rtp_sink_%u")) {
result = create_recv_rtp (rdtmanager, templ, name);
} else if (templ == gst_element_class_get_pad_template (klass,
"recv_rtcp_sink_%u")) {
result = create_recv_rtcp (rdtmanager, templ, name);
} else if (templ == gst_element_class_get_pad_template (klass, "rtcp_src_%u")) {
result = create_rtcp (rdtmanager, templ, name);
} else
goto wrong_template;
return result;
/* ERRORS */
wrong_template:
{
g_warning ("rdtmanager: this is not our template");
return NULL;
}
}
示例12: gst_v4lmjpegsink_init
static void
gst_v4lmjpegsink_init (GstV4lMjpegSink * v4lmjpegsink)
{
GstElementClass *klass = GST_ELEMENT_GET_CLASS (v4lmjpegsink);
v4lmjpegsink->sinkpad =
gst_pad_new_from_template (gst_element_class_get_pad_template (klass,
"sink"), "sink");
gst_element_add_pad (GST_ELEMENT (v4lmjpegsink), v4lmjpegsink->sinkpad);
gst_pad_set_chain_function (v4lmjpegsink->sinkpad, gst_v4lmjpegsink_chain);
gst_pad_set_link_function (v4lmjpegsink->sinkpad,
gst_v4lmjpegsink_sinkconnect);
v4lmjpegsink->clock = NULL;
v4lmjpegsink->width = -1;
v4lmjpegsink->height = -1;
v4lmjpegsink->x_offset = -1;
v4lmjpegsink->y_offset = -1;
v4lmjpegsink->numbufs = 64;
v4lmjpegsink->bufsize = 256;
GST_OBJECT_FLAG_SET (v4lmjpegsink, GST_ELEMENT_THREAD_SUGGESTED);
}
示例13: gst_tta_parse_init
static void
gst_tta_parse_init (GstTtaParse * ttaparse)
{
GstElementClass *klass = GST_ELEMENT_GET_CLASS (ttaparse);
ttaparse->sinkpad =
gst_pad_new_from_template (gst_element_class_get_pad_template (klass,
"sink"), "sink");
ttaparse->srcpad =
gst_pad_new_from_template (gst_element_class_get_pad_template (klass,
"src"), "src");
gst_pad_use_fixed_caps (ttaparse->srcpad);
gst_pad_set_query_type_function (ttaparse->srcpad,
gst_tta_parse_get_query_types);
gst_pad_set_query_function (ttaparse->srcpad, gst_tta_parse_query);
gst_pad_set_event_function (ttaparse->srcpad, gst_tta_parse_src_event);
gst_element_add_pad (GST_ELEMENT (ttaparse), ttaparse->sinkpad);
gst_element_add_pad (GST_ELEMENT (ttaparse), ttaparse->srcpad);
gst_pad_set_activate_function (ttaparse->sinkpad, gst_tta_parse_activate);
gst_pad_set_activatepull_function (ttaparse->sinkpad,
gst_tta_parse_activate_pull);
gst_tta_parse_reset (ttaparse);
}
示例14: gst_fake_h264_decoder_init
static void
gst_fake_h264_decoder_init (GstFakeH264Decoder * self)
{
GstPad *pad;
pad =
gst_pad_new_from_template (gst_element_class_get_pad_template
(GST_ELEMENT_GET_CLASS (self), "sink"), "sink");
gst_pad_set_event_function (pad, gst_fake_h264_decoder_sink_event);
gst_pad_set_chain_function (pad, gst_fake_h264_decoder_sink_chain);
gst_element_add_pad (GST_ELEMENT (self), pad);
pad =
gst_pad_new_from_template (gst_element_class_get_pad_template
(GST_ELEMENT_GET_CLASS (self), "src"), "src");
gst_element_add_pad (GST_ELEMENT (self), pad);
}
示例15: gst_stream_combiner_request_new_pad
static GstPad *
gst_stream_combiner_request_new_pad (GstElement * element,
GstPadTemplate * templ, const gchar * name, const GstCaps * caps)
{
GstStreamCombiner *stream_combiner = (GstStreamCombiner *) element;
GstStreamCombinerPad *combiner_pad;
GstPad *sinkpad;
GstElementClass *klass = GST_ELEMENT_GET_CLASS (element);
GstPadTemplate *template =