コード例 #1
0
static void
gst_ffmpeg_log_callback(void* ptr, int level, const char* fmt, va_list vl) {
    GstDebugLevel gst_level;

    switch (level) {
    case AV_LOG_QUIET:
        gst_level = GST_LEVEL_NONE;
        break;

    case AV_LOG_ERROR:
        gst_level = GST_LEVEL_ERROR;
        break;

    case AV_LOG_INFO:
        gst_level = GST_LEVEL_INFO;
        break;

    case AV_LOG_DEBUG:
        gst_level = GST_LEVEL_DEBUG;
        break;

    default:
        gst_level = GST_LEVEL_INFO;
        break;
    }

    gst_debug_log_valist(ffmpegscale_debug, gst_level, "", "", 0, NULL, fmt, vl);
}
コード例 #2
0
static int
lv2_log_vprintf (LV2_Log_Handle handle, LV2_URID type,
    const char *fmt, va_list ap)
{
  gst_debug_log_valist (lv2_debug, GST_LEVEL_INFO, "", "", 0, NULL, fmt, ap);
  return 1;
}
コード例 #3
0
static int
lv2_log_printf (LV2_Log_Handle handle, LV2_URID type, const char *fmt, ...)
{
  va_list ap;

  va_start (ap, fmt);
  gst_debug_log_valist (lv2_debug, GST_LEVEL_INFO, "", "", 0, NULL, fmt, ap);
  va_end (ap);
  return 1;
}
コード例 #4
0
/* need this indirection so the compiler doesn't check the printf format
 * like it would if we used GST_INFO directly (it would complain) */
