Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-18125

Phonon VideoWidget inside QGraphicsView crashes on Mac OS X (Cocoa build)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P2: Important
    • None
    • 4.7.0, 4.7.1, 4.7.2
    • None
    • Mac OS X 10.6

      Qt 4.7.2 (and all 4.7), Cocoa build, 64-bit

      Intel MacBook (Core2 Duo 64-bit)
    • macOS

    Description

      When using the Cocoa (64-bit) build of Qt on Mac OS X, placing a Phonon::VideoWidget inside a QGraphicsView causes the Phonon Quicktime backend to crash.

      (Video Widgets inside QGraphicsViews seem to be very desirable, so that you can do composition and draw graphics and widgets on top of videos... as seen in this example: http://labs.qt.nokia.com/2008/11/28/videos-get-pimped/ )

      The crash is always inside Phonon::QT7::VideoFrame::drawQImage().

      I've attached a minimal program to reproduce the bug. Before running, you'll need to place the test movie (testMovie.m4v) into the same folder as the compiled application bundle (PhononGraphicsViewBugDemo.app), or use any other video file you have handy.

      The crash seems to be a threading bug, so it doesn't happen immediately... For me, it usually happens a random number of seconds (usually 15 or less) after video starts playing.

      The crash happens regardless of whether a QGLWidget is used for the GraphicsView viewport or not. (It seems that the QImage-based rendering functions are used in both cases, even when a GL context is available... As an unrelated feature request, it would be nice to have OpenGL acceleration on Mac OS X for videos in GraphicsViews, especially once QtQuick/QML gains popularity.)

      Attempted workarounds
      ========================
      I attempted to compile the phonon-vlc backend (https://projects.kde.org/projects/kdesupport/phonon/phonon-vlc ) for Mac OS X as a work-around, but I wasn't able to get it to build. I also don't know how to specify an alternate backend for Phonon on OS X... It seems to use the Quicktime backend automatically.

      Stack trace:
      =============

      0 objc_msgSend 0 0x7fff8361733c
      1 imageProviderCopyImageBlockSet 0 0x7fff8236b60b
      2 imageProvider_getBytes 0 0x7fff88071959
      3 -[NSBitmapImageRep _fromCGImage:performBlockUsingMutableData:] 0 0x7fff807a7a71
      4 __-[NSBitmapImageRep _withoutChangingBackingPerformBlockUsingBackingMutableData:]_block_invoke_1 0 0x7fff8076c949
      5 -[NSBitmapImageRep _performBlockUsingBacking:] 0 0x7fff8069855a
      6 -[NSBitmapImageRep _withoutChangingBackingPerformBlockUsingBackingMutableData:] 0 0x7fff8076c7f0
      7 __-[NSBitmapImageRep _performBlockUsingBackingMutableData:]_block_invoke_1 0 0x7fff8076c786
      8 -[NSBitmapImageRep _performBlockUsingBacking:] 0 0x7fff8069855a
      9 -[NSBitmapImageRep _performBlockUsingBackingMutableData:] 0 0x7fff8076c705
      10 -[NSBitmapImageRep getBitmapDataPlanes:] 0 0x7fff8076c6b3
      11 -[NSBitmapImageRep bitmapData] 0 0x7fff8076c65e
      12 Phonon::QT7::VideoFrame::drawQImage 0 0x10176e9e7
      13 Phonon::QT7::VideoRenderWidget::event 0 0x10177a6bd
      14 QApplicationPrivate::notify_helper 0 0x1000fdb0d
      15 QApplication::notify 0 0x10010396d
      16 QCoreApplication::notifyInternal 0 0x100d4c7ac
      17 QWidgetPrivate::drawWidget 0 0x1001552c2
      18 QWidgetPrivate::paintSiblingsRecursive 0 0x100155ed6
      19 QWidgetPrivate::drawWidget 0 0x1001550f0
      20 QWidgetPrivate::paintSiblingsRecursive 0 0x100155ed6
      21 QWidgetPrivate::drawWidget 0 0x1001550f0
      22 QWidgetPrivate::render 0 0x100156538
      23 QWidget::render 0 0x10015673e
      24 QWidgetPrivate::render_helper 0 0x100156b5b
      25 QWidget::render 0 0x100156d24
      26 QGraphicsProxyWidget::paint 0 0x1006c3a67
      27 _q_paintItem 0 0x1006c7f84
      28 QGraphicsScenePrivate::drawItemHelper 0 0x1006d01b8
      29 QGraphicsScenePrivate::draw 0 0x1006d32d2
      30 QGraphicsScenePrivate::drawSubtreeRecursive 0 0x1006d3eb2
      31 QGraphicsScenePrivate::drawItems 0 0x1006d4943
      32 QGraphicsView::paintEvent 0 0x1006fa7e3
      33 QWidget::event 0 0x100157806
      34 QFrame::event 0 0x1004cb27c
      35 QAbstractScrollArea::viewportEvent 0 0x1005568c7
      36 QGraphicsView::viewportEvent 0 0x1006fcfdb
      37 QAbstractScrollAreaFilter::eventFilter 0 0x100558da0
      38 QCoreApplicationPrivate::sendThroughObjectEventFilters 0 0x100e39437
      39 QApplicationPrivate::notify_helper 0 0x1000fdade
      40 QApplication::notify 0 0x10010396d
      41 QCoreApplication::notifyInternal 0 0x100d4c7ac
      42 qt_sendSpontaneousEvent 0 0x1000fdccc
      43 -[QCocoaView drawRect:] 0 0x1000a702d
      44 -[NSView _drawRect:clip:] 0 0x7fff8078ac49
      45 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] 0 0x7fff807898bc
      46 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] 0 0x7fff80787f8e
      47 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] 0 0x7fff80788e5a
      48 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] 0 0x7fff80788e5a
      49 -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] 0 0x7fff80784362
      50 -[NSView displayIfNeeded] 0 0x7fff806fdb9a
      51 QGraphicsScenePrivate::_q_processDirtyItems 0 0x1006df6e4
      52 QGraphicsScene::qt_metacall 0 0x1006e02ef
      53 QObject::event 0 0x100e470d9
      54 QGraphicsScene::event 0 0x1006e4325
      55 QApplicationPrivate::notify_helper 0 0x1000fdb0d
      56 QApplication::notify 0 0x10010403e
      57 QCoreApplication::notifyInternal 0 0x100d4c7ac
      58 QCoreApplicationPrivate::sendPostedEvents 0 0x100e3a18b
      59 __CFRunLoopDoSources0 0 0x7fff82cc2401
      60 __CFRunLoopRun 0 0x7fff82cc05f9
      61 CFRunLoopRunSpecific 0 0x7fff82cbfdbf
      62 RunCurrentEventLoopInMode 0 0x7fff8674791a
      63 ReceiveNextEventCommon 0 0x7fff8674771f
      64 BlockUntilNextEventMatchingListInMode 0 0x7fff867475d8
      65 _DPSNextEvent 0 0x7fff806cde64
      66 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] 0 0x7fff806cd7a9
      67 -[NSApplication run] 0 0x7fff8069348b
      68 QEventDispatcherMac::processEvents 0 0x1000b8d54
      69 QEventLoop::processEvents 0 0x100e38af4
      70 QEventLoop::exec 0 0x100e38e14
      71 QCoreApplication::exec 0 0x100e3a43c
      72 main main.cpp 22 0x1000034ed

      Attachments

        1. GraphicsViewVideoPlayer.cpp
          0.6 kB
        2. GraphicsViewVideoPlayer.h
          0.7 kB
        3. PhononGraphicsViewBugDemo.pro
          0.3 kB
        4. main.cpp
          0.5 kB
        5. testMovie.m4v
          6.30 MB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vfm Thierry Bastian (closed Nokia identity) (Inactive)
            markboots Mark Boots
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes