Opened 16 years ago

Closed 15 years ago

#7650 closed task (fixed)

Use libmythui to draw the OSD

Reported by: markk Owned by: markk
Priority: minor Milestone: 0.24
Component: MythTV - Video Playback Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

Summary plan of attack:-

  • Create a new MythRender? class in libmythui and 3 subclasses (MythRenderOpenGL, MythRenderD3D and MythRenderVDPAU) that can be used by libmythui and libmythtv to create hardware accelerated rendering devices and avoid a libmythui dependancy on libmythtv.
  • Convert VideoOutputOpenGL, VideoOutputD3D and VideoOutputVDPAU to use the new MythRender? classes.
  • Convert MythOpenGLPainter and MythVDPAUPainter to use the new MythRender? classes.
  • Create a new MythD3DPainter class that uses MythRenderD3D.
  • Create MythYV12Painter and MythRGBAPainter to draw to YUV420P and RGBA buffers directly.
  • Convert OSD to use a libmythui object tree for theming and MythPainter? to render those objects.
  • Convert the VideoOutput? classes to using MythPainter? objects for rendering the OSD. VideoOutputOpenGL, D3D and VDPAU will render directly to a frame buffer (on screen or off), VideoOutputXv? to either the video frame (as now) or to an RGBA buffer for the chromakey osd.

Change History (225)

comment:1 Changed 16 years ago by markk

Owner: changed from Janne Grunau to markk
Status: newaccepted

comment:2 Changed 16 years ago by markk

(In [22896]) New branch for converting the OSD to libmythui. Refs #7650.

comment:3 Changed 16 years ago by markk

(In [22897]) Branch libmythui-osd: Add MythRenderVDPAU as a new general purpose VDPAU context. This will replace VDPAUContext for rendering both UI elements and video.

The main changes from the existing class are:-

  • it is thread safe so should have no difficulty with access from

multiple 'clients'. Multiple decoder locks may be needed for efficient handling of multiple decoders, though they should currently work regardless.

  • adds initial, though untested, support for the new VDPAU high quality

scaling feature.

  • it provides opaque resource handles to clients to allow seemless

recovery from display preemption. Preemption events no longer require the video output classes to be recreated. The main complication here is that recreation of VideoOutputSurfaces? needs to be triggered from the decoder (when hardware decoding), so we allocate a thread 'owner' to each surface and re-create as needed.

Despite extensive locking and QHash usage, performance appears to be unchanged from the existing class(es). Both locking and QHash checks could possibly be relaxed going forward.

Refs #7650

comment:4 Changed 16 years ago by markk

(In [22900]) Branch libmythui-osd: Convert MythPainter? and subclasses to using QPaintDevice instead of QWidget. This will allow painting to offscreen objects such as QImage.

Refs #7650

comment:5 Changed 16 years ago by markk

(In [22902]) Branch libmythui-osd: Convert MythVDPAUPainter to use MythRenderVDPAU.

This also implements MythVDPAUPainter::DrawRoundRect? in the same way as DrawText? (i.e. software painter and cached images), fixes a scaling issue with certain images and ensures the class cleans up properly so that it can be safely used outside of the main UI.

Refs #7650

comment:6 Changed 16 years ago by markk

(In [22903]) Branch libmythui-osd: Tweak some of the debug output in MythRenderVDPAU to reflect its shared usage.

Refs #7650

comment:7 Changed 16 years ago by markk

(In [22904]) Branch libmythui-osd: Clear new VDPAU output surfaces after creation. Prevents some momentary on screen garbage after a new render device is created.

Refs #7650

comment:8 Changed 16 years ago by markk

(In [22907]) Branch libmythui-osd: Use MythRenderVDPAU as the render device in VideoOutputVDPAU.

There are 2 known issues:-

  • there is no OSD as it didn't seem worthwhile to port the old OSD code

just to rip it out again in a few days.

  • there is a small issue around reference frame ordering with software

decode following a pause. I may just re-work the handling of reference frames to try and make it simpler all round.

This also has the positive side-effect of removing the VDPAU dependancy in VideoBuffers?.

Refs #7650

comment:9 Changed 16 years ago by markk

(In [22908]) Branch libmythui-osd: Remove VDPAUContext.

Refs #7650

comment:10 Changed 16 years ago by markk

(In [22909]) Branch libmythui-osd: Allow MythUIProgressBar to use a MythUIShape as it's progress image and add cropping support to MythUIShape. This allows an entire OSD theme to be created using only shapes.

Refs #7650

comment:11 Changed 16 years ago by markk

(In [22923]) Branch libmythui-osd: Add MythRenderOpenGL as a new general purpose OpenGL context which will replace OpenGLContext for rendering both UI elements and video.

This is largely a lift and shift of the code from OpenGLContext into a sub-class of QGLContext with additional functionality for the UI rendering aspects. This gives us Qt cross-platform support out of the box (with the exception of some screen information) and hence greatly simplifies the code base. The downside is that we must use a QGLWidget for rendering, it is not yet thread safe under X11 (as we do not have access to the underlying X display connection) and, for the time being at least, there is no OpenGL vsync support.

As yet untested on OS X and windows.

Refs #7650

comment:12 Changed 16 years ago by markk

(In [22926]) Branch libmythui-osd: Use MythRenderOpenGL as the renderer for MythOpenGLPainter. Functionality and performance should be unchanged, though some setups may see reduced CPU utilisation as we now explicitly set the swap interval.

Refs #7650

comment:13 Changed 16 years ago by markk

(In [22927]) Branch libmythui-osd: Remove the softblend OSD as an option when using the OpenGL video renderer as direct rendering will be much faster. Refs #7650.

comment:14 Changed 16 years ago by markk

(In [22929]) Branch libmythui-osd: Add a resize window method to MythRenderOpenGL. Refs #7650.

comment:15 Changed 16 years ago by markk

(In [22930]) Branch libmythui-osd: Use MythRenderOpenGL as the render device for VideoOutputOpenGL and its helper class OpenGLVideo.

WARNING: As is, this will crash intermittently on Linux/X11 as rendering is via the parent QGLWidget which sits in the main UI thread and we are triggering X calls from at least 2 other threads. Going forward we need to either move the main video output loop into the UI thread and make access from other threads safe (preferred option) or reimplement large parts of the Qt OpenGL code to gain direct access to the underlying X display connection (no thanks!). The former option is probably needed anyway if we are to implement any advanced eye candy at a later date.

The softblend OSD option has been removed and, as for the VideoOutputVDPAU changes, the full screen OSD is temporarily disabled.

Performance and features should otherwise be unchanged, though both hardware and sotware Bobdeint appear to be broken in some way.

Refs #7650.

comment:16 Changed 16 years ago by markk

(In [22931]) Branch libmythui-osd: Cache rounded rectangle images in MythOpenGLPainter. As for the VDPAU painter, the actual painting is still done in software and the string image cache is used for rounded rects as well, which avoids the overhead of managing two caches.

Qt does provide a method of hardware accelerating the painting of rounded rectangles in OpenGL by using QGLFrameBufferObject. Given that rounded rects are still relatively uncommon theme elements, there doesn't however seem to be any pressing need to accelerate them.

Refs #7650.

comment:17 Changed 16 years ago by markk

(In [22940]) Branch libmythui-osd: Windows fixes. Fairly academic at the moment as VideoOutputOpenGL will not run on windows (thread/gui issues). Refs #7650.

comment:18 Changed 16 years ago by markk

(In [22942]) Branch libmythui-osd: Fixes for OS X. As for the windows fixes, these are somewhat academic as the compiler seems to be getting itself stuck in a circular dependency. Refs #7650.

comment:19 Changed 16 years ago by markk

(In [22959]) Branch libmythui-osd: Add MythRenderD3D9 and MythD3D9Painter for windows platforms. Fully featured and seemingly fully functional with the exception of some missing render to texture functionality still required to display the OSD.

Direct3D9 painting of the UI can currently only be enabled via the command line ('-O ThemePainter?=d3d9')

Refs #7650.

comment:20 Changed 16 years ago by markk

(In [22960]) Branch libmythui-osd: Convert VideoOutputD3D to use MythRenderD3D9. As for the VDPAU and OpenGL the OSD is currently unavailable.

Refs #7650

comment:21 Changed 16 years ago by markk

(In [22962]) Branch libmythui-osd: Merge r22897:22961 from trunk to libmythui-osd.

Refs #7650

comment:22 Changed 16 years ago by markk

(In [22963]) Branch libmythui-osd: Pass the OSD to VideoOutputPrepareFrame? as well as ProcessFrame?. In the first instance this will be used by the OpenGL renderer when no render-to-texture (FramebufferObject?) features are available to 'cache' the osd.

Refs #7650

comment:23 Changed 16 years ago by markk

(In [22965]) Branch libmythui-osd: New backendconnectionmanager files missed in r22962. Refs #7650

comment:24 Changed 16 years ago by markk

(In [22967]) Branch libmythui-osd: Add the missing render-to-texture functionality for MythRenderD3D9 and implement the VideoOutputD3D osd (currently disabled).

There is some intermittent video breakup with the D3D playback that I haven't yet tracked down (though I believe it is unrelated to this commit).

Also fix some 'off by one' errors in MythRenderD3D9.

Refs #7650. Refs r22959.

comment:25 Changed 16 years ago by markk

(In [22969]) Branch libmythui-osd: Draw the OpenGL OSD directly to the main frame buffer if FrameBufferObjects? are not available.

Refs #7650. Refs r22963.

comment:26 Changed 16 years ago by markk

(In [23021]) Branch libmythui-osd: Add a new UI painter - MythQImagePainter - which will be used to draw the ChromaKey? OSD. Refs #7650.

comment:27 Changed 16 years ago by markk

(In [23022]) Branch libmythui-osd: Convert ChromaOSD to using the new MythQImagePainter for drawing the OSD.

There are a number of associated changes around double buffering of the X buffer (which doesn't appear to be needed) and correct handling of alternative letterbox colours. I've also tried to optimise as far as possible from the painter itself (cached), to the OSD 'handler' (minimal updates via clipping/dirty region handling etc, not yet committed) and to the actual update of the X image by refreshing only the dirty area and limited use of MMX extensions when available.

As for previous OSD conversions, the actual OSD is still disabled.

Refs #7650.

comment:28 Changed 16 years ago by markk

(In [23065]) Branch libmythui-osd: Add YUV colour space support to MythImage?. This simply uses the existing buffer to hold YUV image data without sub-sampling, as converted from the existing RGB data, and will be used by a YV12 painter (with appropriate conversion of the colours, the existing Qt paint routines will paint and blend without issue using the YUV colorspace). Refs #7650.

comment:29 Changed 16 years ago by markk

(In [23066]) Branch libmythui-osd: MythQImagePainter improvements.

  • Use a fast, copy based painting mode when the area to be painted is

clear and hence no blending is needed. To work properly, this needs the QImage format to be Format_ARGB32_Premultiplied and hence this probably breaks the ChromaKey? OSD for the time being. The pre-multiplied format is also generally faster.

  • Add a Clear method to clear areas of the paint image prior to re-

sub-classed for the YV12 painter.

Refs #7650.

comment:30 Changed 16 years ago by markk

(In [23068]) Branch libmythui-osd: Add MythYUVAPainter - a new UI painter that renders in the YUV colour space.

This is a straightforward sub-class of MythQImagePainter that simply ensures any MythImages? and colours are converted to YUV before passing to MythQImagePainter for rendering/cacheing etc.

Refs #7650. Refs r23065, Refs r23021.

comment:31 Changed 16 years ago by markk

(In [23072]) Branch libmythui-osd: Fix some stupid errors in the libmythui YUV colour space support:-

  • Use an RGB to YUV conversion routine that actually works and tweak it

slightly to avoid results that are out of range.

  • Actually convert the font colour prior to creating a text image.
  • Mark YUV images as YUV before they are drawn and hence converted

twice.

Refs #7650. Refs r23065. Refs r23068.

comment:32 Changed 16 years ago by markk

(In [23073]) Branch libmythui-osd: Prevent repeated conversions to YUV in MythImage?.

Refs #7650.

comment:33 Changed 15 years ago by markk

(In [23077]) Branch libmythui-osd: Allow the UI scaling factors to be (temporarily) overridden. This will allow the OSD code to load the OSD theme using different dimensions when required.

Refs #7650.

comment:34 Changed 15 years ago by markk

(In [23078]) Branch libmythui-osd: Add some yuv blending routines.

These unpack, sub-sample and blend regions of a MythImage? (preferrably one using YUV) into a YV12 video frame. Both routines rely on the upate region being appropriately aligned (this keeps the code simple and fast). Despite its good looks, the MMX version is roughly 7x faster.

Refs #7650.

comment:35 Changed 15 years ago by markk

(In [23086]) Branch libmythui-osd: Add support for blending regions of a YUV MythImage? into an IA/AI44 frame.

This is a simplified version of the blending from OSDSurface as I've assumed no MMX (it's hard to see how an MMX version could be much faster).

As we are using a pre-multiplied ARGB version of QImage, I would expect to see some alpha blending issues but everything looks broadly correct.

Also add some endianness support to the existing yuv88 to yv12 C routine.

Refs #7650.

comment:36 Changed 15 years ago by markk

(In [23087]) Branch libmythui-osd: Convert the alpha blended and XvMC IA44 OSD to the new libmythui based drawing.

As ever, the actual drawing is still disabled.

Refs #7650.

comment:37 Changed 15 years ago by markk

(In [23088]) Branch libmythui-osd: Last minute typo in r23087.

Refs #7650.

comment:38 Changed 15 years ago by markk

(In [23089]) Branch libmythui-osd: Fix clearing in MythQImagePainter. Even when an alpha value is specifically set, Qt won't write to the alpha channel so access it directly.. This was breaking blending with the ChromaKey? OSD. Refs #7650.

comment:39 Changed 15 years ago by markk

(In [23090]) Branch libmythui-osd: Fix the ChromaKey? OSD. It now uses the QImage ARGB32_Premultiplied format and blending works as nature intended. Refs #7650.

comment:40 Changed 15 years ago by markk

Latest merge from trunk in r23091. (The commit message was truncated somewhere)

comment:41 Changed 15 years ago by markk

(In [23092]) Branch libmythui-osd: New upnp file missed in the merge from trunk. Refs #7650.

comment:42 Changed 15 years ago by markk

(In [23093]) Branch libmythui-osd: More missing files from trunk merge. Refs #7650.

comment:43 Changed 15 years ago by markk

(In [23094]) Branch libmythui-osd: More missing files post merge. Refs #7650."

comment:44 Changed 15 years ago by markk

(In [23098]) Branch libmythui-osd: Fix clearing of regions following r23089. With clearing working properly it highlighted the fact that when using pre- space you're using.

Refs #7650.

comment:45 Changed 15 years ago by markk

(In [23133]) Branch libmythui-osd: Expose the UI painter in use by the video renderer.

Refs #7650.

comment:46 Changed 15 years ago by markk

(In [23134]) Branch libmythui-osd: Extend MythScreenType::SetTextFromMap? to update image paths and progress bar positions.

Probably a short term solution to updating the OSD - I'm not sure on the efficiency and it's a little contrived as it stands (e.g. converting from int to QString and back again just to crow bar the update into the existing code and having to name an OSD image element 'iconpath'!)

Refs #7650.

comment:47 Changed 15 years ago by markk

(In [23135]) Branch libmythui-osd: Enable OSD painting using libmythui.

This is a limited implementation and provides the basic OSD functions only.

What's missing (that you might expect to still be there)

  • the OSD menu
  • OSD dialogues
  • all forms of subtitles, teletext, itv (MHEG) and dvd menu buttons
  • the edit bar
  • no movement during fade
  • other stuff that I never use and haven't even thought about yet...

What's broken (that I know of)

  • OpenGL playback (see below)
  • proper scaling/positioning when using the XvMC IA44 or normal alpha

blended OSD (i.e. XVideo/XvMC)

  • some OSD behaviour is broken (e.g. can't clear av sync or picture

attribute adjustments)

  • (relatively minor) breakage in frame ordering for software decoded

VDPAU playback (pause frame issue)

What's not working as well as it used to

  • some minor/occasional on-screen garbage (i.e some windows not being

cleared when they should)

  • a small but significant performance regression in VDPAU playback (not

OSD related)

  • alpha blending (i.e. normal XVideo) performance has taken a noticeable

hit

  • fade times are ALL hard coded to 5 seconds
  • there are some minor inconsistencies between painters in how alpha

blending is working.

What's new/different/better

  • sizeable performance improvement for VDPAU, OpenGl? and Direct3D. Fade

is just about smooth with a 1920x1080 sized OSD and 1080i h264 playback on an Ion system - will hopefully be totally smooth once I've ironed out the performance issue noted above.

  • it's themeable in line with the main UI theme/s. alpha pulse,

animations, shapes, rects etc

  • some small changes to allow theming of the status info (which will

break translations as well)

What didn't make it (yet)

  • theming of the fade values and fade movement (possibly down to the

element level)

  • more flexible OSD theming - i.e. let the themer decide on the number

