[mythtv-commits] mythtv commit: r27000 by markk

mythtv at cvs.mythtv.org mythtv at cvs.mythtv.org
Wed Oct 27 02:57:30 UTC 2010


      Author: markk
        Date: 2010-10-27 02:57:30 +0000 (Wed, 27 Oct 2010)
New Revision: 27000
   Changeset: http://svn.mythtv.org/trac/changeset/27000

Log:

Reset the MythImage parent when the painter is deleted.

MythImage objects are allocated by the painter classes so that the
painter classes can keep track of painter specific resources that have
been allocated (e.g. OpenGL textures, VDPAU bitmaps etc). The MythImage
objects then keep a record of the painter that allocated them so that
they can inform that painter when they are being deleted and hence those
resources can ben deleted. MythImage makes no other use of the
parent/painter pointer it keeps.

During video playback, the OpenGL, VDPAU and Direct3D renderers may
delete and recreate the painter when the video source has changed - BUT
the OSD itself is not deleted. This significantly reduces the overhead
during input changes, minimises the visual impact of recreating the OSD
and ensures we don't 'lose' OSD elements (when the OSD is re-

If the painter is re-created, any subsequent UI element deletion may
trigger a crash as the parent for any MythImage is no longer valid. This
is triggered consistently by the MHEG renderer which deletes the old UI
elements before re-painting the page again (and there is at least one
lock not used which would minimise but not avoid the impact).

So when the painter is deleted, we reset the parent for any UI elements
that have not released their resources and refresh the parent when the
new painter is subsequently used to render the UI (so that the new
painter is called when the MythImage is finally deleted).

There is some additional locking still required in MythPlayer for
absolute safety.

N.B. I will probably revert this code if it does not work as intended.


Modified:

   trunk/mythtv/libs/libmythui/mythimage.h
   trunk/mythtv/libs/libmythui/mythpainter.cpp
   trunk/mythtv/libs/libmythui/mythpainter_d3d9.cpp
   trunk/mythtv/libs/libmythui/mythpainter_ogl.cpp
   trunk/mythtv/libs/libmythui/mythpainter_vdpau.cpp




More information about the mythtv-commits mailing list