Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. libvlc wrapper The program has unexpectedly finished.
Forum Updated to NodeBB v4.3 + New Features

libvlc wrapper The program has unexpectedly finished.

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 330 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    the_master_noob
    wrote on last edited by
    #1

    QmlVlc
    https://github.com/RSATom/QmlVlc

    It shows some warning but no erros
    warning: C4267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss of data
    alt text

    Output: The program has unexpectedly finished.

    alt text

    .pro File:

    QT += quick
    
    QT += multimedia
    
    include(deps/QmlVlc/QmlVlc.pri)
    
    
    INCLUDEPATH += deps
    
    CONFIG += c++11
    
    # You can make your code fail to compile if it uses deprecated APIs.
    # In order to do so, uncomment the following line.
    #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
    DEFINES += QT_DEPRECATED_WARNINGS
    
    SOURCES += \
            main.cpp
    
    RESOURCES += qml.qrc
    
    # Additional import path used to resolve QML modules in Qt Creator's code model
    QML_IMPORT_PATH =
    
    # Additional import path used to resolve QML modules just for Qt Quick Designer
    QML_DESIGNER_IMPORT_PATH =
    
    macx {
        LIBS += -L/Applications/VLC.app/Contents/MacOS/lib
    }
    
    android {
        LIBS += -L$$PWD/android/libs/armeabi-v7a -lvlcjni
    
        ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
    

    main.cpp:

    #include <QGuiApplication>
    #include <QQmlApplicationEngine>
    
    #include <QmlVlc.h>
    #include <QmlVlc/QmlVlcConfig.h>
    
    int main(int argc, char *argv[])
    {
    #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
        QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
    #endif
    
        RegisterQmlVlc();
        QmlVlcConfig& config = QmlVlcConfig::instance();
        config.enableAdjustFilter( true );
        config.enableMarqueeFilter( true );
        config.enableLogoFilter( true );
        config.enableDebug( true );
    
        QGuiApplication app(argc, argv);
    
        QQmlApplicationEngine engine;
        const QUrl url(QStringLiteral("qrc:/main.qml"));
        QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
                         &app, [url](QObject *obj, const QUrl &objUrl) {
            if (!obj && url == objUrl)
                QCoreApplication::exit(-1);
        }, Qt::QueuedConnection);
        engine.load(url);
    
        return app.exec();
    }
    
    jsulmJ 1 Reply Last reply
    0
    • T the_master_noob

      QmlVlc
      https://github.com/RSATom/QmlVlc

      It shows some warning but no erros
      warning: C4267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss of data
      alt text

      Output: The program has unexpectedly finished.

      alt text

      .pro File:

      QT += quick
      
      QT += multimedia
      
      include(deps/QmlVlc/QmlVlc.pri)
      
      
      INCLUDEPATH += deps
      
      CONFIG += c++11
      
      # You can make your code fail to compile if it uses deprecated APIs.
      # In order to do so, uncomment the following line.
      #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
      DEFINES += QT_DEPRECATED_WARNINGS
      
      SOURCES += \
              main.cpp
      
      RESOURCES += qml.qrc
      
      # Additional import path used to resolve QML modules in Qt Creator's code model
      QML_IMPORT_PATH =
      
      # Additional import path used to resolve QML modules just for Qt Quick Designer
      QML_DESIGNER_IMPORT_PATH =
      
      macx {
          LIBS += -L/Applications/VLC.app/Contents/MacOS/lib
      }
      
      android {
          LIBS += -L$$PWD/android/libs/armeabi-v7a -lvlcjni
      
          ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
      

      main.cpp:

      #include <QGuiApplication>
      #include <QQmlApplicationEngine>
      
      #include <QmlVlc.h>
      #include <QmlVlc/QmlVlcConfig.h>
      
      int main(int argc, char *argv[])
      {
      #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
          QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
      #endif
      
          RegisterQmlVlc();
          QmlVlcConfig& config = QmlVlcConfig::instance();
          config.enableAdjustFilter( true );
          config.enableMarqueeFilter( true );
          config.enableLogoFilter( true );
          config.enableDebug( true );
      
          QGuiApplication app(argc, argv);
      
          QQmlApplicationEngine engine;
          const QUrl url(QStringLiteral("qrc:/main.qml"));
          QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
                           &app, [url](QObject *obj, const QUrl &objUrl) {
              if (!obj && url == objUrl)
                  QCoreApplication::exit(-1);
          }, Qt::QueuedConnection);
          engine.load(url);
      
          return app.exec();
      }
      
      jsulmJ Online
      jsulmJ Online
      jsulm
      Lifetime Qt Champion
      wrote on last edited by jsulm
      #2

      @the_master_noob said in libvlc wrapper The program has unexpectedly finished.:

      Output: The program has unexpectedly finished.

      Please use debugger to see where exactly it crashes and post stack trace here.
      Also, you should not create any QObject based class instances before you create QGuiApplication instance!
      QmlVlcConfig is derived from QObject.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • T Offline
        T Offline
        the_master_noob
        wrote on last edited by
        #3

        thanks is fixed
        i forgot to put vlc in enveirment path

        1 Reply Last reply
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved