This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Qt and Video playback in Omap4

Hi,

I am developing a QT application to browse and play the videos in an USB device on OMAP4 platform. I built the QT application and I was able to run it. But in order to play the video in omap4, I need to start X (for DCE authentication) and export DISPLAY variable (for hardware accelerated codecs and pvrvideosink). When this happens, Iam not able to see the QT screen since it dumps into the linux framebuffer by default. How do I proceed ?

Thanks in advance,

Carol

  • Which version of Qt do you use ?

    Typically i use something like

    ,.appname -qws -display powervr

    after exporting DISPLAY

    works fine no need for X ...

    Brahim

  • Hi Brahim,

    I'm using Qt 4.8.4. I need X11 to be running for pvrvideosink (SGX based videosink). DISPLAY variable is exported at the beginning.

    The problem is pvrvideosink if not specified, creates its own window to dump the video. As a result Qt window is lost. I have tried getting the video playback and the Qt app on the same screen using gst_x_overlay_set_window_handle() and gst_x_overlay_set_render_rectangle().  It works fine except the fact that there is flickering and Qt buffer is lost.  I wanted the video to fill only a part of the screen, while rest of the screen continued to show the Qt app screen. When i use  gst_x_overlay_set_render_rectangle() to set such coordinates, video is surely resized to fit that part of the screen, rest of the screen is black.

    Is there any alternative to get video playback and Qt work hand in hand in X11 environment ?

    Thanks,

    Carol

  • Hi Carol.

    I believe you will need to configure QT to run on top of X11 rather than framebuffer.  http://qt-project.org/wiki/Support_for_Linux_X11 might be helpful.

    Regards,

        Steve

  • Hi Steve,

    I'm using Qt -X11 and not Qt- embedded. That is the reason I'm using gst_x_overlay_set_window_handle() and gst_x_overlay_set_render_rectangle().

    Regards,

    Carol.

  • Hi Carol.

    I'm wondering if you have QT configured correctly to use X11. You mention in your original posting that QT is using the framebuffer.

    If QT was configured to use X11 to draw its windows rather than drawing directly to the framebuffer, you should not be able to see any QT output until the X11 server is running.

    Regards,

        Steve

  • Hi Steve,

    That's correct.  Qt-embedded uses linux framebuffer. I cannot use Qt-embedded and pvrvideosink together, since I'll lose controls over Qt when my video playback starts.

    I am using Qt-X11 which is cross compiled and like you said I'm won't be able to see Qt output unless X11 server is running. 

    My problem is with video playback and Qt-X11.

    Thanks,

    Carol

  • Hi Carol.

    I'm not following you.  The problem you reported in the original post was due to QT using the framebuffer.  In other words, with QT embedded.

    But later you indicate you are seeing a problem with QT/X11.  What problem are you seeing there?  It can't be what you describe with QT drawing to the framebuffer since QT/X11 doesn't do that (except through the X11 server).

    The X11 server should be able to handle window requests from a number of clients, including both QT and gstreamer.  Are you able to run each client separately and see X11 display the results?  Are the windows setup non-overlapping to be able to see both client's windows at the same time?

    Regards,

        Steve

  • Hi Steve,

    I'm sorry. Ok, let me put it this way. 

    I am developing a QT application to browse and play the videos in an USB device. Initially I started with Qt-embedded which is when I realized I cannot use Qt-embedded when I'm going to play an video using gstreamer pipeline with pvrvideosink as a sink. Pvrvideosink needs X11. What I then did was, I started a X11 server just when I needed to play the video, and killed it when I wanted to stop the pipeline. The problem I faced with this was, Qt app with controls to start, pause, stop the playback was lost. The Qt buffer was lost when X11 server started.That is when I moved to Qt-X11.

    I cross compiled Qt-X11 for Omap4 platform. GUI was perfectly fine. The problem occurred when video pipeline was created and playback started. Pvrvideosink created a separate internal Window for its playback. The Qt window was lost. What I now did is, I fetched the Window ID from the Qt application (using  QApplication::activeWindow()->effectiveWinId() )  and used the functions gst_x_overlay_set_window_handle() and gst_x_overlay_set_render_rectangle() to display the video on the same window as Qt. I added prints to see if I'm on the same window as Qt application and I actually was.

    Now the problem is black background. The area which doesn't belong to the render rectangle is black and the Qt is not able to draw any widgets on top of it. I have attached a picture. Please look at it

    . I

    Regards,

    Carol

  • Hi Carol.

    It may be moot now that you are using a single window, but:  I wonder if the cause of "The Qt window was lost" when using QT/X11 and then starting gstreamer is just that the QT window is behind the gstreamer one and may be resolved by changing the x/y coordinates of one window.  If the two clients are to share a window, you'll need a way to control where their output appears within that window (non-overlapping) or which one appears on top of the other.  As I've only used separate windows, I don't know if either is possible.

    For the blank screen area: I can think of a couple of possibilities.  First, it may be that X11 is not using the correct resolution for the display.  The X11 log file should tell you what it thinks the resolution is.  Second (more likely), it may be that the location/size of the windows just don't use that part of the screen.  Running any X11 app, even xeyes, with the right geometry should tell you whether bigger windows are possible.

    Regards,

        Steve

  • Hi Steve,

    It looks like I need to look into overlapping and non-overlapping window concept of X11. Can you please suggest some links where it is explained in detail ?

    And hey, the blank screen around the video was because I had set the render rectangle to 400x400. The actual display is 480x800. If I hadn't set the render rectangle, the frame looked like it exceeded the screen dimensions. When the render rectangle is set to 480x800, it perfectly fits the display screen. I'm resizing the window using the gst_x_overlay_set_render_rectangle() to 400x400, since I need rest of the screen to show the app screen of Qt. The sequence is, I start a Qt application which fits the screen and then set the render rectangle for the video to occupy a smaller section of the screen, retaining the rest of GUI screen. The GUI section is underneath the blank screen which responds to touch sensations but fails to show the Qt screen widgets.

    Thanks,

    Carol

  • Hi there,

    Has anyone verified applying render rectangle using gst_x_overlay_set_render_rectangle() on pvrvideosink ? Is any one else finding a black area around the render rectangle ?

    Thanks in advance,

    Carol

  • Hi

    I would first try to see how my Qt application behave, if you disable/remove your video
    part, can you see your Qt GUI ? I would then see how I use the GStreamer into this.

    Why not using Qt 4.8.4 instead of QT embedded ? What System are you using ?
    What OS are you using ?  

    Regards

    Brahim  

  • Hi,

    Sorry for the delay. Yes, my Qt works perfectly fine if I disable the video. It works fine even if when I issue stop to the gstreamer video playback. I feel the issue is in pvrvideosink since the same application when built for i386, and xvimagesink works fine, with the video playback within the render rectangle, and not affecting rest of the area on the screen.  

    I am using Qt 4.8.4 - X11, cross compiled for Omap4 in non-debian system.

    Thanks,

    Carol

  • Hi All,  

    My question is different from this discussion... But what i feel was Amarinder, Carol and other can solve my issue...

    Need help on running Qt GUi app on Pandaboard-ES

    Please guide me where i am going wrong...

    Qt version is 4.85

    My host system is Ubuntu-12.04 ×86_64bit

    My target system is Pandaboard- ARMv7 Ubuntu-12.04
    My toolchain is arm-linux-gnueabihf-
    I configured Device type as Desktop in Qt Creator->Tools->Options

    I am successful in compiling Qt source on host system with qmake.conf as
    ————————————————————————————————————————————————————
    #

    qmake configuration for building with arm-panda-g++

    #
    include(../../common/linux.conf)
    include(../../common/gcc-base-unix.conf)
    include(../../common/g++-unix.conf)
    include(../../common/qws.conf)

    modifications to g++.conf
    QMAKE_CC = arm-linux-gnueabihf-gcc
    QMAKE_CXX = arm-linux-gnueabihf-g++
    QMAKE_LINK = arm-linux-gnueabihf-g++
    QMAKE_LINK_SHLIB = arm-linux-gnueabihf-g++
    modifications to linux.conf
    QMAKE_AR = arm-linux-gnueabihf-ar cqs
    QMAKE_OBJCOPY = arm-linux-gnueabihf-objcopy
    QMAKE_STRIP = arm-linux-gnueabihf-strip
    load(qt_config)
    ————————————————————————————————————————————————————
    and build Qt src with following configuration

    ./configure -opensource -confirm-license -prefix /opt/qt-panda-armhf -embedded arm -platform qws/linux-x86_64-g++ -xplatform qws/linux-panda-g++ -no-pch -little-endian

    After this i copied /opt/qt-panda-armhf/lib from host to the target with same location as /opt/qt-panda-armhf/lib.

    Then i built qt app in QtCreator , by setting qmake, after building qt source with above mentioned qmake.conf. and setting arm-linux-gnueabihf- g++ compiler.

    I am successful in building qt gui app in qtcreator and got executable file.

    Then i copied the executable onto pandaboard target board and run by exporting the /opt/qt-panda-armhf/lib

    run as
    $ ./my_app -qws

    But i am unable to run the app. with following issue
    Cannot create Qt for Embedded Linux data directory: /tmp/qtembedded-0

    < for this i tried by changing /tmp folder in qt src path to user directory 
    But got the same error as
    Cannot create Qt for Embedded Linux data directory: ~/App/temp/qtembedded-0 >

    < even i tried with mount point in /etc/fstab as
    none /tmp/ tmpfs size=1M 0 0 
    But in this case also iam unable to run
    >

    One more issue i found when running app as
    $ ./my_app
    then i got the issue as QScreenLinuxFb::connect: No such file or directory
    Error opening frame buffer device /dev/fb0

    < for this i tried

    $ ./my_app -qws -display LinuxFb

    But i am unsuccessful>

    need help regarding the same…

  • Maybe when you run your application you do not have the right credentials
    to create the folder and write data into it ...  

    Have you tried to compile your application natively on your Panda-ES ?

    Brahim 

  • I tried by compiling my qt app natively on Panda-ES with the cross compiled qt libraries for arm on my host PC. But no result. facing the issue 

    Cannot create Qt for Embedded Linux data directory: /tmp/qtembedded-0.

     Here i modified my qt source from /tmp directory to ~/App/temp . But still facing the below issue.

    Cannot create Qt for Embedded Linux data directory: ~/App/temp/qtembedded-0.

    What is the problem? why we get this error..?