本文整理汇总了C++中GST_OBJECT_NAME函数的典型用法代码示例。如果您正苦于以下问题:C++ GST_OBJECT_NAME函数的具体用法?C++ GST_OBJECT_NAME怎么用?C++ GST_OBJECT_NAME使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GST_OBJECT_NAME函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: gst_play_sink_convert_bin_set_targets
static void
gst_play_sink_convert_bin_set_targets (GstPlaySinkConvertBin * self,
gboolean passthrough)
{
GstPad *pad;
GstElement *head, *tail;
GST_DEBUG_OBJECT (self, "Setting pad targets with passthrough %d",
passthrough);
if (self->conversion_elements == NULL || passthrough) {
GST_DEBUG_OBJECT (self, "no conversion elements, using identity (%p) as "
"head/tail", self->identity);
if (!passthrough) {
GST_WARNING_OBJECT (self,
"Doing passthrough as no converter elements were added");
}
head = tail = self->identity;
} else {
head = GST_ELEMENT (g_list_first (self->conversion_elements)->data);
tail = GST_ELEMENT (g_list_last (self->conversion_elements)->data);
GST_DEBUG_OBJECT (self, "conversion elements in use, picking "
"head:%s and tail:%s", GST_OBJECT_NAME (head), GST_OBJECT_NAME (tail));
}
g_return_if_fail (head != NULL);
g_return_if_fail (tail != NULL);
pad = gst_element_get_static_pad (head, "sink");
GST_DEBUG_OBJECT (self, "Ghosting bin sink pad to %" GST_PTR_FORMAT, pad);
gst_ghost_pad_set_target (GST_GHOST_PAD_CAST (self->sinkpad), pad);
gst_object_unref (pad);
pad = gst_element_get_static_pad (tail, "src");
GST_DEBUG_OBJECT (self, "Ghosting bin src pad to %" GST_PTR_FORMAT, pad);
gst_ghost_pad_set_target (GST_GHOST_PAD_CAST (self->srcpad), pad);
gst_object_unref (pad);
}
示例2: helper_find_suggest
/*
* helper_find_suggest:
* @data: helper data struct
* @probability: probability of the match
* @caps: caps of the type
*
* If given @probability is higher, replace previously store caps.
*/
static void
helper_find_suggest (gpointer data, GstTypeFindProbability probability,
GstCaps * caps)
{
GstTypeFindHelper *helper = (GstTypeFindHelper *) data;
GST_LOG_OBJECT (helper->obj,
"'%s' called suggest (%u, %" GST_PTR_FORMAT ")",
GST_OBJECT_NAME (helper->factory), probability, caps);
if (probability > helper->best_probability) {
gst_caps_replace (&helper->caps, caps);
helper->best_probability = probability;
}
}
示例3: error_cb
/* on error print the error and quit the application */
static void
error_cb (GstBus * bus, GstMessage * msg, APP_STATE_T * state)
{
GError *err;
gchar *debug_info;
gst_message_parse_error (msg, &err, &debug_info);
g_printerr ("Error received from element %s: %s\n",
GST_OBJECT_NAME (msg->src), err->message);
g_printerr ("Debugging information: %s\n", debug_info ? debug_info : "none");
g_clear_error (&err);
g_free (debug_info);
flush_start (state);
gst_element_set_state (state->pipeline, GST_STATE_READY);
}
示例4: error_cb
/* This function is called when an error message is posted on the bus */
static void error_cb (GstBus *bus, GstMessage *msg, CustomData *data) {
GError *err;
gchar *debug_info;
/* Print error details on the screen */
gst_message_parse_error (msg, &err, &debug_info);
g_printerr ("Error received from element %s: %s\n", GST_OBJECT_NAME (msg->src), err->message);
update_timelabel (data, err->message);
g_printerr ("Debugging information: %s\n", debug_info ? debug_info : "none");
g_clear_error (&err);
g_free (debug_info);
/* Set the pipeline to READY (which stops playback) */
audio_stop_player (data);
}
示例5: buf_helper_find_suggest
/*
* buf_helper_find_suggest:
* @data: helper data struct
* @probability: probability of the match
* @caps: caps of the type
*
* If given @probability is higher, replace previously store caps.
*/
static void
buf_helper_find_suggest (gpointer data, guint probability, GstCaps * caps)
{
GstTypeFindBufHelper *helper = (GstTypeFindBufHelper *) data;
GST_LOG_OBJECT (helper->obj,
"'%s' called suggest (%u, %" GST_PTR_FORMAT ")",
GST_OBJECT_NAME (helper->factory), probability, caps);
/* Note: not >= as we call typefinders in order of rank, highest first */
if (probability > helper->best_probability) {
gst_caps_replace (&helper->caps, caps);
helper->best_probability = probability;
}
}
示例6: gst_object_replace
/**
* gst_object_replace:
* @oldobj: pointer to a place of a #GstObject to replace
* @newobj: a new #GstObject
*
* Unrefs the #GstObject pointed to by @oldobj, refs @newobj and
* puts @newobj in *@oldobj. Be carefull when calling this
* function, it does not take any locks. You might want to lock
* the object owning @oldobj pointer before calling this
* function.
*
* Make sure not to LOCK @oldobj because it might be unreffed
* which could cause a deadlock when it is disposed.
*/
void
gst_object_replace (GstObject ** oldobj, GstObject * newobj)
{
g_return_if_fail (oldobj != NULL);
g_return_if_fail (*oldobj == NULL || GST_IS_OBJECT (*oldobj));
g_return_if_fail (newobj == NULL || GST_IS_OBJECT (newobj));
#ifdef DEBUG_REFCOUNT
GST_CAT_LOG (GST_CAT_REFCOUNTING, "replace %s (%d) with %s (%d)",
*oldobj ? GST_STR_NULL (GST_OBJECT_NAME (*oldobj)) : "(NONE)",
*oldobj ? G_OBJECT (*oldobj)->ref_count : 0,
newobj ? GST_STR_NULL (GST_OBJECT_NAME (newobj)) : "(NONE)",
newobj ? G_OBJECT (newobj)->ref_count : 0);
#endif
if (G_LIKELY (*oldobj != newobj)) {
if (newobj)
gst_object_ref (newobj);
if (*oldobj)
gst_object_unref (*oldobj);
*oldobj = newobj;
}
}
示例7: connect_sink
static void
connect_sink (GstElement * element, GstPad * pad, gpointer user_data)
{
KmsConnectData *data = user_data;
GST_DEBUG_OBJECT (pad, "New pad %" GST_PTR_FORMAT, element);
if (g_strcmp0 (GST_OBJECT_NAME (pad), data->pad_name)) {
return;
}
connect_pads_and_remove_on_unlinked (data->src, element, data->pad_name);
GST_INFO_OBJECT (pad, "Linking %s", data->pad_name);
}
示例8: is_provider_hidden
/* must be called with monitor lock */
static gboolean
is_provider_hidden (GstDeviceMonitor * monitor, GList * hidden,
GstDeviceProvider * provider)
{
GstDeviceProviderFactory *factory;
if (monitor->priv->show_all)
return FALSE;
factory = gst_device_provider_get_factory (provider);
if (g_list_find_custom (hidden, GST_OBJECT_NAME (factory),
(GCompareFunc) g_strcmp0))
return TRUE;
return FALSE;
}
示例9: rtp_ssrc_demux_new_ssrc_pad
static void
rtp_ssrc_demux_new_ssrc_pad (GstElement * ssrcdemux, guint ssrc, GstPad * pad,
KmsBaseRtpSession * self)
{
const gchar *rtp_pad_name = GST_OBJECT_NAME (pad);
gchar *rtcp_pad_name;
SdpMediaConfig *mconf;
GstPad *src, *sink;
GST_DEBUG_OBJECT (self, "pad: %" GST_PTR_FORMAT " ssrc: %" G_GUINT32_FORMAT,
pad, ssrc);
KMS_SDP_SESSION_LOCK (self);
if (self->remote_audio_ssrc == ssrc
|| ssrcs_are_mapped (ssrcdemux, self->local_audio_ssrc, ssrc)) {
mconf = self->audio_neg_mconf;
} else if (self->remote_video_ssrc == ssrc
|| ssrcs_are_mapped (ssrcdemux, self->local_video_ssrc, ssrc)) {
mconf = self->video_neg_mconf;
} else {
if (!kms_i_rtp_session_manager_custom_ssrc_management (self->manager, self,
ssrcdemux, ssrc, pad)) {
GST_ERROR_OBJECT (pad, "SSRC %" G_GUINT32_FORMAT " not matching.", ssrc);
}
goto end;
}
/* RTP */
sink =
kms_i_rtp_session_manager_request_rtp_sink (self->manager, self, mconf);
kms_base_rtp_session_link_pads (pad, sink);
g_object_unref (sink);
/* RTCP */
rtcp_pad_name = g_strconcat ("rtcp_", rtp_pad_name, NULL);
src = gst_element_get_static_pad (ssrcdemux, rtcp_pad_name);
g_free (rtcp_pad_name);
sink =
kms_i_rtp_session_manager_request_rtcp_sink (self->manager, self, mconf);
kms_base_rtp_session_link_pads (src, sink);
g_object_unref (src);
g_object_unref (sink);
end:
KMS_SDP_SESSION_UNLOCK (self);
}
示例10: bus_call
static gboolean
bus_call(GstBus *bus,
GstMessage *msg,
gpointer data)
{
GMainLoop *loop = (GMainLoop *)data;
GstState old_state, new_state;
switch (GST_MESSAGE_TYPE(msg)) {
case GST_MESSAGE_STATE_CHANGED:
gst_message_parse_state_changed (msg, &old_state, &new_state, NULL);
if(msg->src == GST_OBJECT(app.pipeline) && new_state == GST_STATE_READY && old_state == GST_STATE_NULL) {
g_debug ("Element %s changed state from %s to %s.\n",
GST_OBJECT_NAME (msg->src),
gst_element_state_get_name (old_state),
gst_element_state_get_name (new_state));
if(app.ready_callback) {
app.ready_callback();
}
}
break;
case GST_MESSAGE_EOS:
g_warning("End of stream\n");
g_main_loop_quit(loop);
break;
case GST_MESSAGE_ERROR: {
gchar *debug;
GError *error;
gst_message_parse_error(msg, &error, &debug);
// g_free(debug);
g_printerr("Error: %s\n", error->message);
g_printerr("Debug: %s\n", debug);
g_error_free(error);
g_main_loop_quit(loop);
break;
}
default:
break;
}
return TRUE;
}
示例11: error_cb
void error_cb(GstBus *bus, GstMessage *msg, CustomData *data)
{
GError *err;
gchar *debug_info;
gchar *message_string;
gst_message_parse_error(msg, &err, &debug_info);
GPlayerDEBUG("ERROR from element %s: %s\n", GST_OBJECT_NAME(msg->src), err->message);
GPlayerDEBUG("Debugging info: %s\n", (debug_info) ? debug_info : "none");
if (strcasestr(err->message, "not") != NULL && strcasestr(err->message, "found") != NULL)
{
gplayer_error(NOT_FOUND, data);
data->target_state = GST_STATE_NULL;
data->is_live = (gst_element_set_state(data->pipeline, data->target_state) == GST_STATE_CHANGE_NO_PREROLL);
}
else if ((strstr(err->message, "missing") != NULL && strstr(err->message, "plug-in") != NULL)
|| (strstr(err->message, "No URI handler implemented for") != NULL))
{
gplayer_error(NOT_SUPPORTED, data);
data->target_state = GST_STATE_NULL;
data->is_live = (gst_element_set_state(data->pipeline, data->target_state) == GST_STATE_CHANGE_NO_PREROLL);
}
else if (strstr(err->message, "type") != NULL && strstr(err->message, "stream") != NULL)
{
gplayer_error(UNKNOWN_ERROR, data);
data->target_state = GST_STATE_NULL;
data->is_live = (gst_element_set_state(data->pipeline, data->target_state) == GST_STATE_CHANGE_NO_PREROLL);
}
else if (strstr(err->message, "Stream") != NULL && strstr(err->message, "enough") != NULL)
{
if (!data->flow_error)
{
gplayer_error(UNKNOWN_ERROR, data);
data->target_state = GST_STATE_PAUSED;
data->is_live = (gst_element_set_state(data->pipeline, data->target_state) == GST_STATE_CHANGE_NO_PREROLL);
}
}
else if (strstr(err->message, "Internal") != NULL && strstr(err->message, "flow") != NULL)
{
data->flow_error = TRUE;
}
g_error_free(err);
g_free(debug_info);
}
示例12: gst_ss_demux_stream_init
static void
gst_ss_demux_stream_init (GstSSDemux *demux, GstSSDemuxStream *stream, SS_STREAM_TYPE stream_type)
{
stream->cond = g_cond_new ();
stream->lock = g_mutex_new ();
stream->queue = g_queue_new ();
stream->parent = demux;
stream->pipe = NULL;
stream->urisrc = NULL;
stream->parser = NULL;
stream->sink = NULL;
stream->frag_cnt = 0;
stream->type = stream_type ;
stream->uri = NULL;
stream->start_ts = -1;
stream->sent_ns = FALSE;
stream->switch_ts = GST_CLOCK_TIME_NONE;
stream->avg_dur = GST_CLOCK_TIME_NONE;
if (stream->type == SS_STREAM_VIDEO) {
stream->pad = gst_pad_new_from_static_template (&ssdemux_videosrc_template, "video");
stream->name = g_strdup("video");
} else if (stream->type == SS_STREAM_AUDIO) {
stream->pad = gst_pad_new_from_static_template (&ssdemux_audiosrc_template, "audio");
stream->name = g_strdup("audio");
} else if (stream->type == SS_STREAM_TEXT) {
stream->pad = gst_pad_new_from_static_template (&ssdemux_subsrc_template, "subtitle");
stream->name = g_strdup("text");
}
GST_PAD_ELEMENT_PRIVATE (stream->pad) = stream;
gst_pad_use_fixed_caps (stream->pad);
gst_pad_set_event_function (stream->pad, gst_ss_demux_handle_src_event);
gst_pad_set_query_function (stream->pad, gst_ss_demux_handle_src_query);
stream->caps = ssm_parse_get_stream_caps (demux->parser, stream->type);
g_print ("prepare video caps = %s", gst_caps_to_string(stream->caps));
GST_DEBUG_OBJECT (demux, "setting caps %" GST_PTR_FORMAT, stream->caps);
gst_pad_set_caps (stream->pad, stream->caps);
GST_DEBUG_OBJECT (demux, "adding pad %s %p to demux %p", GST_OBJECT_NAME (stream->pad), stream->pad, demux);
gst_pad_set_active (stream->pad, TRUE);
gst_element_add_pad (GST_ELEMENT_CAST (demux), stream->pad);
}
示例13: gst_pipeline_use_clock
/**
* gst_pipeline_use_clock:
* @pipeline: a [GstPipeline]()
* @clock: (transfer none) (allow-none): the clock to use
*
* Force _pipeline_ to use the given _clock_. The pipeline will
* always use the given clock even if new clock providers are added
* to this pipeline.
*
* If _clock_ is [NULL]() all clocking will be disabled which will make
* the pipeline run as fast as possible.
*
* MT safe.
*/
void
gst_pipeline_use_clock (GstPipeline * pipeline, GstClock * clock)
{
GstClock **clock_p;
g_return_if_fail (GST_IS_PIPELINE (pipeline));
GST_OBJECT_LOCK (pipeline);
GST_OBJECT_FLAG_SET (pipeline, GST_PIPELINE_FLAG_FIXED_CLOCK);
clock_p = &pipeline->fixed_clock;
gst_object_replace ((GstObject **) clock_p, (GstObject *) clock);
GST_OBJECT_UNLOCK (pipeline);
GST_CAT_DEBUG (GST_CAT_CLOCK, "pipeline using fixed clock %p (%s)", clock,
(clock ? GST_OBJECT_NAME (clock) : "nil"));
}
示例14: gss_program_add_stream_table
void
gss_program_add_stream_table (GssProgram * program, GString * s)
{
GList *g;
gboolean have_hls = FALSE;
GSS_A ("<table class='table table-striped table-bordered "
"table-condensed'>\n");
GSS_A ("<thead>\n");
GSS_A ("<tr>\n");
GSS_A ("<th>Type</th>\n");
GSS_A ("<th>Size</th>\n");
GSS_A ("<th>Bitrate</th>\n");
GSS_A ("</tr>\n");
GSS_A ("</thead>\n");
GSS_A ("<tbody>\n");
for (g = program->streams; g; g = g_list_next (g)) {
GssStream *stream = g->data;
GSS_A ("<tr>\n");
GSS_P ("<td>%s</td>\n", gss_stream_type_get_name (stream->type));
GSS_P ("<td>%dx%d</td>\n", stream->width, stream->height);
GSS_P ("<td>%d kbps</td>\n", stream->bitrate / 1000);
GSS_P ("<td><a href=\"%s\">stream</a></td>\n", stream->location);
GSS_P ("<td><a href=\"%s\">playlist</a></td>\n", stream->playlist_location);
GSS_A ("</tr>\n");
if (stream->type == GSS_STREAM_TYPE_M2TS_H264BASE_AAC ||
stream->type == GSS_STREAM_TYPE_M2TS_H264MAIN_AAC) {
have_hls = TRUE;
}
}
if (have_hls) {
GSS_A ("<tr>\n");
GSS_P ("<td colspan='7'><a href='/%s.m3u8'>HLS</a></td>\n",
GST_OBJECT_NAME (program));
GSS_A ("</tr>\n");
}
GSS_A ("<tr>\n");
GSS_P ("<td colspan='7'><a class='btn btn-mini' href='/'>"
"<i class='icon-plus'></i>Add</a></td>\n");
GSS_A ("</tr>\n");
GSS_A ("</tbody>\n");
GSS_A ("</table>\n");
}
示例15: gst_task_pool_need_schedule_thread
gboolean
gst_task_pool_need_schedule_thread (GstTaskPool * pool, gboolean needed)
{
gboolean ret;
g_return_val_if_fail (GST_IS_TASK_POOL (pool), FALSE);
g_return_val_if_fail (needed || pool->priv->need_schedule_thread > 0, FALSE);
/* We don't allow this for the default pool */
if (pool == gst_task_pool_get_default ()) {
gst_object_unref (pool);
return FALSE;
}
g_mutex_lock (&pool->priv->schedule_lock);
if (needed) {
ret = TRUE;
if (pool->priv->need_schedule_thread == 0) {
pool->priv->schedule_context = g_main_context_new ();
pool->priv->schedule_loop =
g_main_loop_new (pool->priv->schedule_context, FALSE);
pool->priv->schedule_thread =
g_thread_new (GST_OBJECT_NAME (pool), gst_task_pool_schedule_func,
pool);
g_cond_wait (&pool->priv->schedule_cond, &pool->priv->schedule_lock);
}
pool->priv->need_schedule_thread++;
} else {
ret = FALSE;
pool->priv->need_schedule_thread--;
if (pool->priv->need_schedule_thread == 0) {
g_main_loop_quit (pool->priv->schedule_loop);
g_thread_join (pool->priv->schedule_thread);
g_main_loop_unref (pool->priv->schedule_loop);
pool->priv->schedule_loop = NULL;
g_main_context_unref (pool->priv->schedule_context);
pool->priv->schedule_context = NULL;
pool->priv->schedule_thread = NULL;
}
}
g_mutex_unlock (&pool->priv->schedule_lock);
return ret;
}