and 'features' of each OSD window.

  • context sensitive theming (e.g. video vs live tv)
  • more themeable attributes such as video/audio properties, recording

status etc

Implementation wise, I've taken a scythe to much of the OSD code with a view to adding back what is still needed/usefull to re-enable missing functionality. All data is now passed via QString pairs and in the short to medium term it is likely that the OSD class will be re-implemented (again) as a MythScreenStack? or sub-class thereof to ensure maximum continuity between the OSD and main UIs.

OpenGL

OpenGL playback is totally broken on windows and will result in frequent lock ups and/or segmentation faults on linux (OS X untested). This is because we are creating and using QGlWidgets outside of the main UI thread. Clearly this needs fixing before we can move forward.

I've included one basic, widescreen theme that doesn't really do justice to what can be achieved.

Refs #7650.

comment:48 Changed 15 years ago by markk

(In [23136]) Branch libmythui-osd: Enable dvd menu buttons. Refs #7650.

comment:49 Changed 15 years ago by markk

(In [23187]) Branch libmythui-osd: Some small compilation fixes. Refs #7650.

comment:50 Changed 15 years ago by markk

(In [23188]) Branch libmythui-osd: Merge r23091:23187 from trunk. Refs #7650.

comment:51 Changed 15 years ago by markk

(In [23191]) Branch libmythui-osd: Fix a segmentation fault exposed in testing.

This has also highlighted a significant memory leak in the new OSD class. Any UI QObjects created dynamically and added to the OSD UI tree are not deleted as there is no event loop.

Refs #7650.

comment:52 Changed 15 years ago by markk

(In [23192]) Branch libmythui-osd: Convert MHEG/interactive tv to use the new OSD class.

  • this is a fairly straightforward conversion of the existing

behaviour. There is however significant potential to more tightly integrate the itv rendering with the existing MythUITypes and associated drawing functionality. This will require more time but should give a substantial performance boost.

  • as noted in r23191, this currently leaks significant amounts of

memory each time the interactive tv window is redrawn.

Refs #7650.

comment:53 Changed 15 years ago by markk

(In [23201]) Branch libmythui-osd: Convert the video playback thread to a QThread.

Currently there is no Qt event loop running for the playback thread and hence all Qt deleteLater calls are 'lost', leading to substantial memory leaks from the new OSD code.

By converting to a QThread and starting the event loop, objects are destroyed as expected. This is implemented with a zero timeout timer that will trigger immediately all events have been processed. Any performance impact should be minimal.

N.B. This removes, for the time being at least, the OS X garbage collector. I'm not sure whether Qt handles this internally.

N.B. This removes the code that requests realtime priority for the video playback thread. Following discussion on IRC, this may still be achievable while running in a QThread though the setting may no longer be widely used and/or of much utilty. The new QThread is allocated a priority of QThread::TimeCriticalPriority? which may give the same results on certain platforms.

Refs #7650.

comment:54 Changed 15 years ago by markk

(In [23203]) Branch libmythui-osd: Move some video initialisation code into the video thread and add a little debugging around thread startup/exit. This ensures all objects are created within the event loop and are properly deleted.

Refs #7650.

comment:55 Changed 15 years ago by markk

(In [23204]) Branch libmythui-osd: Tidy up loading of the default OSD theme windows.

Refs #7650.

comment:56 Changed 15 years ago by markk

Milestone: 0.230.24

comment:57 Changed 15 years ago by markk

(In [23235]) Import the new VDPAU rendering code into libmythui from the libmythui-

This should offer several advantages over the existing VDPAUContext class:

  • pre-emptions are now handled internally without the need to teardown

all of the player objects. The user should see nothing more than a temporary display glitch and this will probably avoid certain VDPAU playback problems seen in 0.22-fixes.

  • initial support for high quality scaling.
  • it is a general purpose rendering class and hence, by design, will

work for rendering UI objects.

  • it is thread safe and hence should cope with decoding multiple

streams, rendering video and rendering UI elements simultaneously.

I've converted MythVDPAUPainter to the new class but video playback will be unchanged until a separate commit for the libmythtv elements.

Refs #7650.

comment:58 Changed 15 years ago by markk

(In [23511]) Branch libmythui-osd: Merge r23188:23234 from trunk to libmythui-osd. Refs #7650.

These are the commits before the VDPAU code was merged into trunk.

comment:59 Changed 15 years ago by markk

(In [23520]) Branch libmythui-osd: Merge r23235:23519 from trunk to libmythui-osd. Refs #7650.

N.B. This includes some new theme files that were missed previously.

comment:60 Changed 15 years ago by markk

(In [23582]) Branch libmythui-osd: Merge r23520:23580 from trunk to libmythui-osd. Refs #7650.

comment:61 Changed 15 years ago by markk

(In [23583]) Branch libmythui-osd: Revert r23134. Rather than try and build in new OSD theme flexibility at this stage, I'm just going to focus on preserving the existing behaviour and improvements can follow at a later date. Refs #7650.

comment:62 Changed 15 years ago by markk

(In [23585]) Branch libmythui-osd: Reinstate the OSD status position update following r23583. This is largely a switch back to the original approach to updating the OSD status while keeping half an eye on future improvements through the use of a more flexible data structure. Refs #7650.

comment:63 Changed 15 years ago by markk

(In [23595]) Branch libmythui-osd: Extend MythDialogBox? functionality to support resetting of the button list and title text and customisation of returned events for the escape and left actions. This allows the new OSD code to update the dialog without recreating it and to ensure the correct actions are triggered on exit. Refs #7650.

comment:64 Changed 15 years ago by markk

(In [23596]) Branch libmythui-osd: Extend the new OSD class to support MythDialogBox? for user interaction. Refs #7650.

comment:65 Changed 15 years ago by markk

(In [23597]) Branch libmythui-osd: Convert the OSD Menu, exit dialog and delete dialog to use MythDialogBox?.

The exit and delete conversion is relatively straightforward, although with most themes the existing text is too long.

The OSD menu change is fairly extensive and while it appears to work as intended, there may well be issues that I've missed. As MythDialogBox? does not have a tree structure, the TV object manages navigation by way of the event text which is intentionally limited to 1 level of menu nesting. This should cover the majority of use cases and prevents trying to build large menus that are slow enough to effect playback. For more complicated menus, currently only Jump to Recording, we just move (seemlessly) to a new dialog.

There are still some general behaviour issues that I will tidy up once all of the dialogs are converted.

N.B. Qt complains intermittently about creating QObjects in the wrong thread and this is probably the cause of some occasional segmentation faults in the Qt event loop. Another reason to move video playback into the main thread.

Refs #7650.

comment:66 Changed 15 years ago by markk

(In [23603]) Branch libmythui-osd: Add the ability to fade out an OSD dialog after a given number of seconds and optionally update the message text with a countdown of the number of seconds before it times out. Will be used for the idle and sleep dialogs.

Refs #7650.

comment:67 Changed 15 years ago by markk

(In [23605]) Branch libmythui-osd: Convert the idle and sleep dialogs to the new OSD code.

MythConfirmationDialog? is probably a better display option for UI consistency but I have stayed with MythDialogBox? in the short term to keep the OSD code as simple as possible while it is still a work in progress.

Refs #7650.

comment:68 Changed 15 years ago by markk

(In [23606]) Branch libmythui-osd: Set the default selection in the delete video dialog to 'do not delete' - which was the original behaviour.

Refs #7650.

comment:69 Changed 15 years ago by markk

(In [23607]) Branch libmythui-osd: Convert the 'No recorders' dialog to the new OSD code. Again this is clearly better suited to MythConfirmationDialog? and will be converted in due course.

Refs #7650.

comment:70 Changed 15 years ago by markk

(In [23608]) Branch libmythui-osd: Convert the channel lock timeout dialog to the new OSD code and add a convenience function to check which dialog is visible.

Refs #7650.

comment:71 Changed 15 years ago by markk

(In [23609]) Branch libmythui-osd: Convert the 'Already editing' dialog to the new OSD code. Refs #7650.

comment:72 Changed 15 years ago by markk

(In [23613]) Branch libmythui-osd: Convert the 'Ask Allow Recording' dialog to the new OSD code. Refs #7650.

(N.B. I've not been able to test with multirec.)

comment:73 Changed 15 years ago by markk

(In [23619]) Branch libmythui-osd: Update the default wide OSD theme file to inherit more from the base theme and add a default (non wide) version which is just scaled appropriately. The only problematic inheritance is the status progress bar so for the time being this is just set to some fairly dull, inoffensive blue. Refs #7650.

comment:74 Changed 15 years ago by markk

(In [23621]) Branch libmythui-osd: Convert AVSubtitles to the new OSD renderer code. Refs #7650.

comment:75 Changed 15 years ago by markk

(In [23626]) Branch libmythui-osd: Add some bounds checking in MythQImagePainter. Refs #7650.

comment:76 Changed 15 years ago by markk

(In [23655]) Branch libmythui-osd: Convert the channel editor dialog to a new custom libmythui based widget. This is not yet fully functional as the buttons do not operate outside of the main UI thread. The theme defaults may need some love. Refs #7650.

comment:77 Changed 15 years ago by markk

(In [23660]) Branch libmythui-osd: Reinstate the osd 'functional' behaviour. This is largely a signal from the OSD that a given window is no longer visible and to adjust the handling of keypress events.

Refs #7650.

comment:78 Changed 15 years ago by markk

(In [23706]) Branch libmythui-osd: Add missing files from trunk; mostly from the FFMPEG sync. Refs #7650.

comment:79 Changed 15 years ago by markk

(In [23707]) Branch libmythui-osd: Merge r23620-23706 from trunk to libmythui-osd. Refs #7650.

comment:80 Changed 15 years ago by markk

(In [23716]) Branch libmythui-osd: Add new MyhtUIEditBar widget.

This is a fully customisable widget intended as a libmythui replacement for the existing cut editor though it should be flexible enough to handle other use cases. There are seven themeable image types; the position marker, 2 for the bar itself (sections to keep and sections to cut) and 4 cut markers(keep and cut to both left and to right). Each image is optional and can be specified as either a MythUIImage or a MythUIShape.

Internally the widget uses normalised float values for the position and region information though the interface uses either double or long long (this is for simple compatability with frame numbers which are specified as long long). The default range is 0.0 to 1.0.

Refs #7650.

comment:81 Changed 15 years ago by markk

(In [23717]) Branch libmythui-osd: Add MythUIEditBar interface functions to the new OSD code along with default editbar themed screens. Refs #7650.

comment:82 Changed 15 years ago by markk

(In [23740]) Branch libmythui-osd: Add frame number and cut indicator to default OSD program editor themes. Refs #7650.

comment:83 Changed 15 years ago by markk

(In [23746]) Branch libmythui-osd: Add DeleteMap? class.

The new class encapsulates the storage, update, presentation and tracking of the delete map (in conjunction with the new OSD code) and will be used by NuppelVideoPlayer?.

This is the first stage in the process of cleaning up, simplifying and reducing the size of NuppelVideoPlayer? in advance of changing the threading behaviour within that class.

Refs #7650.

comment:84 Changed 15 years ago by markk

(In [23747]) Branch libmythui-osd: Convert the program edit code to use the new OSD and the new DeleteMap? class.

This moves the OSD dialogs into the TV class (along with all of the other dialogs), keeps the low level action handling within NuppelVideoPlayer? and passes off much of the deleteMap logic and OSD handling into DeleteMap?.

The behaviour should be largely unchanged though there are some small usability improvements (e.g. the skip distance is now preserved when moving in and out of edit mode).

Also fixes the behavour of the AlreadyEditing? OSD dialog.

Reduces the NuppelVideoPlayer? line count by almost 500...

Refs #7650.

comment:85 Changed 15 years ago by markk

(In [23755]) Branch libmythui-osd: Remove some redundant code in NuppelVideoPlayer?. Refs #7650.

comment:86 Changed 15 years ago by markk

(In [23805]) Branch libmythui-osd: Ensure certain variables in MythUIText are properly initialised before setting the draw area. Refs #7650.

comment:87 Changed 15 years ago by markk

(In [23806]) Branch libmythui-osd: Extend the MythUIShape interface to allow setting of the fill brush and line pen. This will be used to draw simple background images for closed captions without the need for themeing. Refs #7650.

comment:88 Changed 15 years ago by markk

(In [23807]) Branch libmythui-osd: Add GetSafeRect?() to VideoOutput?.

This indicates to the OSD the safe area of the screen into which captioning can be rendered. As noted in the comment, for full screen OSDs this will still restrict the safe area to the video rectangle to ensure the display of captioning is consistent between renderers and in line with the original broadcasters' intentions. Refs #7650.

comment:89 Changed 15 years ago by markk

(In [23808]) Branch libmythui-osd: Incremental changes to the CC708Window class in advance of converting the CEA 708 captioning code the use libmythui.

The changes to the ForceWhiteOnBlackText? can be reverted at a later date if necessary - they have been made to facilitate testing of the new code.

Refs #7650.

comment:90 Changed 15 years ago by markk

(In [23810]) Branch libmythui-osd: Provide direct access to the font in MythFontProperties?. This will be used to manipulate the font for closed captions.

This may not be the best way of doing it but I didn't want to start making more extensive changes to MythFontProperties? and/or MythUItext at this point.

Refs #7650.

comment:91 Changed 15 years ago by markk

(In [23812]) Branch libmythui-osd: Convert CEA-708 closed captioning to the new OSD code.

This creates a new, standalone CC708Reader (an amalgamation of the old CC708Reader base class and the NuppelVideoPlayer? code) and a new CC708Screen class (a MythScreenType? sub class). So we now have CC708Decoder, CC708Reader, CC708Window and CC708Screen...

Rendering appears to be consistent with the trunk code although I'm not 100% sure the font handling is as efficient as it could be (should it be using the global font store?). I have also settled on using the 8 font types and adjusting the styling on the fly. If this proves to be the correct way forward then the additional 8 italic font settings in the PlaybackOSD settings screen can be removed.

Refs #7650.

comment:92 Changed 15 years ago by markk

(In [23843]) Branch libmythui-osd: Convert EIA-608 and NUV teletext subtitling to the new OSD code.

This follows the CEA-708 subtitling model with a dedicate CC608Reader class that feeds data to a new CC608Screen class on demand (MythScreenType? subclass). Much of this is simply the movement of existing code from NuppelVideoPlayer? into CC608Reader with changes to variable naming and some additional locking around the output buffers - the underlying decode/read/present logic should remain unchanged.

Refs #7650.

comment:93 Changed 15 years ago by markk

(In [23861]) Branch libmythui-osd: Fix some dubious errors in Mythtranscode introduced in r23843. Refs #7650.

comment:94 Changed 15 years ago by markk

(In [23862]) Branch libmythui-osd: Remove legacy code references and/or includes. Refs #7650.

comment:95 Changed 15 years ago by markk

(In [23863]) Branch libmythui-osd: Convert Teletext handling to the new OSD code.

This is almost a straight lift and shift of the existing code but the new TeletextScreen? class is subclassed from MythScreenType? (and TeletextViewer?) instead of the old OSDType. The locking is slightly simplified as there is no longer a risk of deadlock when Teletext updates trigger OSD repaints (repainting is entirely driven via playback).

The one concern I have here is that rendering seems to be slow but it's hard to see how that can be improved without a sizeable re-write of the presentation logic (much of which is geared to full teletext pages which are probably increasingly rare anyway).

Refs #7650.

comment:96 Changed 15 years ago by markk

(In [23865]) Branch libmythui-osd: A fond farewell to 8729 lines of worthy but unemployed OSD code.

It could have been more but I gave the UDP notification class a reprieve until we know what direction that functionality will be taking.

Refs #7650.

comment:97 Changed 15 years ago by markk

(In [23873]) Branch libmythui-osd: Remove some extraneous logging and add one error check to TeletextScreen?. Refs r23863. Refs #7650.

comment:98 Changed 15 years ago by robertm

(In [23888]) Branch libmythui-osd: Support coverart, fanart, banners, and screenshots in the new MythUI OSD. These image types are currently only supported in mythvideo, recording artwork will come a bit later. Refs #7650.

comment:99 Changed 15 years ago by markk

(In [23932]) Branch libmythui-osd: Add some internal locking to the TextSubtitle? class. Refs #7650.

comment:100 Changed 15 years ago by markk

(In [23958]) Branch libmythui-osd: Add new SubtitleReader? class that encapsulates the buffering/cacheing of AVSubtitles (DVB/DVD subs) and external, text based subtitles. Refs #7650.

comment:101 Changed 15 years ago by markk

(In [23959]) Branch libmythui-osd: Add new SubtitleScreen? class that will display DVD, DVB and text based subtitles as well as DVD menu buttons.

Text based display should be unchanged with html removal, word wrapping for excessively long subtitles and similar bottom/center placement.

The implementation of AVSubtitles display has changed slightly. Expiry of old subtitles is now handled internally and the expiry time of the displayed subtitles is based upon the original, intended display time irrespective of the time at which they are displayed.

Refs #7650.

comment:102 Changed 15 years ago by markk

(In [23960]) Branch libmythui-osd: Convert DVB, DVD and text subtitles and DVD menu buttons to use the new OSD SubtitleScreen? and SubtitleReader? classes.

For consistency and ease of implementation this adds DVD menu buttons as a 'new' subtitle type.

Refs #7650.

While this is technically the last of the OSD code that needed porting, I will probably further consolidate SubtitleScreen? with CC608Screen and CC708Screen and optimise DVD menu button drawing.

comment:103 Changed 15 years ago by markk

(In [23962]) Branch libmythui-osd: Fix a subtitle positioning regression following r23960. Refs #7650.

comment:104 Changed 15 years ago by markk

(In [23963]) Branch libmythui-osd: Optimise DVD button rendering.

Use an indexed based QImage to load the button images, only display the 'background' image if it is non blank (I've yet to find a DVD that has a non-blank one) and then only render the menu button itself, which is typically a fraction of the size of the full image.

Refs #7650.

comment:105 Changed 15 years ago by markk

(In [23966]) Branch libmythui-osd: Remove the software scaling/colour conversion code from NuppelVideoPlayer?.

This has been unused since the PlaybackBox? preview window was removed and when that functionality is reinstated, the scaling etc is, I think, better handled in either a subclass of NuppelVideoPlayer? or in a dedicated VideoOutput? subclass (assuming that software scaling is still needed).

Refs #7650.

comment:106 Changed 15 years ago by markk

(In [23995]) Branch libmythui-osd: Merge r23748:23994 from trunk to libmythui-osd. Refs #7650.

comment:107 Changed 15 years ago by markk

(In [23996]) Branch libmythui-osd: Remove the last of the old OSD code references. Refs #7650.

comment:108 Changed 15 years ago by markk

(In [23997]) Branch libmythui-osd: Clear old/stale images from the OSD (an empty string passed to MythUIImage::SetFilename? will delete any existing image). Refs #7650.

comment:109 Changed 15 years ago by markk

(In [24007]) Branch libmythui-osd: Remove redundant Warpfactor code from NuppelVideoPlayer?. Refs #7650.

comment:110 Changed 15 years ago by markk

(In [24017]) Branch libmythui-osd: Add MythDVDPlayer - a new subclass of NuppelVideoPlayer? that handles DVD specific playback.

There are still several references to DoChangeDVDTrack in the base class as they are currently heavily embedded in the StartPlaying? code. These will be moved out as that method is refactored to handle threading changes.

Refs #7650.

comment:111 Changed 15 years ago by markk

(In [24031]) Branch libmythui-osd: Add new AudioPlayer? class.

This encapsulates creation and access to the underlying AudioOutput? object and is largely a straight lift and shift of existing NuppelVideoPlayer? code into the new class.

The thread behaviour remains unchanged and as before, there is no lock protection around the AddAudioData? and GetBufferStatus? methods as locking here hurts performance and should not be necessary as they are only called by the decoder and any deletion of the AudioOutput? object is triggered by the decoder thread itself.

The decoder now accesses the AudioPlayer? class directly and as such the new class structure mirrors that of other helper classes such as SubtitleReader?/CC608 reader etc, where the class is owned and controlled by NuppelVideoPlayer? but the decoder feeds data directly to the helper class.

Refs #7650.

comment:112 Changed 15 years ago by markk

(In [24032]) Branch libmythui-osd: Reinstate the 'jitterometer' output that was inadvertantly removed in r24007. Refs #7650.

comment:113 Changed 15 years ago by markk

(In [24051]) Branch libmythui-osd: Move a little more functionality into DeleteMap?. Refs #7650.

comment:114 Changed 15 years ago by markk

(In [24052]) Branch libmythui-osd: Consolidate CC608Screen and CC708Screen into SubtitleScreen?. Refs #7650.

comment:115 Changed 15 years ago by markk

(In [24076]) Branch libmythui-osd: Refactor the subtitle/caption code in NuppelVideoPlayer?.

Much of this is a straight re-arrangement of the code to bring the various captioning methods together with some simplification along the way.

The only significant change is the new NextCaptionTrack? method that adds some consistency to the selection of the first caption mode/track (ToggleCaptions?) or the next mode/track when cycling through the available tracks (ChangeCaptionTrack?). This prioritises external, text based subtitles above all others with various prioritisations after that depending upon PAL/NTSC/other (documented in the code).

Refs #7650.

comment:116 Changed 15 years ago by markk

(In [24079]) Branch libmythui-osd: Remove duplicated OSD menu entries for teletext and CC608/708 captions. Refs #7650.

comment:117 Changed 15 years ago by markk

(In [24083]) Branch libmythui-osd: Don't hide subtitles/captions when escape is pressed.

This does assume that subtitles remain active irrespective of any other OSD activity which may cause other problems but I've not spotted anything obvious to date.

Refs #7650.

comment:118 Changed 15 years ago by markk

(In [24084]) Branch libmythui-osd: Remove some unnecessary audio state tracking from NuppelVideoPlayer?. Refs #7650.

comment:119 Changed 15 years ago by markk

(In [24085]) Branch libmythui-osd: Remove sundry redundant and unused code from NuppelVideoPlayer?. Refs #7650.

comment:120 Changed 15 years ago by markk

(In [24086]) Branch libmythui-osd: Add MythCommFlagPlayer?, another subclass of NuppelVideoPlayer? dedicated to (re)building seektables. Refs #7650.

comment:121 Changed 15 years ago by markk

(In [24087]) Branch libmythui-osd: Cruft removal missed in r24086. Refs #7650.

comment:122 Changed 15 years ago by markk

(In [24112]) Branch libmythui-osd: Add CommBreakMap?, a new class that encapsulates the commercial skip list, state tracking within that list and skip behaviour.

Behaviour should be unchanged as I have not touched the code logic and indeed much of the code is lifted directly from NuppelVideoPlayer?, with minor renaming and some factoring out of actual jump code that remains within the parent.

Refs #7650.

comment:123 Changed 15 years ago by markk

(In [24171]) Branch libmythui-osd: Merge r23995:24147 from trunk to libmythui-osd. Refs #7650.

comment:124 Changed 15 years ago by markk

(In [24172]) Branch libmythui-osd: Add new files missed in r24171. Refs #7650.

comment:125 Changed 15 years ago by markk

(In [24173]) Branch libmythui-osd: Merge r24148:24172 from trunk to libmythui-osd. Refs #7650.

comment:126 Changed 15 years ago by markk

(In [24174]) Branch libmythui-osd: Remove some unused parameters in NuppelVideoPlayer?. Refs #7650.

comment:127 Changed 15 years ago by markk

(In [24178]) Branch libmythui-osd: Remove more unused and redundant code from NuppelVideoPlayer?. Refs #7650.

comment:128 Changed 15 years ago by markk

(In [24181]) Branch libmythui-osd: Don't create a new decoder thread in PlayerContext?.

N.B. This is the first step in changing the threading behaviour in NuppelVideoPlayer?. It completely breaks playback and it will broken for some time.

Refs #7650.

comment:129 Changed 15 years ago by markk

(In [24182]) Branch libmythui-osd: Remove more decoder thread related code. see r24181. Refs #7650.

comment:130 Changed 15 years ago by markk

(In [24183]) Branch libmythui-osd: Rename and repurpose VideoThread? for the decoder loop, rename and repurpose VideoTimer? as a general playback loop, create various sub-elements of the overall playback loop (video, audio, decoder and 'event') and move the decoder into the new decoder thread.

This is an initial commit that at least partially fixes playback and creates the structures that will be used for the main playback initialisation, looping and destruction. Many assumptions around threading are still borken and hence various actions will cause lockups in playback (e.g. pause!).

The OSD thread related errors are now fixed (as video playback is in the main UI thread) and while VDPAU playback is generally fine, there is a serious performance issue for XVideo/OpenGL (cause unknown - but presumably VDPAU is unaffected as the driver effectively passes off rendering to another thread).

Refs #7650.

comment:131 Changed 15 years ago by markk

(In [24185]) Branch libmythui-osd: Populate the EventLoop? method with the bulk of the code from DecoderLoop?.

For the time being this creates as many problems as its fixes but the final aim is to ensure DecoderLoop? is a simple loop that fills the buffers and responds to simple state change requests from the playback thread (i.e. pause and seek).

Refs #7650.

comment:132 Changed 15 years ago by markk

(In [24186]) Branch libmythui-osd: Start to refactor the decoder functionality.

Rename GetFrame? (and associated members) to DecoderGetFrame? to reinforce the intention that it should only be called from within the decoder thread, add new code for pausing and unpausing the decoder and bring together the member functions that are decoder related.

Refs #7650

comment:133 Changed 15 years ago by markk

(In [24187]) Branch libmythui-osd: Remove the killvideo member var from NuppelVideoPlayer?. Refs #7650.

comment:134 Changed 15 years ago by markk

(In [24188]) Branch libmythui-osd: Implement seeking in the new decoder loop.

The decoder methods DoRewind? and DoFastForward? are now only called from within the decoder loop itself, either from DecoderGetFrame? (when play_speed != 1) or from DecoderLoop? when a seek is requested from the main thread.

Refs #7650.

comment:135 Changed 15 years ago by markk

(In [24189]) Branch libmythui-osd: Clean up seeking in the main player thread.

Explicitly pass the seek amount to DoFastForward? and DoRewind? (there is no longer a need to maintain this as a member variable in most cases) and bring some consistency to the setting of exact seeks for the decoder.

Refs #7650.

comment:136 Changed 15 years ago by markk

(In [24190]) Branch libmythui-osd: Rework pausing in the main thread following threading changes.

Generally, this is now much simpler and indeed some of the locking is propably unnecessary but can be tidied up at a later date. (N.B. This is still incomplete.)

Refs #7650.

comment:137 Changed 15 years ago by markk

(In [24208]) Branch libmythui-osd: Rework playspeed handling.

This consolidates the DoPause/DoPlay? method into the new ChangeSpeed? method, removes the fastforward/rewind check from the decoder loop (currently only partially replaced in the main event loop) and triggers speed changes directly from the Pause/Play? methods rather than Pause/UnpauseDecoder?.

Refs #7650.

comment:138 Changed 15 years ago by markk

(In [24209]) Branch libmythui-osd: Fix some segmentation faults when transitioning between programs (i.e. mortly live tv). There is still a problem in SwitchToProgram? that I haven't yet tracked down.

Refs #7650.

comment:139 Changed 15 years ago by markk

(In [24212]) Branch libmythui-osd: Move the last of the DVD specific code from NuppelVideoPlayer? into MythDVDPlayer. Refs #7650.

comment:140 Changed 15 years ago by markk

(In [24216]) Branch libmythui-osd: Improved exiting of the decoder loop.

Exit the decoder loop first to avoid a deadlock, allow longer for the loop to exit (and show some debug output) and avoid some potential crashes in DecoderGetFrame?. Refs #7650.

comment:141 Changed 15 years ago by markk

(In [24217]) Branch libmythui-osd: Remove a now unnecessary call to NuppelVideoPlayer::OpenFile? from PlayerContext?.

This significantly improves startup times (around 3 seconds quicker on my remote ION frontend), suppresses some unexpected libav debugging output and fixes playback of certain container formats (mkv, glv).

Refs #7650

comment:142 Changed 15 years ago by markk

(In [24218]) Branch libmythui-osd: Suppress an entirely sensible compiler warning. Refs #7650.

comment:143 Changed 15 years ago by markk

(In [24244]) Branch libmythui-osd: Fix the worst of the OpenGL playback performance regression following the threading changes. Refs #7650.

comment:144 Changed 15 years ago by markk

(In [24260]) Branch libmythui-osd: Refactor the prebuffering code in NuppelVideoPlayer?.

Refs #7650.

comment:145 Changed 15 years ago by markk

(In [24263]) Branch libmythui-osd: Move the call to SyncPositionMap? back into the decoder thread. Refs #7650.

comment:146 Changed 15 years ago by markk

(In [24266]) Branch libmythui-osd: Improved pause/unpause handling.

Firstly, don't try and decode a frame if ffrew_skip == 0 as this causes unnecessary seeks after the decoder has been unpaused but before the speed change code has been triggered.

Secondly don't trigger a seek and reset when we are moving between the pause/unpause state in normal (ie. non rewind/fastforward) playback. By and large the image on the screen is the correct one and there is no need to adjust the position (the potential exception is when multi-frame deinterlacers are in use and the frame may be off by one). Any remaining visual adjustments as playback is restarted are (I'm pretty sure) triggered by the av sync code.

This also fixes an issue where the player would seek to the beginning of the file and not pause when using OpenGL playback.

Refs #7650.

comment:147 Changed 15 years ago by markk

(In [24271]) Branch libmythui-osd: Further pause frame improvements.

When we are already paused and require a fresh pause frame, signal the decoder thread to try and decode one frame until there is at least one frame in the used queue. Also allow fastforward/rewind to occur when the play speed is zero so that skipping while paused is actioned.

This should eliminate all remaining pause frame issues in the branch.

Refs #7650.

comment:148 Changed 15 years ago by markk

(In [24277]) Branch libmythui-osd: Fix DVD still frame handling following r24260. Refs #7650.

comment:149 Changed 15 years ago by markk

(In [24281]) Branch libmythui-osd: Merge r24173:24279 from trunk. Refs #7650.

comment:150 Changed 15 years ago by markk

(In [24282]) Branch libmythui-osd: Clean up state handling when near the end of a file.

Firstly, ensure the decoder loop does not attempt any further decoding when the eof is seen, unless in livetv (although if the rest of the code is working correctly, eof should not be seen in livetv). This is largely cosmetic as it avoids spamming the log with decoder errors.

Secondly, end playback if eof is set outside of livetv. This should be a last resort as, again, if the rest of the code is working correctly, the tv object should have already detected the end of file and either prompted the user for the appropriate action to take or ended playback directly.

Thirdly, tidy up detection and stopping of fastforward, timestretch etc when near the end of the file. This ensures normal playback is triggered in all cases and the tv object can then handle a graceful exit.

Finally, add some comments on the main actions within EventLoop?.

Refs #7650.

comment:151 Changed 15 years ago by markk

(In [24297]) Branch libmythui-osd: Fix commercial flagging. This is not extensively tested and it is likely there are outstanding issues but this, at least, should ensure it works. Refs #7650.

comment:152 Changed 15 years ago by markk

(In [24298]) Branch libmythui-osd: Increase the video buffering timeout - 5 seconds was insufficient for some channel changes. This may need further adjustment. Refs #7650.

comment:153 Changed 15 years ago by markk

(In [24378]) Branch libmythui-osd: Cleanup JumpToProgram? and SwitchToProgram? pause/unpause handling.

While this does help with occasional channel change instability, it will probably have an adverse impact on livetv program switches as playback is now fully paused while the switch takes place - whereas previously the decoder and buffer where paused and video playback would be unaffected if the buffer change was fast enough.

Refs #7650.

comment:154 Changed 15 years ago by markk

(In [24379]) Branch libmythui-osd: Fix a sizeable performance problem with the YUVA (Xvideo) OSD by ensuring endless repaints are disabled. Refs #7650.

comment:155 Changed 15 years ago by markk

(In [24381]) Branch libmythui-osd: Ensure dialogs are cleared immediately when using the YUVA OSD (XVideo). Refs #7650.

comment:156 Changed 15 years ago by markk

(In [24422]) Branch libmythui-osd: Cleanup inheritance in MythRenderOpenGL and remove the custom swapBuffers implementation which is not required. Refs #7650.

comment:157 Changed 15 years ago by markk

(In [24426]) Branch libmythui-osd: Merge r24281:24425 from trunk. Refs #7650.

comment:158 Changed 15 years ago by markk

(In [24427]) Branch libmythui-osd: Refactor how we override the main UI scale when loading the OSD. Refs #7650.

comment:159 Changed 15 years ago by markk

(In [24446]) Branch libmythui-osd: Extend MythMainWindow? to allow the UI screen rectangle to be overridden. This will be used by the OSD code as the UI screen rect is used in, for example, MythScreentype? to calculate some position info. Refs #7650.

comment:160 Changed 15 years ago by markk

(In [24447]) Branch libmythui-osd: Extend MythDialogBox? to allow loading the dialog directly from the osd theme file.

This is necessary for the YUVA OSD where the OSD dimemsions will not necessarily match those of the existing, pre-loaded MythDialogBox? and hence we require a fresh (and potentially customised) version.

Refs #7650.

comment:161 Changed 15 years ago by markk

(In [24448]) Branch libmythui-osd: Further improvements to the temporary theme scale overrides in the OSD class and force loading of the OSD specific MythPopupBox? for the OSD dialogs.

N.B. Until some OSD themes, or at least the default theme, include MythPopupBox? windows, the OSD dialogs and menu will not work.

Refs #7650.

comment:162 Changed 15 years ago by markk

(In [24487]) Branch libmythui-osd: Ensure all MythPainterYUVA OSD images are stored internally as QImage::Format_ARGB32.

Certain QImage manipulations, notable scaling, return QImage's with the data stored pre-multiplied. The YUV blending routines assume the QImages are in the standard format (although the base 'canvas' is in the pre- unexpected results.

This will also be an issue for the OpenGL, VDPAU and Direct3D painters, although in those cases the rendering problems are more subtle.

Refs #7650.

comment:163 Changed 15 years ago by markk

(In [24523]) Branch libmythui-osd: Correctly size and position the YUV blended OSD when the fill/aspect/zoom is overriden and fix re-initialisation following a change.

  • this mimics the behaviour of the old code to ensure that the OSD

displays within the visible area of the video frame. The positioning is only applied to the 'normal' OSD windows and dialogs - subtitle/teletext/MHEG screens are currently untouched to provide consistency of presentation between the blended and hardware accelerated ODSs. There are undoubtedly some edge cases that I've missed here.

  • the re-initialistion is still incomplete as there are OSD elements

that are not reinitialised - most notably dialogs - following a switch. (This can affect all types of OSD - not just the YUV blended version).

  • pause the decoder during re-initialisation to prevent it from trying

to feed subtitle/teletext data to objects that may be re-created.

Refs #7650.

comment:164 Changed 15 years ago by markk

(In [24558]) Branch libmythui-osd: Merge r24426:24557 from trunk. Refs #7650.

comment:165 Changed 15 years ago by markk

(In [24588]) Branch libmythui-osd: Fix the default-wide OSD theme.

Most importantly this fixes the theme for XVideo/blended YUV OSD playback by:-

  • ensuring all imagetype elements have an explicit area defined and not

just a position. This forces the proper scaling.

  • explicitly (re)define all of our fonts so that the definitions are

reloaded and appropriately scaled for each initialisation of the OSD.

  • remove all inheritance from the base theme. This prevents the use of

fonts and images with potentially different scaling already applied.

This greatly increases the size of the OSD themes, not least because there is currently nowhere to define a base OSD element and hence items such as fonts are redefined for each window.

Secondly, this aligns the theme more closely with the original BlackCurves? OSD (the current default OSD theme) with influences and elements from the Mythbuntu UI theme (most notably the menu dialog).

The Channel Editor will need further work once it works properly.

Refs #7650

comment:166 Changed 15 years ago by markk

(In [24589]) Branch libmythui-osd: Add 2 Mythbuntu arrow images to the default directory (used by the menu dialog). Refs #7650

comment:167 Changed 15 years ago by markk

(In [24590]) Branch libmythui-osd: Add an OSD definition for the Terra theme. This is currently just the menu dialog and all other elements will fall back to the wide defaults.

The menu is a straight lift and shift of the Terra MythPopupBox? definition, adjusted to redefine the fonts and with the grey watermark removed (I felt it didn't translate well to the OSD and impacts on XVideo performance).

Refs #7650

comment:168 Changed 15 years ago by markk

(In [24591]) Branch libmythui-osd: Add an OSD to the MythCenter?-wide theme. As for Terra, this is currently just the menu dialog and all other elements will fall back to the defaults. Refs #7650

comment:169 Changed 15 years ago by markk

(In [24593]) Branch libmythui-osd: Forgot the recent fontdef changes for Terra and MythCenter?-wide. Refs #7650

comment:170 Changed 15 years ago by markk

(In [24594]) Branch libmythui-osd: Add a 'Toggle Text Subtitles' entry to the OSD menu when text subtitles are available. This compliments the changes to the default subtitle selection and cycling through available subtitles. Refs #7650.

comment:171 Changed 15 years ago by markk

(In [24649]) Branch libmythui-osd: Clean up the swapInterval settings passed to QGLFormat and add some direct rendering debug output. Refs #7650.

comment:172 Changed 15 years ago by markk

(In [24653]) Branch libmythui-osd: Add GLX_SGI_video_sync support to MythRenderOpenGL. Refs #7650

comment:173 Changed 15 years ago by markk

(In [24654]) Branch libmythui-osd: Remove debug code accidentally committed in r24653. Refs #7650

comment:174 Changed 15 years ago by markk

(In [24655]) Branch libmythui-osd: Convert OpenGLVideoSync to using MythRenderOpenGL.

N.B. OpenGL VSync does not appear to work currently in the libmythui-osd branch - though it is unrelated to this commit.

Refs #7650

comment:175 Changed 15 years ago by markk

(In [24656]) Branch libmythui-osd: Remove the now redundant OpenGLContext and much of the supporting code in util-opengl. Refs #7650

comment:176 Changed 15 years ago by markk

(In [24686]) Branch libmythui-osd: Fix a regression introduced in r24181. Probably fixes a number of other issues as well (in fact, I'm not sure why anything has been working for a while). Refs #7650.

comment:177 Changed 15 years ago by markk

(In [24687]) Branch libmythui-osd: Increase the main thread priority when playback starts and drop it down again when playback end. Refs #7650.

comment:178 Changed 15 years ago by markk

(In [24695]) Branch libmythui-osd: Fix alpha blending for the VDPAU osd.

Alpha blending is currently broken for the VDPAU, OpenGL and Direct3D OSDs as we render to a separate buffer which is then blended onto the video frame. The buffer needs to have a default alpha of zero to ensure the video is visible in blank areas which in turn breaks alpha blending when we draw to that surface.

There are a few possible solutions but by far the simplest is to just render the OSD elements directly to the output surface for each presented frame. While this is theoretically slower, as we no longer buffer/cache the rendered OSD, I can't actually see a measurable difference in performance. It also marginally reduces the video memory requirements.

Fixes for OpenGL and Direct3D to follow.

Refs #7650.

comment:179 Changed 15 years ago by markk

(In [24696]) Branch libmythui-osd: Fix alpha blending for the OpenGL OSD. Refs r24695. Refs #7650.

comment:180 Changed 15 years ago by markk

(In [24704]) Branch libmythui-osd: Correct the font aspect ratios for the YUVA painter.

Adjust the stretch property of the font to ensure its aspect ratio is consistent when blended into a YV12 frame that is then subsequently scaled. This mimics the behaviour of the old OSD code.

Refs #7650.

comment:181 Changed 15 years ago by markk

(In [24705]) Branch libmythui-osd: Cleanup the remains of the OSD compatibility code. Refs #7650.

comment:182 Changed 15 years ago by markk

(In [24707]) Branch libmythui-osd: Update the default osd for recent changes. See r24588. Refs #7650.

comment:183 Changed 15 years ago by markk

(In [24716]) Branch libmythui-osd: Fix a segmentation fault with the ia44 blended OSD. This ensures the SubtitleScreen/TeletextScreen? area is properly initialised. Additional range checking is still required within the blend code however. Refs #7650.

comment:184 Changed 15 years ago by markk

(In [24729]) Branch libmythui-osd: Add some bounds checking before YUV/IA44 blending. Refs #7650.

comment:185 Changed 15 years ago by markk

(In [24732]) Branch libmythui-osd: Optimise SubtitleScreen? rendering.

Previously, the area of SubtitleScreen? was set to the maximum required visible area. This was extremely inefficient when using software based rendering as the actual area of visible captions is usually much smaller. Instead we re-calculate the minimum bounding area for displayed captions and adjust accordingly.

Refs #7650.

comment:186 Changed 15 years ago by markk

(In [24733]) Branch libmythui-osd: Optimise TeletextScreen? rendering. See r24732 for background. Refs #7650.

comment:187 Changed 15 years ago by markk

(In [24734]) Branch libmythui-osd: Fix video resizing for interactive TV when using software based OSDs. This has presumably been broken in trunk and the branch for some time. Refs #7650.

comment:188 Changed 15 years ago by markk

(In [24736]) Branch libmythui-osd: Add a custom OSD screen for interactive television (MHEG).

This allows us to optimise rendering for software based OSD blending (see r24732:24733 for details) and ensure that any video resizing is reset when the interactive display is cleared.

Refs #7650.

comment:189 Changed 15 years ago by markk

(In [24737]) Branch libmythui-osd: Merge r24558:24693 from trunk. Refs #7650.

comment:190 Changed 15 years ago by markk

(In [24750]) Branch libmythui-osd: Merge r24694 from trunk. Refs #7650.

That was fun...

comment:191 Changed 15 years ago by markk

(In [24754]) Branch libmythui-osd: Merge r24694:24750 from trunk. Refs #7650.

comment:192 Changed 15 years ago by markk

(In [24756]) Branch libmythui-osd: Various fixes to bring the branch in line with trunk following recent merges. Refs #7650

comment:193 Changed 15 years ago by markk

(In [24757]) Branch libmythui-osd: More merge fixes. Refs #7650

comment:194 Changed 15 years ago by markk

(In [24760]) Branch libmythui-osd: More merge fixes. Refs #7650

comment:195 Changed 15 years ago by markk

(In [24761]) Branch libmythui-osd: Fix a segmentation fault introduced in r24736. Refs #7650

comment:196 Changed 15 years ago by markk

(In [24782]) Branch libmythui-osd: Rework the addition/removal of PiP players to NuppelVideoPlayer?. This allows PiP to work again, though until the PiP player is spun off into a different thread, performance is terrible. Refs #7650.

comment:197 Changed 15 years ago by markk

(In [24784]) Branch libmythui-osd: Fix Picture in Picture.

If the player is a PiP, create a new QThread and launch its event loop to control the player. Refs #7650.

comment:198 Changed 15 years ago by markk

(In [24805]) Branch libmythui-osd: Fix escape handling when using Interactive tv.

This ensures that the interactive screen does invisibly handle an escape action when it is enabled but not visible. Refs #7650.

comment:199 Changed 15 years ago by markk

(In [24807]) Branch libmythui-osd: Merge r24751:24805 from trunk. Refs #7650

comment:200 Changed 15 years ago by markk

(In [24822]) Merge libmythui changes from the libmythui-osd branch.

In summary:

  • Add 2 new hardware rendering contexts, MythRenderOpenGL and

MythRenderD3D9 (MythRenderVDPAU was added prior to the 0.23 release).

  • Add 3 new theme painters, MythD3D9Painter, MythQImagePainter (for

rendering directly to a QImage) and MythYUVAPainter (a sub-class of MythQImagePainter that converts all rendering to the YUV colorspace).

  • Add 1 new MythUI widget, MythUIEditBar, which will be used to add

themed, edit functionality to the OSD (there is no reason why it cannot be used in the main UI).

  • Make various improvements to the painter classes and convert them to

use the new hardware rendering contexts where appropriate.

  • Sundry small changes to other libmythui classes to better facilitate

the new OSD rendering code.

There should be no visual difference in the rendering of the main UI using either the Qt or OpenGL painters.

Direct3D9 rendering can be enabled using 'mythfrontend -O ThemePainter?=d3d9' but I have not added this to the settings as I am still unsure whether it is worthwhile having both Direct3D9 and OpenGL rendering.

Refs #7650

comment:201 Changed 15 years ago by markk

(In [24823]) Merge the new OSD theme files from the libmythui-osd branch.

This adds complete, though not necessarily visually stunning, default and default-wide OSD themes and partial themes for Terra, MythCenter? and MythCenter?-wide. The partial themes contain only a MythPopupBox? definition for the OSD menu dialog.

Clearly these will not actually do anything yet.

It should be noted that, currently, inheritance from outside of a window should be avoided for OSD themes and all images should have their area explicitly defined (and not just their position) to ensure they are properly scaled.

Refs #7650

comment:202 Changed 15 years ago by markk

(In [24828]) Branch libmythui-osd: Merge r24805:24821 from trunk. Refs #7650

comment:203 Changed 15 years ago by markk

(In [24844]) Branch libmythui-osd: Fix the OpenGL green screen during live TV. Refs #7650.

comment:204 Changed 15 years ago by markk

(In [24860]) Branch libmythui-osd: Fix a regression in commercial skipping following the ProgramInfo? refactor. Refs #7650.

comment:205 Changed 15 years ago by markk

(In [24861]) Branch libmythui-osd: Merge r24822:24846 from trunk. Refs #7650.

comment:206 Changed 15 years ago by markk

(In [24871]) Branch libmythui-osd: Merge r24846:24861 from trunk. Refs #7650.

comment:207 Changed 15 years ago by markk

(In [24872]) Branch libmythui-osd: Merge r24861:24871 from trunk. Refs #7650.

comment:208 Changed 15 years ago by markk

(In [24873]) Branch libmythui-osd: Add missing files following audio branch merge. Refs #7650

comment:209 Changed 15 years ago by markk

(In [24945]) Branch libmythui-osd: Merge r24871:24943 from trunk. Refs #7650.

comment:210 Changed 15 years ago by markk

(In [24946]) Branch libmythui-osd: Fix enabling of edit mode.

The hd audio branch merge altered the timing/behaviour of audio pausing and as a result the result of the pause method was not always positive, which prevented the edit mode from being enabled. I've not seen this impact the desired behaviour elsewhere so just relax the test post pause before enabling edit mode.

Refs #7650.

comment:211 Changed 15 years ago by markk

(In [24949]) Branch libmythui-osd: Clean up some debugging. Refs #7650.

comment:212 Changed 15 years ago by markk

(In [24950]) Branch libmythui-osd: Remove some redundant caption code. Refs #7650.

comment:213 Changed 15 years ago by markk

(In [24951]) Branch libmythui-osd: Fix disappearing DVD subtitles when jumping.

The ClearSubtitlesOSD call is unnecessary here as subtitles will be disabled in the next section of code if a menu is entered. Refs #7650.

comment:214 Changed 15 years ago by markk

(In [24954]) Branch libmythui-osd: Revert r24951.

This creates more problemes than it fixes and for the moment some disappearing DVD subtitles is the lesser of 2 evils. Refs #7650.

comment:215 Changed 15 years ago by markk

(In [24971]) Branch libmythui-osd: Merge r24943:24970 from trunk. Refs #7650

comment:216 Changed 15 years ago by markk

(In [24972]) Merge the libmythui-osd branch into trunk.

These are the outstanding libmythtv changes along with some smaller updates in mythtranscode and mythcommflag.

Expectation management paragraph

  • this is a highly invasive merge that touches almost every aspect of

video playback.

  • there are undoubtedly more issues that haven't surfaced.
  • the theme re-write is not complete - so you may not even see any

benefit yet.

  • the new OSD may not behave exactly as it used to - this may not be a

bug.

Known outstanding bugs/issues:-

  • The channel editor (live tv) does not work.
  • OpenGL vsync does not work (it thinks its working but you will see

tearing).

  • Some subtitle and dvd button issues during dvd playback.
  • Alpha blending inconsistencies in the Direct3D OSD.
  • Some settings need removing.
  • Teletext rendering desperately needs some optimisation.

Major changes

  • Convert the VideoOutput? classes to use the new libmythui rendered OSD

by way of the new OSD class.

  • Update software blending code (softblend, chromakey and ia44 OSDs)

accordingly.

  • Remove the old OSD code and helper classes.
  • Create 2 new sub-classes of NuppelVideoPlayer? - MythDVDPlayer and

MythCommflagPlayer? to handle the specifics of DVD playback and commercial flagging.

classes, including:-

  • AudioPlayer? - a wrapper around the actual audio object and

associated methods.

PlayerContext?)

  • this ensures the player is within the main UI thread to keep Qt

happy

Refs #7650

comment:217 Changed 15 years ago by markk

(In [24973]) Fix NuppelVideoPlayer::IsNearEnd? prototype following the libmythui-osd merge.

This fixes the reported compilation issue but IsNearEnd? clearly needs a little more work following the ProgramInfo? refactor - there are definitely some sign issues (refs #8527).

Refs #7650

comment:218 Changed 15 years ago by markk

(In [24974]) Symbol visibility fixes for new classes post libmythui-osd merge, with patch from iamlindoro.

Refs #7650.

comment:219 Changed 15 years ago by markk

(In [25025]) Fix destruction of the OSD class.

Firstly, ensure the OSD object is deleted before VideoOutput? as MythImages? in the OSD/UI cache are 'owned' by the painter object within VideoOutput?.

Secondly, delete the OSD screens immmediately - which avoids sundry potential issues with referencing already deleted objects.

Should fix the subtitling and MHEG crashes/hangs seen since the osd branch merge.

Refs #7650.

comment:220 Changed 15 years ago by markk

(In [25028]) Remove a stray include missed in the libmythui-osd merge. Refs #7650. Closes #8540.

comment:221 Changed 15 years ago by markk

(In [25033]) Respect the requested expiry of certain OSD status updates. This restores the previous behaviour of not fading out the OSD when paused and when fast forwarding/rewinding.

Refs #7650.

comment:222 Changed 15 years ago by markk

(In [25077]) Fix lossless MPEG2 transcode following the osd branch merge.

This was caused by a slight change in behaviour in the cut list, which may now start with an 'end' marker. If this causes any other problems I may revert this commit and look at reverting to the old cut list approach.

Refs #7650. Fixes #8546.

comment:223 Changed 15 years ago by markk

(In [25087]) Revert r25077. This causes the cutlist to be applied incorrectly so the originally reported failure is a better interim measure than lost recordings.

Refs #7650.

comment:224 Changed 15 years ago by markk

(In [25092]) Ensure AVSubtitle data is freed if DVB/DVD subtitles are not enabled.

Refs #8555. Refs #7650.

comment:225 Changed 15 years ago by markk

Resolution: fixed
Status: acceptedclosed
Note: See TracTickets for help on using tickets.