您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GST_ELEMENT_NAME函数代码示例

51自学网 2021-06-01 20:56:23
  C++
这篇教程C++ GST_ELEMENT_NAME函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中GST_ELEMENT_NAME函数的典型用法代码示例。如果您正苦于以下问题:C++ GST_ELEMENT_NAME函数的具体用法?C++ GST_ELEMENT_NAME怎么用?C++ GST_ELEMENT_NAME使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了GST_ELEMENT_NAME函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: gst_jack_audio_src_allocate_channels

static gbooleangst_jack_audio_src_allocate_channels (GstJackAudioSrc * src, gint channels){  jack_client_t *client;  client = gst_jack_audio_client_get_client (src->client);  /* remove ports we don't need */  while (src->port_count > channels)    jack_port_unregister (client, src->ports[--src->port_count]);  /* alloc enough input ports */  src->ports = g_realloc (src->ports, sizeof (jack_port_t *) * channels);  src->buffers = g_realloc (src->buffers, sizeof (sample_t *) * channels);  /* create an input port for each channel */  while (src->port_count < channels) {    gchar *name;    /* port names start from 1 and are local to the element */    name =        g_strdup_printf ("in_%s_%d", GST_ELEMENT_NAME (src),        src->port_count + 1);    src->ports[src->port_count] =        jack_port_register (client, name, JACK_DEFAULT_AUDIO_TYPE,        JackPortIsInput, 0);    if (src->ports[src->port_count] == NULL)      return FALSE;    src->port_count++;    g_free (name);  }  return TRUE;}
开发者ID:matsu,项目名称:gst-plugins-good,代码行数:35,


示例2: handle_state_change_message

MbEvent *handle_state_change_message (GstMessage *message){  MbEvent *mb_event = NULL;  GstState old_state, new_state;  GstElement *source = (GstElement *) message->src;  gst_message_parse_state_changed (message, &old_state, &new_state, NULL);  if (new_state == GST_STATE_PLAYING)  {    if (source == _mb_global_data.pipeline)    {      g_mutex_lock (&(_mb_global_data.mutex));      if (_mb_global_data.initialized == FALSE)      {        if (_mb_global_data.clock_provider == NULL)          _mb_global_data.clock_provider =             gst_element_get_clock(_mb_global_data.pipeline);        _mb_global_data.initialized = TRUE;        mb_event = create_app_event (MB_APP_INIT_DONE);      }      g_mutex_unlock (&(_mb_global_data.mutex));    }    else    {      if (strcmp (G_OBJECT_TYPE_NAME(G_OBJECT (source)), "GstBin") == 0)        mb_event = create_state_change_event (MB_BEGIN,            GST_ELEMENT_NAME (source));    }  }  return mb_event;}
开发者ID:rodrimc,项目名称:libmicromb,代码行数:34,


示例3: register_http_end_points

static voidregister_http_end_points (gint n){  const gchar *url;  gint i;  for (i = 0; i < n; i++) {    GstElement *httpep = gst_element_factory_make ("httpendpoint", NULL);    BOOST_CHECK ( httpep != NULL );    GST_DEBUG ("Registering %s", GST_ELEMENT_NAME (httpep) );    url = kms_http_ep_server_register_end_point (httpepserver, httpep,        COOKIE_LIFETIME, DISCONNECTION_TIMEOUT);    BOOST_CHECK (url != NULL);    if (url == NULL)      continue;    /* Leave the last reference to http end point server */    g_object_unref (G_OBJECT (httpep) );    GST_DEBUG ("Registered url: %s", url);    urls = g_slist_prepend (urls, (gpointer *) g_strdup (url) );  }  urls_registered = g_slist_length (urls);}
开发者ID:jcaden,项目名称:kurento-media-server,代码行数:28,


示例4: debug_graph

static gbooleandebug_graph (gpointer bin){  GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (bin),      GST_DEBUG_GRAPH_SHOW_ALL, GST_ELEMENT_NAME (bin));  return FALSE;}
开发者ID:2bees-rd,项目名称:kms-core,代码行数:7,


示例5: bus_sync_signal_handler

