本文整理汇总了C++中GST_PAD_CAST函数的典型用法代码示例。如果您正苦于以下问题:C++ GST_PAD_CAST函数的具体用法?C++ GST_PAD_CAST怎么用?C++ GST_PAD_CAST使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GST_PAD_CAST函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: gst_ghost_pad_init
static void
gst_ghost_pad_init (GstGhostPad * pad)
{
GST_GHOST_PAD_PRIVATE (pad) = G_TYPE_INSTANCE_GET_PRIVATE (pad,
GST_TYPE_GHOST_PAD, GstGhostPadPrivate);
gst_pad_set_setcaps_function (GST_PAD_CAST (pad),
GST_DEBUG_FUNCPTR (gst_ghost_pad_do_setcaps));
gst_pad_set_activatepull_function (GST_PAD_CAST (pad),
GST_DEBUG_FUNCPTR (gst_ghost_pad_do_activate_pull));
gst_pad_set_activatepush_function (GST_PAD_CAST (pad),
GST_DEBUG_FUNCPTR (gst_ghost_pad_do_activate_push));
}
开发者ID:WangCrystal,项目名称:gstreamer,代码行数:13,代码来源:gstghostpad.c
示例2: splitmux_part_reader_reset
static void
splitmux_part_reader_reset (GstSplitMuxPartReader * reader)
{
GList *cur;
SPLITMUX_PART_LOCK (reader);
for (cur = g_list_first (reader->pads); cur != NULL; cur = g_list_next (cur)) {
GstPad *pad = GST_PAD_CAST (cur->data);
gst_pad_set_active (GST_PAD_CAST (pad), FALSE);
gst_object_unref (GST_OBJECT_CAST (pad));
}
g_list_free (reader->pads);
reader->pads = NULL;
SPLITMUX_PART_UNLOCK (reader);
}
开发者ID:ConfusedReality,项目名称:pkg_multimedia_gst-plugins-good,代码行数:16,代码来源:gstsplitmuxpartreader.c
示例3: gst_ghost_pad_set_target
/**
* gst_ghost_pad_set_target:
* @gpad: the #GstGhostPad
* @newtarget: (transfer none) (allow-none): the new pad target
*
* Set the new target of the ghostpad @gpad. Any existing target
* is unlinked and links to the new target are established. if @newtarget is
* %NULL the target will be cleared.
*
* Returns: (transfer full): %TRUE if the new target could be set. This function
* can return %FALSE when the internal pads could not be linked.
*/
gboolean
gst_ghost_pad_set_target (GstGhostPad * gpad, GstPad * newtarget)
{
GstPad *internal;
GstPad *oldtarget;
GstPadLinkReturn lret;
g_return_val_if_fail (GST_IS_GHOST_PAD (gpad), FALSE);
g_return_val_if_fail (GST_PAD_CAST (gpad) != newtarget, FALSE);
g_return_val_if_fail (newtarget != GST_PROXY_PAD_INTERNAL (gpad), FALSE);
GST_OBJECT_LOCK (gpad);
internal = GST_PROXY_PAD_INTERNAL (gpad);
if (newtarget)
GST_DEBUG_OBJECT (gpad, "set target %s:%s", GST_DEBUG_PAD_NAME (newtarget));
else
GST_DEBUG_OBJECT (gpad, "clearing target");
/* clear old target */
if ((oldtarget = gst_pad_get_peer (internal))) {
GST_OBJECT_UNLOCK (gpad);
/* unlink internal pad */
if (GST_PAD_IS_SRC (internal))
gst_pad_unlink (internal, oldtarget);
else
gst_pad_unlink (oldtarget, internal);
gst_object_unref (oldtarget);
} else {
GST_OBJECT_UNLOCK (gpad);
}
if (newtarget) {
/* and link to internal pad without any checks */
GST_DEBUG_OBJECT (gpad, "connecting internal pad to target %"
GST_PTR_FORMAT, newtarget);
if (GST_PAD_IS_SRC (internal))
lret =
gst_pad_link_full (internal, newtarget, GST_PAD_LINK_CHECK_NOTHING);
else
lret =
gst_pad_link_full (newtarget, internal, GST_PAD_LINK_CHECK_NOTHING);
if (lret != GST_PAD_LINK_OK)
goto link_failed;
}
return TRUE;
/* ERRORS */
link_failed:
{
GST_WARNING_OBJECT (gpad, "could not link internal and target, reason:%s",
gst_pad_link_get_name (lret));
return FALSE;
}
}
开发者ID:carlo0815,项目名称:gstreamer1.7.1,代码行数:72,代码来源:gstghostpad.c
示例4: no_more_pads
static void
no_more_pads (GstElement * element, GstSplitMuxPartReader * reader)
{
GstClockTime duration = GST_CLOCK_TIME_NONE;
GList *cur;
/* Query the minimum duration of any pad in this piece and store it.
* FIXME: Only consider audio and video */
SPLITMUX_PART_LOCK (reader);
for (cur = g_list_first (reader->pads); cur != NULL; cur = g_list_next (cur)) {
GstPad *target = GST_PAD_CAST (cur->data);
if (target) {
gint64 cur_duration;
if (gst_pad_peer_query_duration (target, GST_FORMAT_TIME, &cur_duration)) {
GST_INFO_OBJECT (reader,
"file %s pad %" GST_PTR_FORMAT " duration %" GST_TIME_FORMAT,
reader->path, target, GST_TIME_ARGS (cur_duration));
if (cur_duration < duration)
duration = cur_duration;
}
}
}
GST_INFO_OBJECT (reader, "file %s duration %" GST_TIME_FORMAT,
reader->path, GST_TIME_ARGS (duration));
reader->duration = (GstClockTime) duration;
reader->no_more_pads = TRUE;
check_if_pads_collected (reader);
SPLITMUX_PART_UNLOCK (reader);
}
开发者ID:ConfusedReality,项目名称:pkg_multimedia_gst-plugins-good,代码行数:30,代码来源:gstsplitmuxpartreader.c
示例5: gst_play_sink_video_convert_init
static void
gst_play_sink_video_convert_init (GstPlaySinkVideoConvert * self)
{
GstPadTemplate *templ;
self->lock = g_mutex_new ();
gst_segment_init (&self->segment, GST_FORMAT_UNDEFINED);
templ = gst_static_pad_template_get (&sinktemplate);
self->sinkpad = gst_ghost_pad_new_no_target_from_template ("sink", templ);
gst_pad_set_event_function (self->sinkpad,
GST_DEBUG_FUNCPTR (gst_play_sink_video_convert_sink_event));
gst_pad_set_setcaps_function (self->sinkpad,
GST_DEBUG_FUNCPTR (gst_play_sink_video_convert_sink_setcaps));
gst_pad_set_getcaps_function (self->sinkpad,
GST_DEBUG_FUNCPTR (gst_play_sink_video_convert_getcaps));
self->sink_proxypad =
GST_PAD_CAST (gst_proxy_pad_get_internal (GST_PROXY_PAD (self->sinkpad)));
gst_element_add_pad (GST_ELEMENT_CAST (self), self->sinkpad);
gst_object_unref (templ);
templ = gst_static_pad_template_get (&srctemplate);
self->srcpad = gst_ghost_pad_new_no_target_from_template ("src", templ);
gst_pad_set_getcaps_function (self->srcpad,
GST_DEBUG_FUNCPTR (gst_play_sink_video_convert_getcaps));
gst_element_add_pad (GST_ELEMENT_CAST (self), self->srcpad);
gst_object_unref (templ);
gst_ghost_pad_set_target (GST_GHOST_PAD_CAST (self->srcpad),
self->sink_proxypad);
}
开发者ID:mrchapp,项目名称:gst-plugins-base,代码行数:33,代码来源:gstplaysinkvideoconvert.c
示例6: gst_selector_pad_get_property
static void
gst_selector_pad_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
{
GstSelectorPad *spad = GST_SELECTOR_PAD_CAST (object);
switch (prop_id) {
case PROP_PAD_RUNNING_TIME:
g_value_set_int64 (value, gst_selector_pad_get_running_time (spad));
break;
case PROP_PAD_TAGS:
GST_OBJECT_LOCK (object);
g_value_set_boxed (value, spad->tags);
GST_OBJECT_UNLOCK (object);
break;
case PROP_PAD_ACTIVE:
{
GstInputSelector *sel;
sel = GST_INPUT_SELECTOR (gst_pad_get_parent (spad));
g_value_set_boolean (value, gst_input_selector_is_active_sinkpad (sel,
GST_PAD_CAST (spad)));
gst_object_unref (sel);
break;
}
case PROP_PAD_ALWAYS_OK:
GST_OBJECT_LOCK (object);
g_value_set_boolean (value, spad->always_ok);
GST_OBJECT_UNLOCK (object);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
开发者ID:kanongil,项目名称:gst-plugins-bad,代码行数:35,代码来源:gstinputselector.c
示例7: gst_play_sink_convert_bin_init
static void
gst_play_sink_convert_bin_init (GstPlaySinkConvertBin * self)
{
GstPadTemplate *templ;
g_mutex_init (&self->lock);
templ = gst_static_pad_template_get (&sinktemplate);
self->sinkpad = gst_ghost_pad_new_no_target_from_template ("sink", templ);
gst_pad_set_event_function (self->sinkpad,
GST_DEBUG_FUNCPTR (gst_play_sink_convert_bin_sink_event));
gst_pad_set_query_function (self->sinkpad,
GST_DEBUG_FUNCPTR (gst_play_sink_convert_bin_query));
self->sink_proxypad =
GST_PAD_CAST (gst_proxy_pad_get_internal (GST_PROXY_PAD (self->sinkpad)));
gst_element_add_pad (GST_ELEMENT_CAST (self), self->sinkpad);
gst_object_unref (templ);
templ = gst_static_pad_template_get (&srctemplate);
self->srcpad = gst_ghost_pad_new_no_target_from_template ("src", templ);
gst_pad_set_query_function (self->srcpad,
GST_DEBUG_FUNCPTR (gst_play_sink_convert_bin_query));
gst_element_add_pad (GST_ELEMENT_CAST (self), self->srcpad);
gst_object_unref (templ);
gst_play_sink_convert_bin_add_identity (self);
}
开发者ID:ksophocleous,项目名称:gst-plugins-base,代码行数:29,代码来源:gstplaysinkconvertbin.c
示例8: gst_selector_pad_get_property
static void
gst_selector_pad_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec)
{
RsnSelectorPad *pad;
pad = GST_SELECTOR_PAD (object);
switch (prop_id) {
case PROP_PAD_TAGS:
GST_OBJECT_LOCK (object);
g_value_set_boxed (value, pad->tags);
GST_OBJECT_UNLOCK (object);
break;
case PROP_PAD_ACTIVE:
{
RsnStreamSelector *sel;
sel = RSN_STREAM_SELECTOR (gst_pad_get_parent (pad));
g_value_set_boolean (value, rsn_stream_selector_is_active_sinkpad (sel,
GST_PAD_CAST (pad)));
gst_object_unref (sel);
break;
}
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
开发者ID:bilboed,项目名称:gst-plugins-bad,代码行数:29,代码来源:rsnstreamselector.c
示例9: gst_ghost_pad_new_full
static GstPad *
gst_ghost_pad_new_full (const gchar * name, GstPadDirection dir,
GstPadTemplate * templ)
{
GstGhostPad *ret;
g_return_val_if_fail (dir != GST_PAD_UNKNOWN, NULL);
/* OBJECT CREATION */
if (templ) {
ret = g_object_new (GST_TYPE_GHOST_PAD, "name", name,
"direction", dir, "template", templ, NULL);
} else {
ret = g_object_new (GST_TYPE_GHOST_PAD, "name", name,
"direction", dir, NULL);
}
if (!gst_ghost_pad_construct (ret))
goto construct_failed;
return GST_PAD_CAST (ret);
construct_failed:
/* already logged */
gst_object_unref (ret);
return NULL;
}
开发者ID:Grobik1,项目名称:gstreamer,代码行数:27,代码来源:gstghostpad.c
示例10: gst_audiomixer_sink_event
static gboolean
gst_audiomixer_sink_event (GstAggregator * agg, GstAggregatorPad * aggpad,
GstEvent * event)
{
GstAudioMixer *audiomixer = GST_AUDIO_MIXER (agg);
gboolean res = TRUE;
GST_DEBUG_OBJECT (aggpad, "Got %s event on sink pad",
GST_EVENT_TYPE_NAME (event));
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_CAPS:
{
GstCaps *caps;
gst_event_parse_caps (event, &caps);
res = gst_audiomixer_setcaps (audiomixer, GST_PAD_CAST (aggpad), caps);
gst_event_unref (event);
event = NULL;
break;
}
default:
break;
}
if (event != NULL)
return GST_AGGREGATOR_CLASS (parent_class)->sink_event (agg, aggpad, event);
return res;
}
开发者ID:alessandrod,项目名称:gst-plugins-bad,代码行数:30,代码来源:gstaudiomixer.c
示例11: gst_funnel_request_new_pad
static GstPad *
gst_funnel_request_new_pad (GstElement * element, GstPadTemplate * templ,
const gchar * name, const GstCaps * caps)
{
GstPad *sinkpad;
GST_DEBUG_OBJECT (element, "requesting pad");
sinkpad = GST_PAD_CAST (g_object_new (GST_TYPE_FUNNEL_PAD,
"name", name, "direction", templ->direction, "template", templ,
NULL));
gst_pad_set_chain_function (sinkpad,
GST_DEBUG_FUNCPTR (gst_funnel_sink_chain));
gst_pad_set_chain_list_function (sinkpad,
GST_DEBUG_FUNCPTR (gst_funnel_sink_chain_list));
gst_pad_set_event_function (sinkpad,
GST_DEBUG_FUNCPTR (gst_funnel_sink_event));
GST_OBJECT_FLAG_SET (sinkpad, GST_PAD_FLAG_PROXY_CAPS);
GST_OBJECT_FLAG_SET (sinkpad, GST_PAD_FLAG_PROXY_ALLOCATION);
gst_pad_set_active (sinkpad, TRUE);
gst_element_add_pad (element, sinkpad);
GST_DEBUG_OBJECT (element, "requested pad %s:%s",
GST_DEBUG_PAD_NAME (sinkpad));
return sinkpad;
}
开发者ID:Kurento,项目名称:gstreamer,代码行数:31,代码来源:gstfunnel.c
示例12: _create_pad
static GstPad *
_create_pad (GstMssDemux * mssdemux, GstMssStream * manifeststream)
{
gchar *name = NULL;
GstPad *srcpad = NULL;
GstMssStreamType streamtype;
GstPadTemplate *tmpl = NULL;
streamtype = gst_mss_stream_get_type (manifeststream);
GST_DEBUG_OBJECT (mssdemux, "Found stream of type: %s",
gst_mss_stream_type_name (streamtype));
/* TODO use stream's name/bitrate/index as the pad name? */
if (streamtype == MSS_STREAM_TYPE_VIDEO) {
name = g_strdup_printf ("video_%02u", mssdemux->n_videos++);
tmpl = gst_static_pad_template_get (&gst_mss_demux_videosrc_template);
} else if (streamtype == MSS_STREAM_TYPE_AUDIO) {
name = g_strdup_printf ("audio_%02u", mssdemux->n_audios++);
tmpl = gst_static_pad_template_get (&gst_mss_demux_audiosrc_template);
}
if (tmpl != NULL) {
srcpad =
GST_PAD_CAST (gst_ghost_pad_new_no_target_from_template (name, tmpl));
g_free (name);
gst_object_unref (tmpl);
}
if (!srcpad) {
GST_WARNING_OBJECT (mssdemux, "Ignoring unknown type stream");
return NULL;
}
return srcpad;
}
开发者ID:iperry,项目名称:gst-plugins-bad,代码行数:34,代码来源:gstmssdemux.c
示例13: gst_ghost_pad_init
static void
gst_ghost_pad_init (GstGhostPad * pad)
{
GST_GHOST_PAD_PRIVATE (pad) = gst_ghost_pad_get_instance_private (pad);
gst_pad_set_activatemode_function (GST_PAD_CAST (pad),
gst_ghost_pad_activate_mode_default);
}
开发者ID:like0403,项目名称:gstreamer,代码行数:8,代码来源:gstghostpad.c
示例14: notifyGstTagsOnPad
void notifyGstTagsOnPad(GstElement* element, GstPad* pad, GstTagList* tags)
{
#ifdef GST_API_VERSION_1
UNUSED_PARAM(element);
gst_pad_push_event(GST_PAD_CAST(pad), gst_event_new_tag(tags));
#else
gst_element_found_tags_for_pad(element, pad, tags);
#endif
}
开发者ID:dog-god,项目名称:iptv,代码行数:9,代码来源:GStreamerVersioning.cpp
示例15: forward_sticky_events
static gboolean
forward_sticky_events (GstPad * pad, GstEvent ** event, gpointer user_data)
{
GstPad *srcpad = GST_PAD_CAST (user_data);
gst_pad_push_event (srcpad, gst_event_ref (*event));
return TRUE;
}
开发者ID:ConfusedReality,项目名称:pkg_multimedia_gstreamer,代码行数:9,代码来源:gstoutputselector.c
示例16: gst_ghost_pad_init
static void
gst_ghost_pad_init (GstGhostPad * pad)
{
GST_GHOST_PAD_PRIVATE (pad) = G_TYPE_INSTANCE_GET_PRIVATE (pad,
GST_TYPE_GHOST_PAD, GstGhostPadPrivate);
gst_pad_set_activatemode_function (GST_PAD_CAST (pad),
gst_ghost_pad_activate_mode_default);
}
开发者ID:Grobik1,项目名称:gstreamer,代码行数:9,代码来源:gstghostpad.c
示例17: kms_agnostic_bin2_link_to_tee
static void
kms_agnostic_bin2_link_to_tee (KmsAgnosticBin2 * self, GstPad * pad,
GstElement * tee, GstCaps * caps)
{
GstElement *queue = gst_element_factory_make ("queue", NULL);
GstPad *target;
GstProxyPad *proxy;
gst_bin_add (GST_BIN (self), queue);
gst_element_sync_state_with_parent (queue);
if (!(gst_caps_is_any (caps) || gst_caps_is_empty (caps))
&& kms_utils_caps_are_raw (caps)) {
GstElement *convert = kms_utils_create_convert_for_caps (caps);
GstElement *rate = kms_utils_create_rate_for_caps (caps);
GstElement *mediator = kms_utils_create_mediator_element (caps);
remove_element_on_unlinked (convert, "src", "sink");
if (rate) {
remove_element_on_unlinked (rate, "src", "sink");
}
remove_element_on_unlinked (mediator, "src", "sink");
if (rate) {
gst_bin_add (GST_BIN (self), rate);
}
gst_bin_add_many (GST_BIN (self), convert, mediator, NULL);
gst_element_sync_state_with_parent (mediator);
gst_element_sync_state_with_parent (convert);
if (rate) {
gst_element_sync_state_with_parent (rate);
}
if (rate) {
gst_element_link_many (queue, rate, mediator, NULL);
} else {
gst_element_link (queue, mediator);
}
gst_element_link_many (mediator, convert, NULL);
target = gst_element_get_static_pad (convert, "src");
} else {
target = gst_element_get_static_pad (queue, "src");
}
gst_ghost_pad_set_target (GST_GHOST_PAD (pad), target);
proxy = gst_proxy_pad_get_internal (GST_PROXY_PAD (pad));
gst_pad_set_query_function (GST_PAD_CAST (proxy),
proxy_src_pad_query_function);
g_object_unref (proxy);
g_object_unref (target);
link_element_to_tee (tee, queue);
}
开发者ID:ArenaCloud,项目名称:kms-core,代码行数:57,代码来源:kmsagnosticbin.c
示例18: forward_sticky_events
static gboolean
forward_sticky_events (GstPad * pad, GstEvent ** event, gpointer user_data)
{
GstPad *srcpad = GST_PAD_CAST (user_data);
/* Stream start and caps have already been pushed */
if (GST_EVENT_TYPE (*event) >= GST_EVENT_SEGMENT)
gst_pad_push_event (srcpad, gst_event_ref (*event));
return TRUE;
}
开发者ID:collects,项目名称:gst-plugins-good,代码行数:11,代码来源:gstrtpptdemux.c
示例19: gst_stream_info_set_mute
gboolean
gst_stream_info_set_mute (GstStreamInfo * stream_info, gboolean mute)
{
g_return_val_if_fail (GST_IS_STREAM_INFO (stream_info), FALSE);
if (stream_info->type == GST_STREAM_TYPE_ELEMENT) {
g_warning ("cannot mute element stream");
return FALSE;
}
if (mute != stream_info->mute) {
/* nothing really happens here. it looks like gstplaybasebin installs a
* buffer probe hat drops buffers when muting. but the this removes it self
* after first call.
*/
stream_info->mute = mute;
#if 0
gst_pad_set_active ((GstPad *) GST_PAD_CAST (stream_info->object), !mute);
#endif
#if 0
{
GstElement *element;
element = gst_pad_get_parent_element ((GstPad *)
GST_PAD_CAST (stream_info->object));
if (element) {
if (mute) {
g_signal_connect (element, "state-changed",
G_CALLBACK (stream_info_change_state), stream_info);
} else {
g_signal_handlers_disconnect_by_func (element,
G_CALLBACK (stream_info_change_state), stream_info);
}
gst_object_unref (element);
}
}
#endif
}
return TRUE;
}
开发者ID:prajnashi,项目名称:gst-plugins-base,代码行数:41,代码来源:gststreaminfo.c
示例20: gst_ghost_pad_get_target
/**
* gst_ghost_pad_get_target:
* @gpad: the #GstGhostPad
*
* Get the target pad of @gpad. Unref target pad after usage.
*
* Returns: (transfer full): the target #GstPad, can be NULL if the ghostpad
* has no target set. Unref target pad after usage.
*/
GstPad *
gst_ghost_pad_get_target (GstGhostPad * gpad)
{
GstPad *ret;
g_return_val_if_fail (GST_IS_GHOST_PAD (gpad), NULL);
ret = gst_proxy_pad_get_target (GST_PAD_CAST (gpad));
GST_DEBUG_OBJECT (gpad, "get target %s:%s", GST_DEBUG_PAD_NAME (ret));
return ret;
}
开发者ID:Grobik1,项目名称:gstreamer,代码行数:22,代码来源:gstghostpad.c
注:本文中的GST_PAD_CAST函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论