gstreamer根据GstDebugCategory设置打印等级

/**
 * gst_debug_set_threshold_from_string:
 * @list: comma-separated list of "category:level" pairs to be used
 *     as debug logging levels
 * @reset: %TRUE to clear all previously-set debug levels before setting
 *     new thresholds
 * %FALSE if adding the threshold described by @list to the one already set.
 *
 * Sets the debug logging wanted in the same form as with the GST_DEBUG
 * environment variable. You can use wildcards such as '*', but note that
 * the order matters when you use wild cards, e.g. "foosrc:6,*src:3,*:2" sets
 * everything to log level 2.
 *
 * Since: 1.2
 */
void
gst_debug_set_threshold_from_string (const gchar * list, gboolean reset)
{
  gchar **split;
  gchar **walk;

  g_assert (list);

  if (reset)
    gst_debug_set_default_threshold (GST_LEVEL_DEFAULT);

  split = g_strsplit (list, ",", 0);

  for (walk = split; *walk; walk++) {
    if (strchr (*walk, ':')) {
      gchar **values = g_strsplit (*walk, ":", 2);

      if (values[0] && values[1]) {
        GstDebugLevel level;
        const gchar *category;

        if (parse_debug_category (values[0], &category)
            && parse_debug_level (values[1], &level)) {
          gst_debug_set_threshold_for_name (category, level);

          /* bump min-level anyway to allow the category to be registered in the
           * future still */
          if (level > _gst_debug_min) {
            _gst_debug_min = level;
          }
        }
      }

      g_strfreev (values);
    } else {
      GstDebugLevel level;

      if (parse_debug_level (*walk, &level))
        gst_debug_set_default_threshold (level);
    }
  }

  g_strfreev (split);
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值