• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GST_ELEMENT_NAME函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: gst_jack_audio_src_allocate_channels

static gboolean
gst_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,代码来源:gstjackaudiosrc.c


示例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,代码来源:util.c


示例3: register_http_end_points

static void
register_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,代码来源:http_ep_server_test.cpp


示例4: debug_graph

static gboolean
debug_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,代码来源:kmsutils.c


示例5: bus_sync_signal_handler

static GstBusSyncReply
bus_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,代码来源:kmsrecorderendpoint.c


示例6: http_eos_cb

static void
http_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,代码来源:httpendpoint.c


示例7: player_state_changed_cb

static void
player_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,代码来源:playerendpoint.c


示例8: post_recv_sample

static GstFlowReturn
post_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,代码来源:httpendpoint.c


示例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,代码来源:mm_player_streaming.c


示例10: on_demuxElementAdded

static void
on_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,代码来源:adaptive_demux_engine.c


示例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,代码来源:gstplayer.cpp


示例12: bus_handler

static gboolean
bus_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,代码来源:videobox.c


示例13: kms_sdp_session_post_constructor

static void
kms_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,代码来源:kmssdpsession.c


示例14: appsink_eos_cb

static void
appsink_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,代码来源:httpendpoint.c


示例15: kms_muxing_pipeline_dot_file

void
kms_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,代码来源:kmsmuxingpipeline.c


示例16: recorder_state_changed_cb

static void
recorder_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,代码来源:playerendpoint.c


示例17: post_decodebin_pad_removed_handler

static void
post_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,代码来源:kmshttppostendpoint.c


示例18: nle_object_change_state

static GstStateChangeReturn
nle_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,代码来源:nleobject.c


示例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,代码来源:GstShow.cpp


示例20: bus_msg_cb

static void
bus_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,代码来源:http_ep_server_test.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GST_ELEMENT_WARNING函数代码示例发布时间:2022-05-30
下一篇:
C++ GST_ELEMENT_GET_CLASS函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap