Beispiel #1
0
WarningMessagePtr WarningMessage::create(const ObjectPtr & source,
                                         const QGlib::Error & error, const char *debug)
{
    //stupid GstMessage api takes non-const GError while it should
    GError *e = const_cast<GError*>(static_cast<const GError*>(error));
    return WarningMessagePtr::wrap(gst_message_new_warning(source, e, debug), false);
}
Beispiel #2
0
static void
test_bt_log_message_warning (BT_TEST_ARGS)
{
  BT_TEST_START;
  GST_INFO ("-- arrange --");
  GstObject *src = (GstObject *) gst_element_factory_make ("fakesrc", NULL);
  GError *error = g_error_new (GST_CORE_ERROR, GST_CORE_ERROR_FAILED,
      "description");
  GstMessage *msg = gst_message_new_warning (src, error, "debug");
  gchar *message, *description;

  GST_INFO ("-- act --");
  gboolean res = bt_gst_log_message_warning (GST_CAT_DEFAULT, __FILE__, "",
      __LINE__, msg, &message, &description);

  GST_INFO ("-- assert --");
  fail_unless (res, NULL);
  fail_unless (description != NULL, NULL);
  ck_assert_str_eq (message, "description");

  GST_INFO ("-- cleanup --");
  g_free (message);
  g_free (description);
  gst_message_unref (msg);
  gst_object_unref (src);
  BT_TEST_END;
}
Beispiel #3
0
static VALUE
warning_initialize(VALUE self, VALUE src, VALUE error, VALUE debug)
{
    G_INITIALIZE(self, gst_message_new_warning(RVAL2GST_OBJ(src),
                                               RVAL2GERROR(error), /* FIXME */
                                               RVAL2CSTR(debug)));
    return Qnil;
}