static GstBusSyncReplybus_sync_signal_handler (GstBus * bus, GstMessage * msg, gpointer data){  KmsRecorderEndpoint *self = KMS_RECORDER_ENDPOINT (data);  if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_ERROR) {    ErrorData *data;    GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (self),        GST_DEBUG_GRAPH_SHOW_ALL, GST_ELEMENT_NAME (self));    kms_base_media_muxer_dot_file (self->priv->mux);    GST_ERROR_OBJECT (self, "Message %" GST_PTR_FORMAT, msg);    data = create_error_data (self, msg);    GST_ERROR_OBJECT (self, "Error: %" GST_PTR_FORMAT, msg);    gst_task_pool_push (self->priv->pool, kms_recorder_endpoint_post_error,        data, NULL);  } else if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_EOS) {    gst_task_pool_push (self->priv->pool, kms_recorder_endpoint_on_eos_message,        self, NULL);  }  return GST_BUS_PASS;}
开发者ID:s-silva,项目名称:kms-elements,代码行数:26,


示例6: http_eos_cb

static voidhttp_eos_cb (GstElement * appsink, gpointer user_data){  GST_INFO ("EOS received on %s element. Stopping main loop",      GST_ELEMENT_NAME (httpep));  g_main_loop_quit (loop);}
开发者ID:chadsmith,项目名称:kms-elements,代码行数:7,


示例7: player_state_changed_cb

static voidplayer_state_changed_cb (GstElement * recorder, KmsUriEndpointState newState,    gpointer loop){  GST_INFO ("Element %s changed its state to %s.", GST_ELEMENT_NAME (recorder),      state2string (newState));}
开发者ID:KurentoLegacy,项目名称:gst-kurento-plugins,代码行数:7,


示例8: post_recv_sample

static GstFlowReturnpost_recv_sample (GstElement * appsink, gpointer user_data){  GstSample *sample = NULL;  GstFlowReturn ret;  GstBuffer *buffer;  g_signal_emit_by_name (appsink, "pull-sample", &sample);  if (sample == NULL)    return GST_FLOW_ERROR;  buffer = gst_sample_get_buffer (sample);  if (buffer == NULL) {    ret = GST_FLOW_OK;    goto end;  }  g_signal_emit_by_name (httpep, "push-buffer", buffer, &ret);  if (ret != GST_FLOW_OK) {    /* something wrong */    GST_ERROR ("Could not send buffer to httpep %s. Ret code %d",        GST_ELEMENT_NAME (httpep), ret);  }  g_object_get (G_OBJECT (httpep), "http-method", &method, NULL);  ck_assert_int_eq (method, KMS_HTTP_ENDPOINT_METHOD_POST);end:  if (sample != NULL)    gst_sample_unref (sample);  return ret;}
开发者ID:chadsmith,项目名称:kms-elements,代码行数:34,


示例9: __mm_player_streaming_set_buffer

void __mm_player_streaming_set_buffer(mm_player_streaming_t* streamer, GstElement * buffer,	gboolean use_buffering, guint buffer_size, gdouble low_percent, gdouble high_percent, gdouble buffering_time,	gboolean use_file, gchar * file_path, guint64 content_size){	debug_fenter();	return_if_fail(streamer);	if (buffer)	{		streamer->buffer = buffer;		debug_log("buffer element is %s.", GST_ELEMENT_NAME(buffer));		g_object_set ( G_OBJECT (streamer->buffer), "use-buffering", use_buffering, NULL );	}	streaming_set_buffer_size(streamer, buffer_size);	streaming_set_buffer_percent(streamer, low_percent, high_percent);	streaming_set_buffer_type (streamer, use_file, file_path, content_size);	streaming_set_buffering_time(streamer, buffering_time);	debug_fleave();	return;}
开发者ID:tizenorg,项目名称:framework.multimedia.libmm-player,代码行数:26,


示例10: on_demuxElementAdded

static voidon_demuxElementAdded (GstBin * demux, GstElement * element, gpointer user_data){  GstAdaptiveDemuxTestEnginePrivate *priv =      (GstAdaptiveDemuxTestEnginePrivate *) user_data;  GstAdaptiveDemuxTestOutputStream *stream = NULL;  GstPad *internal_pad;  gchar *srcbin_name;  gint i;  srcbin_name = GST_ELEMENT_NAME (element);  GST_TEST_LOCK (priv);  for (i = 0; i < priv->engine.output_streams->len; i++) {    stream = g_ptr_array_index (priv->engine.output_streams, i);    if (strstr (srcbin_name, GST_PAD_NAME (stream->pad)) != NULL)      break;  }  fail_unless (stream != NULL);  /* keep the reference to the internal_pad.   * We will need it to identify the stream in the on_demuxReceivesEvent callback   */  if (stream->internal_pad) {    gst_pad_remove_probe (stream->internal_pad, stream->internal_pad_probe);    gst_object_unref (stream->internal_pad);  }  internal_pad = gst_element_get_static_pad (element, "src");  stream->internal_pad_probe =      gst_pad_add_probe (internal_pad, GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM,      (GstPadProbeCallback) on_demuxReceivesEvent, priv, NULL);  stream->internal_pad = internal_pad;  GST_TEST_UNLOCK (priv);}
开发者ID:GrokImageCompression,项目名称:gst-plugins-bad,代码行数:34,


示例11: gst_element_get_static_pad

void GstPlayer::handleAddedPad(GstElement * upstream, GstPad * upstreamNewPad, GstElement * downstream) {  GstPad *downstreamPad = gst_element_get_static_pad ( downstream, "sink");  GstPadLinkReturn result;  GstCaps * newPadCaps = NULL;  GstStructure * newPadStruct = NULL;  const gchar * newPadType = NULL;  QLOG_TRACE() << "Got pad " << GST_PAD_NAME (upstreamNewPad) << " from " << GST_ELEMENT_NAME (upstream);  if (gst_pad_is_linked (downstreamPad)) {      QLOG_TRACE() << " Pad already connected to downstream.";  }else{      newPadCaps = gst_pad_get_caps (upstreamNewPad);      newPadStruct = gst_caps_get_structure (newPadCaps, 0);      newPadType = gst_structure_get_name (newPadStruct);      if (!g_str_has_prefix (newPadType, "audio/x-raw")) {          QLOG_TRACE() << "Pad is not of type is not raw audio but of type "<< newPadType <<". Can't connect.";      }else{          result = gst_pad_link (upstreamNewPad, downstreamPad);          if (GST_PAD_LINK_FAILED (result)) {              QLOG_TRACE() << "Failed to link.";          } else {              QLOG_TRACE() << "Link successful.";          }      }    }  if (newPadCaps != NULL)    gst_caps_unref (newPadCaps);  gst_object_unref (downstreamPad);}
开发者ID:jbruggem,项目名称:jingles-impro,代码行数:33,


示例12: bus_handler

static gbooleanbus_handler (GstBus * bus, GstMessage * message, gpointer data){  GMainLoop *loop = (GMainLoop *) data;  switch (message->type) {    case GST_MESSAGE_EOS:{      GST_LOG ("EOS event received");      g_main_loop_quit (loop);      break;    }    case GST_MESSAGE_ERROR:{      GError *gerror;      gchar *debug;      gst_message_parse_error (message, &gerror, &debug);      g_error ("Error from %s: %s (%s)/n",          GST_ELEMENT_NAME (GST_MESSAGE_SRC (message)), gerror->message,          GST_STR_NULL (debug));      g_error_free (gerror);      g_free (debug);      g_main_loop_quit (loop);      break;    }    case GST_MESSAGE_WARNING:{      g_main_loop_quit (loop);      break;    }    default:      break;  }  return TRUE;}
开发者ID:GrokImageCompression,项目名称:gst-plugins-good,代码行数:33,


示例13: kms_sdp_session_post_constructor

static voidkms_sdp_session_post_constructor (KmsSdpSession * self, KmsBaseSdpEndpoint * ep,    guint id){  self->id = id;  self->id_str = g_strdup_printf ("%s-sess%d", GST_ELEMENT_NAME (ep), id);  self->ep = ep;}
开发者ID:theravengod,项目名称:kms-core,代码行数:8,


示例14: appsink_eos_cb

