Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Segfault with rendering video with custom MediaService (QVideoRendererControl_iid)
Forum Updated to NodeBB v4.3 + New Features

Segfault with rendering video with custom MediaService (QVideoRendererControl_iid)

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 628 Views 1 Watching
  • 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
    theonlylawislove
    wrote on last edited by theonlylawislove
    #1

    I am getting segfault here in qopenglfunctions.h on d_ptr->f.TexImage2D(...).

    inline void QOpenGLFunctions::glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
    {
    #if defined(QT_OPENGL_ES_2) && defined(Q_OS_ANDROID)
        ::glTexImage2D(target, level, internalformat, width,height, border, format, type, pixels);
    #else
        Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
        // SEGFAULT HAPPENS HERE
        d_ptr->f.TexImage2D(target, level, internalformat, width,height, border, format, type, pixels);
    #endif
        Q_OPENGL_FUNCTIONS_DEBUG
    }
    

    Here is my code: https://gist.github.com/pauldotknopf/de3495a2581c65bac3cea2ddb8dc376c

    Take a look at the presentFrame frame method. I suspect the error is because videoServuce->present(...) is called with a buffer that is short lived and later deleted. However, I did create a class-level char* buffer that I memcpy to, transforing ownership of the bytes to the class itself, and it still happened.

    Here is the stack trace.

    https://gist.github.com/pauldotknopf/f53f8d7253a1faf5f69256be5806fa6b

    I am using Qt at the latest 5.10 branch.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Why not create a QByteArray from your data and then trigger a copy when you pass it to QMemoryVideoBuffer ?

      Also, are you sure you are passing the right number of bytes per line ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      • Login

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