本文整理匯總了C++中GST_PAD_CAST函數的典型用法代碼示例。如果您正苦於以下問題:C++ GST_PAD_CAST函數的具體用法?C++ GST_PAD_CAST怎麽用?C++ GST_PAD_CAST使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了GST_PAD_CAST函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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));
}
示例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);
}
示例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;
}
}
示例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);
}
示例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);
}
示例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;
}
}
示例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);
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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
}
示例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;
}