static voidappsink_eos_cb (GstElement * appsink, gpointer user_data){  GstFlowReturn ret;  GST_INFO ("EOS received on %s. Preparing %s to finish the test",      GST_ELEMENT_NAME (appsink), GST_ELEMENT_NAME (test_pipeline));  g_signal_emit_by_name (httpep, "end-of-stream", &ret);  if (ret != GST_FLOW_OK) {    // something wrong    GST_ERROR ("Could not send EOS to %s. Ret code %d",        GST_ELEMENT_NAME (httpep), ret);    fail ("Can not send buffer to", GST_ELEMENT_NAME (httpep));  }}
开发者ID:chadsmith,项目名称:kms-elements,代码行数:17,


示例15: kms_muxing_pipeline_dot_file

voidkms_muxing_pipeline_dot_file (KmsMuxingPipeline * obj){  g_return_if_fail (obj != NULL);  GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (obj->priv->pipeline),      GST_DEBUG_GRAPH_SHOW_ALL, GST_ELEMENT_NAME (obj->priv->pipeline));}
开发者ID:chadsmith,项目名称:kms-elements,代码行数:8,


示例16: recorder_state_changed_cb

static voidrecorder_state_changed_cb (GstElement * recorder, KmsUriEndpointState newState,    gpointer loop){  GST_INFO ("Element %s changed its state to %s.", GST_ELEMENT_NAME (recorder),      state2string (newState));  if (newState == KMS_URI_ENDPOINT_STATE_STOP)    g_main_loop_quit (loop);}
开发者ID:KurentoLegacy,项目名称:gst-kurento-plugins,代码行数:9,


示例17: post_decodebin_pad_removed_handler

static voidpost_decodebin_pad_removed_handler (GstElement * decodebin, GstPad * pad,    KmsHttpEndpoint * self){  GstElement *appsink, *appsrc;  GstPad *sinkpad;  if (GST_PAD_IS_SINK (pad))    return;  GST_DEBUG ("pad %" GST_PTR_FORMAT " removed", pad);  appsink = g_object_steal_qdata (G_OBJECT (pad), appsink_data_quark ());  if (appsink == NULL) {    GST_ERROR ("No appsink was found associated with %" GST_PTR_FORMAT, pad);    return;  }  sinkpad = gst_element_get_static_pad (appsink, "sink");  appsrc = g_object_get_qdata (G_OBJECT (sinkpad), appsrc_data_quark ());  g_object_unref (sinkpad);  if (!gst_element_set_locked_state (appsink, TRUE))    GST_ERROR ("Could not block element %s", GST_ELEMENT_NAME (appsink));  GST_DEBUG ("Removing appsink %s from %s", GST_ELEMENT_NAME (appsink),      GST_ELEMENT_NAME (self->pipeline));  gst_element_set_state (appsink, GST_STATE_NULL);  gst_bin_remove (GST_BIN (self->pipeline), appsink);  if (appsrc == NULL) {    GST_ERROR ("No appsink was found associated with %" GST_PTR_FORMAT, pad);    return;  }  if (GST_OBJECT_PARENT (appsrc) != NULL) {    g_object_ref (appsrc);    gst_bin_remove (GST_BIN (GST_OBJECT_PARENT (appsrc)), appsrc);    gst_element_set_state (appsrc, GST_STATE_NULL);    g_object_unref (appsrc);  }}
开发者ID:kc7bfi,项目名称:kms-elements,代码行数:44,


示例18: nle_object_change_state

static GstStateChangeReturnnle_object_change_state (GstElement * element, GstStateChange transition){  GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;  switch (transition) {    case GST_STATE_CHANGE_NULL_TO_READY:    {      GstObject *parent = gst_object_get_parent (GST_OBJECT (element));      /* Going to READY and if we are not in a composition, we need to make       * sure that the object positioning state is properly commited  */      if (parent) {        if (g_strcmp0 (GST_ELEMENT_NAME (GST_ELEMENT (parent)), "current-bin")            && !NLE_OBJECT_IS_COMPOSITION (NLE_OBJECT (element))) {          GST_INFO ("Adding nleobject to something that is not a composition,"              " commiting ourself");          nle_object_commit (NLE_OBJECT (element), FALSE);        }        gst_object_unref (parent);      }    }      break;    case GST_STATE_CHANGE_READY_TO_PAUSED:      if (nle_object_prepare (NLE_OBJECT (element)) == GST_STATE_CHANGE_FAILURE) {        ret = GST_STATE_CHANGE_FAILURE;        goto beach;      }      break;    default:      break;  }  GST_DEBUG_OBJECT (element, "Calling parent change_state");  ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);  GST_DEBUG_OBJECT (element, "Return from parent change_state was %d", ret);  if (ret == GST_STATE_CHANGE_FAILURE)    goto beach;  switch (transition) {    case GST_STATE_CHANGE_PAUSED_TO_READY:      /* cleanup nleobject */      if (nle_object_cleanup (NLE_OBJECT (element)) == GST_STATE_CHANGE_FAILURE)        ret = GST_STATE_CHANGE_FAILURE;      break;    default:      break;  }beach:  return ret;}
开发者ID:sgielen,项目名称:gst-editing-services,代码行数:56,


