Ошибка: QtCreator выдает ошибку на макрос GStreamer

Проблема:

Пытаюсь запустить 12-й пример с оф. сайта GStreamer на QtCreator, но столкнулся с ошибкой.

... C2440: 'type cast': cannot convert from 'overloaded-function' to 'GCallback' ... note: None of the functions with this name in scope match the target type

... C2660: 'g_signal_connect_data': function does not take 5 arguments ... note: see declaration of 'g_signal_connect_data'

Последняя ошибка спровоцирована первой. Не смог найти решение, надеюсь вы подскажите. Может я неправильно подключил сторонние файлы?

РЕАЛИЗАЦИЯ:

QtCreator с компилятором Desktop Qt5.15.2 MSVC 2019 64-bit;

Gstreamer 1.18.1 (с сайта скачал: gstreamer-1.0-msvc-x86_64-1.18.1 и gstreamer-1.0-devel-msvc-x86_64-1.18.1) установлена на диске "С", взял с одной рабочей open-source проги.

>>>>>>>>pro file

Не вижу смысла вставлять весь, ведь там много лишнего. Выставляю подключение файлов.

INCLUDEPATH += c:/gstreamer/1.0/msvc_x86_64/lib/glib-2.0/include \              #adding GST_.. param
           c:/gstreamer/1.0/msvc_x86_64/include/gstreamer-1.0 \
           c:/gstreamer/1.0/msvc_x86_64/include/glib-2.0                        #adding g_print,... comands
LIBS += -Lc:/gstreamer/1.0/msvc_x86_64/include/gstreamer-1.0
LIBS += -Lc:/gstreamer/1.0/msvc_x86_64/include/glib-2.0/gobject/gsignal.h       #g_signal_connect
LIBS += -Lc:/gstreamer/1.0/msvc_x86_64/include/glib-2.0/gobject/gclosure.h      #G_CALLBACK

>>>>>>>>Пример cpp файл

Код прямиком из сайта примеров, на деле у меня он разбит на несколько методов, что опять же не важно.

#include "mainwindow.h"
#include <gst/gst.h>
#include <string.h>

typedef struct _CustomData {
  gboolean is_live;
  GstElement *pipeline;
  GMainLoop *loop;
} CustomData;

static void cb_message (GstBus *bus, GstMessage *msg, CustomData *data) {

  switch (GST_MESSAGE_TYPE (msg)) {
    case GST_MESSAGE_ERROR: {
      GError *err;
      gchar *debug;

      gst_message_parse_error (msg, &err, &debug);
      g_print ("Error: %s\n", err->message);
      g_error_free (err);
      g_free (debug);

      gst_element_set_state (data->pipeline, GST_STATE_READY);
      g_main_loop_quit (data->loop);
      break;
    }
    case GST_MESSAGE_EOS:
      /* end-of-stream */
      gst_element_set_state (data->pipeline, GST_STATE_READY);
      g_main_loop_quit (data->loop);
      break;
    case GST_MESSAGE_BUFFERING: {
      gint percent = 0;

      /* If the stream is live, we do not care about buffering. */
      if (data->is_live) break;

      gst_message_parse_buffering (msg, &percent);
      g_print ("Buffering (%3d%%)\r", percent);
      /* Wait until buffering is complete before start/resume playing */
      if (percent < 100)
        gst_element_set_state (data->pipeline, GST_STATE_PAUSED);
      else
        gst_element_set_state (data->pipeline, GST_STATE_PLAYING);
      break;
    }
    case GST_MESSAGE_CLOCK_LOST:
      /* Get a new clock */
      gst_element_set_state (data->pipeline, GST_STATE_PAUSED);
      gst_element_set_state (data->pipeline, GST_STATE_PLAYING);
      break;
    default:
      /* Unhandled message */
      break;
    }
}

int main(int argc, char *argv[]) {
  GstElement *pipeline;
  GstBus *bus;
  GstStateChangeReturn ret;
  GMainLoop *main_loop;
  CustomData data;

  /* Initialize GStreamer */
  gst_init (&argc, &argv);

  /* Initialize our data structure */
  memset (&data, 0, sizeof (data));

  /* Build the pipeline */
  pipeline = gst_parse_launch ("playbin uri=https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm", NULL);
  bus = gst_element_get_bus (pipeline);

  /* Start playing */
  ret = gst_element_set_state (pipeline, GST_STATE_PLAYING);
  if (ret == GST_STATE_CHANGE_FAILURE) {
    g_printerr ("Unable to set the pipeline to the playing state.\n");
    gst_object_unref (pipeline);
    return -1;
  } else if (ret == GST_STATE_CHANGE_NO_PREROLL) {
    data.is_live = TRUE;
  }

  main_loop = g_main_loop_new (NULL, FALSE);
  data.loop = main_loop;
  data.pipeline = pipeline;

  gst_bus_add_signal_watch (bus);
  g_signal_connect (bus, "message", G_CALLBACK (cb_message), &data);  //!!!!!!!!

  g_main_loop_run (main_loop);

  /* Free resources */
  g_main_loop_unref (main_loop);
  gst_object_unref (bus);
  gst_element_set_state (pipeline, GST_STATE_NULL);
  gst_object_unref (pipeline);
  return 0;
}

Ответы (0 шт):