static void
call_GST_INFO (const gchar * format, ...)
{
  va_list var_args;

  va_start (var_args, format);
  gst_debug_log_valist (GST_CAT_DEFAULT, GST_LEVEL_INFO, __FILE__, GST_FUNCTION,
      __LINE__, NULL, format, var_args);
  va_end (var_args);
}
コード例 #5
0
static void
gst_cmml_parser_generic_error (void *ctx, const char *msg, ...)
{
#ifndef GST_DISABLE_GST_DEBUG
  va_list varargs;

  va_start (varargs, msg);
  gst_debug_log_valist (GST_CAT_DEFAULT, GST_LEVEL_WARNING,
      "", "", 0, NULL, msg, varargs);
  va_end (varargs);
#endif /* GST_DISABLE_GST_DEBUG */
}
コード例 #6
0
ファイル: log.c プロジェクト: EQ4/gst-dsp
void pr_helper(unsigned int level,
		void *object,
		const char *file,
		const char *function,
		unsigned int line,
		const char *fmt,
		...)
{
	char *tmp;
	va_list args;

	va_start(args, fmt);

	if (vasprintf(&tmp, fmt, args) < 0)
		goto leave;

	if (level <= 1) {
#ifdef SYSLOG
		if (object && GST_IS_OBJECT(object) && GST_OBJECT_NAME(object))
			syslog(log_level_to_syslog(level), "%s: %s", GST_OBJECT_NAME(object), tmp);
		else
			syslog(log_level_to_syslog(level), "%s", tmp);
#endif
		if (level == 0)
			g_printerr("%s: %s\n", function, tmp);
		else
			g_print("%s: %s\n", function, tmp);
	}
	else if (level == 2)
		g_print("%s:%s(%u): %s\n", file, function, line, tmp);
#if defined(DEVEL) || defined(DEBUG)
	else if (level == 3)
		g_print("%s: %s\n", function, tmp);
#endif
#ifdef DEBUG
	else if (level == 4)
		g_print("%s:%s(%u): %s\n", file, function, line, tmp);
#endif

#ifndef GST_DISABLE_GST_DEBUG
	gst_debug_log_valist(gstdsp_debug, log_level_to_gst(level), file, function, line, object, fmt, args);
#endif

	free(tmp);

leave:
	va_end(args);
}
コード例 #7
0
ファイル: gstjpegdec.c プロジェクト: an146/gst-plugins-good
static void
gst_jpeg_dec_set_error_va (GstJpegDec * dec, const gchar * func, gint line,
    const gchar * debug_msg_format, va_list args)
{
#ifndef GST_DISABLE_GST_DEBUG
  gst_debug_log_valist (GST_CAT_DEFAULT, GST_LEVEL_WARNING, __FILE__, func,
      line, (GObject *) dec, debug_msg_format, args);
#endif

  g_free (dec->error_msg);
  if (debug_msg_format)
    dec->error_msg = g_strdup_vprintf (debug_msg_format, args);
  else
    dec->error_msg = NULL;

  dec->error_line = line;
  dec->error_func = func;
}
コード例 #8
0
ファイル: device.c プロジェクト: Freescale/gstreamer-imx
static void imx_vpu_logging_func(ImxVpuLogLevel level, char const *file, int const line, char const *fn, const char *format, ...)
{
	GstDebugLevel gst_level;
	va_list args;

	switch (level)
	{
		case IMX_VPU_LOG_LEVEL_ERROR:   gst_level = GST_LEVEL_ERROR;   break;
		case IMX_VPU_LOG_LEVEL_WARNING: gst_level = GST_LEVEL_WARNING; break;
		case IMX_VPU_LOG_LEVEL_INFO:    gst_level = GST_LEVEL_INFO;    break;
		case IMX_VPU_LOG_LEVEL_DEBUG:   gst_level = GST_LEVEL_DEBUG;   break;
		case IMX_VPU_LOG_LEVEL_LOG:     gst_level = GST_LEVEL_LOG;     break;
		case IMX_VPU_LOG_LEVEL_TRACE:   gst_level = GST_LEVEL_TRACE;   break;
		default: gst_level = GST_LEVEL_LOG;
	}

	va_start(args, format);
	gst_debug_log_valist(imx_vpu_api_debug, gst_level, file, fn, line, NULL, format, args);
	va_end(args);
}
コード例 #9
0
ファイル: gstffmpeg.c プロジェクト: heiher/gst-ffmpeg
static void
gst_ffmpeg_log_callback (void *ptr, int level, const char *fmt, va_list vl)
{
  GstDebugLevel gst_level;
  gint len = strlen (fmt);
  gchar *fmt2 = NULL;

  if (_shut_up_I_am_probing)
    return;

  switch (level) {
    case AV_LOG_QUIET:
      gst_level = GST_LEVEL_NONE;
      break;
    case AV_LOG_ERROR:
      gst_level = GST_LEVEL_ERROR;
      break;
    case AV_LOG_INFO:
      gst_level = GST_LEVEL_INFO;
      break;
    case AV_LOG_DEBUG:
      gst_level = GST_LEVEL_DEBUG;
      break;
    default:
      gst_level = GST_LEVEL_INFO;
      break;
  }

  /* remove trailing newline as it gets already appended by the logger */
  if (fmt[len - 1] == '\n') {
    fmt2 = g_strdup (fmt);
    fmt2[len - 1] = '\0';
  }

  gst_debug_log_valist (ffmpeg_debug, gst_level, "", "", 0, NULL,
      fmt2 ? fmt2 : fmt, vl);

  g_free (fmt2);
}
コード例 #10
0
ファイル: gsttracerrecord.c プロジェクト: like0403/gstreamer
/**
 * gst_tracer_record_log:
 * @self: the tracer-record
 * @...: the args as described in the spec-
 *
 * Serialzes the trace event into the log.
 *
 * Right now this is using the gstreamer debug log with the level TRACE (7) and
 * the category "GST_TRACER".
 *
 * > Please note that this is still under discussion and subject to change.
 */
void
gst_tracer_record_log (GstTracerRecord * self, ...)
{
  va_list var_args;

  /*
   * does it make sense to use the {file, line, func} from the tracer hook?
   * a)
   * - we'd need to pass them in the macros to gst_tracer_dispatch()
   * - and each tracer needs to grab them from the va_list and pass them here
   * b)
   * - we create a context in dispatch, pass that to the tracer
   * - and the tracer will pass that here
   * ideally we also use *our* ts instead of the one that
   * gst_debug_log_default() will pick
   */

  va_start (var_args, self);
  if (G_LIKELY (GST_LEVEL_TRACE <= _gst_debug_min)) {
    gst_debug_log_valist (GST_CAT_DEFAULT, GST_LEVEL_TRACE, "", "", 0, NULL,
        self->format, var_args);
  }
  va_end (var_args);
}