示例19: g_print

void GstShow::newPad(GstElement *src,                       GstPad     *new_pad,                       gpointer    data){    GstPad *sink_pad;    GstElement *color = (GstElement *) data;    GstPadLinkReturn ret;    GstCaps *new_pad_caps = NULL;    GstStructure *new_pad_struct = NULL;    const gchar *new_pad_type = NULL;        g_print ("Received new pad '%s' from '%s':/n", GST_PAD_NAME (new_pad), GST_ELEMENT_NAME (src));                new_pad_caps = gst_pad_get_current_caps (new_pad);    new_pad_struct = gst_caps_get_structure (new_pad_caps, 0);    new_pad_type = gst_structure_get_name (new_pad_struct);        g_print ("  It has type '%s'./n", new_pad_type);        sink_pad = gst_element_get_static_pad (color, "sink");    if (!sink_pad){        L_(lerror) << "Gstreamer: no pad named sink";        return;    }    /* If our converter is already linked, we have nothing to do here */    if (gst_pad_is_linked (sink_pad)) {      g_print ("  We are already linked. Ignoring./n");      /* Unreference the new pad's caps, if we got them */      if (new_pad_caps != NULL)          gst_caps_unref (new_pad_caps);            /* Unreference the sink pad */      gst_object_unref (sink_pad);      return;    }        /* Attempt the link */    ret = gst_pad_link (new_pad, sink_pad);    if (GST_PAD_LINK_FAILED (ret)) {      g_print ("  Type is '%s' but link failed./n", new_pad_type);      /* Unreference the new pad's caps, if we got them */      if (new_pad_caps != NULL)          gst_caps_unref (new_pad_caps);            /* Unreference the sink pad */      gst_object_unref (sink_pad);      return;        } else {      g_print ("  Link succeeded (type '%s')./n", new_pad_type);    }}
开发者ID:bonfus,项目名称:GstMadness,代码行数:56,


示例20: bus_msg_cb

static voidbus_msg_cb (GstBus *bus, GstMessage *msg, gpointer pipeline){  switch (msg->type) {  case GST_MESSAGE_ERROR: {    GST_ERROR ("%s bus error: %" GST_PTR_FORMAT, GST_ELEMENT_NAME (pipeline),        msg);    BOOST_FAIL ("Error received on the bus");    break;  }  case GST_MESSAGE_WARNING: {    GST_WARNING ("%s bus: %" GST_PTR_FORMAT, GST_ELEMENT_NAME (pipeline),        msg);    break;  }  default:    break;  }}
开发者ID:jcaden,项目名称:kurento-media-server,代码行数:19,


示例21: gst_validate_monitor_get_element_name

const gchar *gst_validate_monitor_get_element_name (GstValidateMonitor * monitor){  GstElement *element;  element = gst_validate_monitor_get_element (monitor);  if (element)    return GST_ELEMENT_NAME (element);  return NULL;}
开发者ID:ensonic,项目名称:gst-devtools,代码行数:10,


示例22: vc_pad_added_handler

static void vc_pad_added_handler (GstElement *src,		GstPad *new_pad, vc_data *data) {	GstPad *sink_pad = gst_element_get_static_pad (data->gst_data.depayloader, "sink");	GstPadLinkReturn ret;	GstCaps *new_pad_caps = NULL;	GstStructure *new_pad_struct = NULL;	const gchar *new_pad_type = NULL;	g_print ("Received new pad '%s' from '%s':/n", GST_PAD_NAME (new_pad), GST_ELEMENT_NAME (src));	/* Check the new pad's name */	if (!g_str_has_prefix (GST_PAD_NAME (new_pad), "recv_rtp_src_")) {		g_print ("  It is not the right pad.  Need recv_rtp_src_. Ignoring./n");		goto exit;	}	/* If our converter is already linked, we have nothing to do here */	if (gst_pad_is_linked (sink_pad)) {		g_print (" Sink pad from %s already linked. Ignoring./n", GST_ELEMENT_NAME (src));		goto exit;	}	/* Check the new pad's type */	new_pad_caps = gst_pad_get_caps (new_pad);	new_pad_struct = gst_caps_get_structure (new_pad_caps, 0);	new_pad_type = gst_structure_get_name (new_pad_struct);	/* Attempt the link */	ret = gst_pad_link (new_pad, sink_pad);	if (GST_PAD_LINK_FAILED (ret)) {		g_print ("  Type is '%s' but link failed./n", new_pad_type);	} else {		g_print ("  Link succeeded (type '%s')./n", new_pad_type);	}exit:	/* Unreference the new pad's caps, if we got them */	if (new_pad_caps != NULL)		gst_caps_unref (new_pad_caps);	/* Unreference the sink pad */	gst_object_unref (sink_pad);}
开发者ID:Rock1965,项目名称:glive,代码行数:43,


示例23: disconnect_elements

static gbooleandisconnect_elements (GstElement * agnosticbin, GstElement * audiomixer){  gboolean done = FALSE, disconnected = FALSE;  GValue val = G_VALUE_INIT;  GstIterator *it;  it = gst_element_iterate_src_pads (agnosticbin);  do {    switch (gst_iterator_next (it, &val)) {      case GST_ITERATOR_OK:      {        GstPad *srcpad, *sinkpad;        GstElement *mixer;        srcpad = g_value_get_object (&val);        sinkpad = gst_pad_get_peer (srcpad);        mixer = gst_pad_get_parent_element (sinkpad);        if (mixer == audiomixer) {          GST_DEBUG ("Unlink %" GST_PTR_FORMAT " and %" GST_PTR_FORMAT,              agnosticbin, mixer);          if (!gst_pad_unlink (srcpad, sinkpad)) {            GST_ERROR ("Can not unlink %" GST_PTR_FORMAT " and %"                GST_PTR_FORMAT, srcpad, sinkpad);          }          gst_element_release_request_pad (mixer, sinkpad);          gst_element_release_request_pad (agnosticbin, srcpad);          disconnected |= TRUE;        }        gst_object_unref (sinkpad);        gst_object_unref (mixer);        g_value_reset (&val);        break;      }      case GST_ITERATOR_RESYNC:        gst_iterator_resync (it);        break;      case GST_ITERATOR_ERROR:        GST_ERROR ("Error iterating over %s's src pads",            GST_ELEMENT_NAME (agnosticbin));      case GST_ITERATOR_DONE:        g_value_unset (&val);        done = TRUE;        break;    }  } while (!done);  gst_iterator_free (it);  return disconnected;}
开发者ID:TribeMedia,项目名称:kms-elements,代码行数:55,


示例24: pad_added_handler

/* This function will be called by the pad-added signal */static void pad_added_handler(GstElement *src, GstPad *new_pad,                              CustomData *data){    GstPad *sink_pad = NULL;    GstPadLinkReturn ret;    GstCaps *new_pad_caps = NULL;    GstStructure *new_pad_struct = NULL;    const gchar *new_pad_type = NULL;    g_print("Received new pad '%s' from '%s':/n", GST_PAD_NAME(new_pad),            GST_ELEMENT_NAME(src));    /* Check the new pad's type */    new_pad_caps = gst_pad_get_caps(new_pad);    new_pad_struct = gst_caps_get_structure(new_pad_caps, 0);    new_pad_type = gst_structure_get_name(new_pad_struct);    if (g_str_has_prefix(new_pad_type, "video/x-raw")) {        sink_pad = gst_element_get_static_pad(data->vsink, "sink");        if (gst_pad_is_linked(sink_pad)) {            g_print("  We are already linked. Ignoring./n");            goto exit;        }    }    if (g_str_has_prefix(new_pad_type, "audio/x-raw")) {        sink_pad = gst_element_get_static_pad(data->convert, "sink");        if (gst_pad_is_linked(sink_pad)) {            g_print("  We are already linked. Ignoring./n");            goto exit;        }    }    /* Attempt the link */    ret = gst_pad_link(new_pad, sink_pad);    if (GST_PAD_LINK_FAILED(ret)) {        g_print("  Type is '%s' but link failed./n", new_pad_type);    }    else {        g_print("  Link succeeded (type '%s')./n", new_pad_type);    }exit:    /* Unreference the new pad's caps, if we got them */    if (new_pad_caps != NULL)        gst_caps_unref(new_pad_caps);    /* Unreference the sink pad */    if (sink_pad != NULL)        gst_object_unref(sink_pad);}
开发者ID:wespelee,项目名称:gstreamer-test,代码行数:55,


示例25: uridecodebin_element_added_cb

static voiduridecodebin_element_added_cb (GstElement * uridecodebin,    GstElement * child, GstDiscoverer * dc){  GST_DEBUG ("New element added to uridecodebin : %s",      GST_ELEMENT_NAME (child));  if (G_OBJECT_TYPE (child) == dc->priv->decodebin2_type) {    g_object_set (child, "post-stream-topology", TRUE, NULL);  }}
开发者ID:166MMX,项目名称:openjdk.java.net-openjfx-8u40-rt,代码行数:11,


示例26: setup_output_pad

/* Create and link output pad: selector:src%d ! output_pad */static GstPad *setup_output_pad (GstElement * element, GstStaticPadTemplate * tmpl){  GstPad *srcpad = NULL, *output_pad = NULL;  gulong probe_id = 0;  if (tmpl == NULL)    tmpl = &sinktemplate;  /* create output_pad */  output_pad = gst_pad_new_from_static_template (tmpl, "sink");  fail_if (output_pad == NULL, "Could not create a output_pad");  /* add probe */  probe_id =      gst_pad_add_probe (output_pad, GST_PAD_PROBE_TYPE_DATA_BOTH,      (GstPadProbeCallback) probe_cb, NULL, NULL);  g_object_set_data (G_OBJECT (output_pad), "probe_id",      GINT_TO_POINTER (probe_id));  /* request src pad */  srcpad = gst_element_get_request_pad (element, "src_%u");  fail_if (srcpad == NULL, "Could not get source pad from %s",      GST_ELEMENT_NAME (element));  /* link pads and activate */  fail_unless (gst_pad_link (srcpad, output_pad) == GST_PAD_LINK_OK,      "Could not link %s source and output pad", GST_ELEMENT_NAME (element));  gst_pad_set_active (output_pad, TRUE);  GST_DEBUG_OBJECT (output_pad, "set up %" GST_PTR_FORMAT " ! %" GST_PTR_FORMAT,      srcpad, output_pad);  gst_object_unref (srcpad);  ASSERT_OBJECT_REFCOUNT (srcpad, "srcpad", 1);  return output_pad;}
开发者ID:BigBrother-International,项目名称:gstreamer,代码行数:40,


示例27: find_input_selector

static intfind_input_selector (GValue * value, void *userdata){  GstElement *element = g_value_get_object (value);  g_assert (GST_IS_ELEMENT (element));  if (g_str_has_prefix (GST_ELEMENT_NAME (element), "inputselector")) {    guint npads;    g_object_get (element, "n-pads", &npads, NULL);    if (npads > 1)      return 0;  }  return !0;}
开发者ID:GStreamer,项目名称:gst-devtools,代码行数:13,


示例28: gst_uri_downloader_stop

/* Must be called with mutex locked. */static voidgst_uri_downloader_stop (GstUriDownloader * downloader){  GstPad *pad;  GstElement *urisrc;  if (!downloader->priv->urisrc)    return;  GST_DEBUG_OBJECT (downloader, "Stopping source element %s",      GST_ELEMENT_NAME (downloader->priv->urisrc));  /* remove the bus' sync handler */  gst_bus_set_sync_handler (downloader->priv->bus, NULL, NULL, NULL);  /* unlink the source element from the internal pad */  pad = gst_pad_get_peer (downloader->priv->pad);  if (pad) {    gst_pad_unlink (pad, downloader->priv->pad);    gst_object_unref (pad);  }  urisrc = downloader->priv->urisrc;  downloader->priv->urisrc = NULL;  /* unlock so it doesn't block on chain function while changing state */  g_mutex_unlock (&downloader->priv->lock);  GST_DEBUG_OBJECT (downloader, "Stopping source element %s",      GST_ELEMENT_NAME (urisrc));  /* set the element state to NULL */  gst_element_set_state (urisrc, GST_STATE_NULL);  gst_element_get_state (urisrc, NULL, NULL, GST_CLOCK_TIME_NONE);  gst_element_set_bus (urisrc, NULL);  gst_object_unref (urisrc);  /* caller expects the mutex to be locked */  g_mutex_lock (&downloader->priv->lock);  gst_bus_set_flushing (downloader->priv->bus, TRUE);}
开发者ID:cbetz421,项目名称:gst-plugins-bad,代码行数:40,


示例29: bus_sync_signal_handler

static GstBusSyncReplybus_sync_signal_handler (GstBus * bus, GstMessage * msg, gpointer data){  KmsRecorderEndpoint *self = KMS_RECORDER_ENDPOINT (data);  if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_ERROR) {    ErrorData *data;    GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (self),        GST_DEBUG_GRAPH_SHOW_ALL, GST_ELEMENT_NAME (self));    kms_base_media_muxer_dot_file (self->priv->mux);    GST_ERROR_OBJECT (self, "Message %" GST_PTR_FORMAT, msg);    data = create_error_data (self, msg);    GST_ERROR_OBJECT (self, "Error: %" GST_PTR_FORMAT, msg);    gst_task_pool_push (self->priv->pool, kms_recorder_endpoint_post_error,        data, NULL);  } else if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_EOS) {    gst_task_pool_push (self->priv->pool, kms_recorder_endpoint_on_eos_message,        self, NULL);  } else if ((GST_MESSAGE_TYPE (msg) == GST_MESSAGE_STATE_CHANGED)      && (GST_OBJECT_CAST (KMS_BASE_MEDIA_MUXER_GET_PIPELINE (self->                  priv->mux)) == GST_MESSAGE_SRC (msg))) {    GstState new_state, pending;    gst_message_parse_state_changed (msg, NULL, &new_state, &pending);    if (pending == GST_STATE_VOID_PENDING || (pending == GST_STATE_NULL            && new_state == GST_STATE_READY)) {      GST_DEBUG_OBJECT (self, "Pipeline changed state to %d", new_state);      switch (new_state) {        case GST_STATE_PLAYING:          kms_recorder_endpoint_state_changed (self,              KMS_URI_ENDPOINT_STATE_START);          break;        case GST_STATE_READY:          kms_recorder_endpoint_state_changed (self,              KMS_URI_ENDPOINT_STATE_STOP);          break;        default:          GST_DEBUG_OBJECT (self, "Not raising event");          break;      }    }  }  return GST_BUS_PASS;}
开发者ID:linuxs,项目名称:kms-elements,代码行数:51,


示例30: get_encoder

static GstElement *get_encoder (const GstCaps * caps, GError ** err){  GList *encoders = NULL;  GList *filtered = NULL;  GstElementFactory *factory = NULL;  GstElement *encoder = NULL;  encoders =      gst_element_factory_list_get_elements (GST_ELEMENT_FACTORY_TYPE_ENCODER |      GST_ELEMENT_FACTORY_TYPE_MEDIA_IMAGE, GST_RANK_NONE);  if (encoders == NULL) {    *err = g_error_new (GST_CORE_ERROR, GST_CORE_ERROR_MISSING_PLUGIN,        "Cannot find any image encoder");    goto fail;  }  GST_INFO ("got factory list %p", encoders);  gst_plugin_feature_list_debug (encoders);  filtered =      gst_element_factory_list_filter (encoders, caps, GST_PAD_SRC, FALSE);  GST_INFO ("got filtered list %p", filtered);  if (filtered == NULL) {    gchar *tmp = gst_caps_to_string (caps);    *err = g_error_new (GST_CORE_ERROR, GST_CORE_ERROR_MISSING_PLUGIN,        "Cannot find any image encoder for caps %s", tmp);    g_free (tmp);    goto fail;  }  gst_plugin_feature_list_debug (filtered);  factory = (GstElementFactory *) filtered->data;  GST_INFO ("got factory %p", factory);  encoder = gst_element_factory_create (factory, NULL);  GST_INFO ("created encoder element %p, %s", encoder,      GST_ELEMENT_NAME (encoder));fail:  if (encoders)    gst_plugin_feature_list_free (encoders);  if (filtered)    gst_plugin_feature_list_free (filtered);  return encoder;}
开发者ID:thiblahute,项目名称:gst-plugins-base,代码行数:51,



注:本文中的GST_ELEMENT_NAME函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ GST_ELEMENT_WARNING函数代码示例
C++ GST_ELEMENT_GET_CLASS函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。