As mentioned in my previous ticket, I have a long-standing fails-to-work issue with VTB in QMPlay2 on my Mac (2011 MPB 8.1 running OS X 10.9.5). This hardware acceleration does work in VLC as far as I can tell, so a priori it's not that my OS is too old (VTB was introduced in 10.8 btw).
I've been trying to trace the origin of the problem but get stuck somewhere on what appears to be a C++ problem...
also appears to succeed (I get a VTBOpenGL instance with its own, non-null copy of m_hwDeviceBufferRef).
Things go wrong in OpenGLWriter::setHWDecContext(): the dynamic cast from the HWDecContext instance to a OpenGLHWInterop fails. With some trace output:
I get virtual bool OpenGLWriter::setHWDecContext(const shared_ptr<HWDecContext> &) hwDecContext 0x11e4061c8 hwInterop 0x0 hwInterop2 0x0
As far as I can tell this makes little sense: VTBOpenGL inherits OpenGLHWInterop inherits HWDecContext so unless something fishy is going on with the shared_ptr implementation a VTBOpenGL instance passed as a hwDecContext pointer should be dynamic-castable to a OpenGLHWInterop pointer.
Any idea how to figure out what goes wrong and why, here?
As mentioned in my previous ticket, I have a long-standing fails-to-work issue with VTB in QMPlay2 on my Mac (2011 MPB 8.1 running OS X 10.9.5). This hardware acceleration does work in VLC as far as I can tell, so a priori it's not that my OS is too old (VTB was introduced in 10.8 btw).
I've been trying to trace the origin of the problem but get stuck somewhere on what appears to be a C++ problem...
In
FFDecVTP::open()
:av_hwdevice_ctx_create(&m_hwDeviceBufferRef, AV_HWDEVICE_TYPE_VIDEOTOOLBOX, nullptr, nullptr, 0)
does not fail. The subsequent operation
vtbOpenGL = make_shared<VTBOpenGL>(m_hwDeviceBufferRef);
also appears to succeed (I get a
VTBOpenGL
instance with its own, non-null copy ofm_hwDeviceBufferRef
).Things go wrong in
OpenGLWriter::setHWDecContext()
: the dynamic cast from theHWDecContext
instance to aOpenGLHWInterop
fails. With some trace output:I get
virtual bool OpenGLWriter::setHWDecContext(const shared_ptr<HWDecContext> &) hwDecContext 0x11e4061c8 hwInterop 0x0 hwInterop2 0x0
As far as I can tell this makes little sense:
VTBOpenGL
inheritsOpenGLHWInterop
inheritsHWDecContext
so unless something fishy is going on with theshared_ptr
implementation aVTBOpenGL
instance passed as ahwDecContext
pointer should be dynamic-castable to aOpenGLHWInterop
pointer.Any idea how to figure out what goes wrong and why, here?
How crucial is the use of
shared_ptr
?