Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#6211 closed defect (fixed)

program guide (epg) preview window not scaled properly on OS X

Reported by: risto78@… Owned by: markk
Priority: minor Milestone: unknown
Component: Ports - OSX Version: 0.21-fixes
Severity: high Keywords:
Cc: Stuart Auchterlonie Ticket locked: no

Description (last modified by Nigel)

when displaying the program guide on OS X, the live tv preview window is merely offset but not scaled

the embedded window is shown at the size of the display, so it overlaps the guide and runs past the edge of the screen it looks like the mainwindow viewport is resized instead for some reason

DEBUG OUTPUT: (using -v most)

2009-02-01 15:18:12.658 Disabled deinterlacing
2009-02-01 15:18:12.658 VideoOutputQuartz::EmbedInWidget(wid=3195, x=777, y=33, w=347, h=197)
2009-02-01 15:18:12.659 Display Rect  left: 777, top: 33, width: 347, height: 197, aspect: 1.33333
2009-02-01 15:18:12.659 Video Rect    left: 0, top: 0, width: 720, height: 480, aspect: 1.33333
2009-02-01 15:18:12.659 Main window: Viewport is 347 x 197
2009-02-01 15:18:12.659 Main window: Image is 720 x 480
2009-02-01 15:18:12.659 Main window: Scaling to 0.481944 x 0.410417 of original
2009-02-01 15:18:12.659 Main window: Translating to 777, 33
2009-02-01 15:18:12.692 Embedded window: Viewport currently 0,0 -> 1152,656
2009-02-01 15:18:12.693 Embedded window: Viewport is 1152 x 656
2009-02-01 15:18:12.693 Embedded window: Image is 720 x 480
2009-02-01 15:18:12.693 Embedded window: Scaling to 1.6 x 1.36667 of original
2009-02-01 15:18:12.693 Embedded window: Translating to 777, 33

Attachments (6)

fix.QuartzOutput-0.23-r24879.patch (14.8 KB) - added by chr 8 years ago.
fixes quartz video renderer on OsX
0001-NVP-decrease-kDecoderProbeBufferSize-to-128k.patch (1.6 KB) - added by chr 8 years ago.
0002-fixing-embed-video-on-osx-quartz-renderer-part1.patch (11.7 KB) - added by chr 8 years ago.
0003-fixing-embed-video-on-osx-quartz-renderer-part2.patch (2.9 KB) - added by chr 8 years ago.
0004-PPC-fixing-endian.patch (12.6 KB) - added by chr 8 years ago.
0005-Well-increasing-kDecoderProbeBufferSize-to-1MB-for-w.patch (3.5 KB) - added by chr 8 years ago.

Download all attachments as: .zip

Change History (37)

comment:1 Changed 9 years ago by risto78@…

it's been a month can we please get this at least assigned to someone who looks at Mac OS Tickets? eg nigel or danielk

comment:2 Changed 9 years ago by Nigel

Description: modified (diff)
Owner: changed from Isaac Richards to Nigel
Status: newassigned

One month? That's nothing. The embedded TV window has been broken in one way or another since the start of the OS X port (thats late 2004). I don't use that feature. Note that assigning it to someone can often mean it is ignored for longer because other devs think "OK, Nigel is dealing with that one!"
Anyway, in trunk, the embedded window scales OK if Live TV is configured to start in the guide, but the guide is never displayed (probably because the clipping region is the size of the entire window?). After exiting the guide, the small embedded window area remains. If normal LiveTV is started, and the EPG is enabled, the window never scales down, and then the TV image stays in the window (i.e. the menu is never displayed after exiting TV). I will examine fixes when I have time (this is a busy few months for me)

comment:3 Changed 9 years ago by Phil

I'm seeing this issue also. I went back through Sniderpad's builds and it seems that it first appeard in: 20081110 SVN Revision 19001

20081103 SVN Revision 18900 appears to scale OK.

Also, I don't know if it's related but I'm also seeing Mythfrontend crash every time that the program guide displayed. This also was introduced in the same build.

comment:4 Changed 9 years ago by Phil

Sorry for the extra comment - but is there a way to just disable the preview in the guide as a way to work around the scaling and crash issue? I haven't found anything in the setup options for this.

comment:5 Changed 9 years ago by jyavenard@…

To disable EPG,

in mythtv/libs/libmythtv/videooutbase.cpp

in function: void VideoOutput::EmbedInWidget?(WId wid, int x, int y, int w, int h)

replace:

if (!allowpreviewepg)

return;

with: if (!allowpreviewepg)

return;

Recompile

comment:6 Changed 9 years ago by Nigel

(In [20620]) Scale embedded playback window properly. Refs #6211.

comment:7 Changed 9 years ago by dstrang@…

I've tested this patch; I can confirm that it works - the embedded playback window does scale, and it doesn't crash MythFrontend anymore.

However, there is a small issue - If you "escape" out of the guide, the playback window does not scale back to the original size.

comment:8 Changed 9 years ago by anonymous

I haven't had that occur, but the aspect in the embedded window, and the main window after escaping, can be wrong. There are also occasional crashes when "always display the guide"is set:

2009-05-30 11:37:28.864 VOQV::Begin(Main window: ) - No graphics port available
2009-05-30 11:37:28.873 Embedded window: Viewport currently 0,0 -> 800,600
2009-05-30 11:37:28.873 Embedded window: Viewport is 240 x 180
2009-05-30 11:37:28.873 Embedded window: Image is 720 x 576
2009-05-30 11:37:28.873 Embedded window: Scaling to 0.333333 x 0.3125 of original
2009-05-30 11:37:28.873 Embedded window: Translating to 540, 20
2009-05-30 11:37:28.874 Display Rect  left: 540, top: 42, width: 240, height: 135, aspect: 1.33333
2009-05-30 11:37:28.874 Video Rect    left: 0, top: 0, width: 720, height: 576, aspect: 1.77778
2009-05-30 11:37:28.874 Main window: Viewport is 240 x 135
2009-05-30 11:37:28.874 Main window: Image is 720 x 576
2009-05-30 11:37:28.874 Main window: Scaling to 0.333333 x 0.234375 of original
2009-05-30 11:37:28.874 Main window: Translating to 540, 42
2009-05-30 11:37:28.874 SetVideoFrameRate(25)
2009-05-30 11:37:29.715 NVP: ClearAfterSeek(1)

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
[Switching to process 11912 thread 0x6f0f]
0xffff08f0 in ___memcpy () at /System/Library/Frameworks/System.framework/PrivateHeaders/i386/cpu_capabilities.h:228
228     /System/Library/Frameworks/System.framework/PrivateHeaders/i386/cpu_capabilities.h: No such file or directory.
        in /System/Library/Frameworks/System.framework/PrivateHeaders/i386/cpu_capabilities.h
(gdb) where
#0  0xffff08f0 in ___memcpy () at /System/Library/Frameworks/System.framework/PrivateHeaders/i386/cpu_capabilities.h:228
#1  0xc93c6b10 in TTFFont::render_text ()
Previous frame inner to this frame (corrupt stack?)

comment:9 Changed 9 years ago by anonymous

Debug build:

[Switching to process 18096 thread 0x7127]
0xc935104e in TTFFont::duplicate_raster (this=0x19578810, bmap=0x19572b10) at ttfont.cpp:137
137             memcpy(new_rmap->bitmap, bmap->bitmap.buffer, new_rmap->size);
(gdb) where
#0  0xc935104e in TTFFont::duplicate_raster (this=0x19578810, bmap=0x19572b10) at ttfont.cpp:137
#1  0xc93523ee in TTFFont::render_text (this=0x19578810, rmap=0x19540aa0, rchr=0x1c8d0dc0, text=@0x1954fa8c, xorblah=0xb0526748, yor=0xb0526744, double_size=false) at ttfont.cpp:257
#2  0xc93527e3 in TTFFont::DrawString (this=0x19578810, surface=0x1a165000, x=0, y=24, text=@0x1954fa8c, maxx=-1, maxy=132, alphamod=256, double_size=false) at ttfont.cpp:455
#3  0xc92d6c94 in OSDTypeText::DrawString (this=0x1954fa20, surface=0x1a165000, rect={y1 = 24, x1 = 0, y2 = 132, x2 = -1}, text=@0x1954fa8c, fade=1000000, maxfade=1000000, xoff=0, yoff=0, doubl=false) at osdtypes.cpp:1248
#4  0xc92e3368 in OSDTypeText::Draw (this=0x1954fa20, surface=0x1a165000, fade=1000000, maxfade=1000000, xoff=0, yoff=0) at osdtypes.cpp:1092
#5  0xc92da040 in OSDSet::Draw (this=0x1954e960, surface=0x1a165000, actuallydraw=true) at osdtypes.cpp:600
#6  0xc92ccae2 in OSD::Display (this=0x195c4ed0) at osd.cpp:2602
#7  0xc93006e5 in VideoOutput::DisplayOSD (this=0x388b600, frame=0x3890e98, osd=0x195c4ed0, stride=-1, revision=-1) at videooutbase.cpp:1718
#8  0xc9330f08 in VideoOutputQuartz::ProcessFrame (this=0x388b600, frame=0x3890e98, osd=0x195c4ed0, filterList=0x19728a10, pipPlayer=0x0) at videoout_quartz.cpp:1718
#9  0xc9255d7d in NuppelVideoPlayer::DisplayPauseFrame (this=0x1a0d0000) at NuppelVideoPlayer.cpp:2545
#10 0xc9276ae0 in NuppelVideoPlayer::DisplayNormalFrame (this=0x1a0d0000) at NuppelVideoPlayer.cpp:2655
#11 0xc9277e51 in NuppelVideoPlayer::OutputVideoLoop (this=0x1a0d0000) at NuppelVideoPlayer.cpp:2902
#12 0xc9277f55 in NuppelVideoPlayer::kickoffOutputVideoLoop (player=0x1a0d0000) at NuppelVideoPlayer.cpp:2984
#13 0x90023d67 in _pthread_body ()

comment:10 Changed 9 years ago by stuartm

Milestone: 0.21.10.22

comment:11 Changed 9 years ago by Nigel

Component: MythTV - Video PlaybackPorts - OSX

comment:12 Changed 8 years ago by Stuart Auchterlonie

Milestone: 0.220.24

Bumping open 0.22 milestone tickets to 0.24

comment:13 Changed 8 years ago by mythtv@…

Got EPG Problem after updating to 0.22-fixes from sniderpad:

Going from LiveTV to EPG and back only works with decoder "Standard", Video Renderer "OpenGL" and OSD Renderer OpenGL2, in which case the preview window is not shown, with decoder Mac Acceleration or video renderer quartz-accel the LiveTV picture overlays the EPG and if you switch back to LiveTV that is not scaled correctly anymore. My Minis have a Intel GMA GPU, but at least one user confirmed this behaviour here. Both of us are running Snow Leopard, should we try our own compile as sniderpad still seems to be on Leopard.

Please advice whether this is related or should become it's own ticket or what additional information you need.

BR Jörn

comment:14 Changed 8 years ago by stuartm

Milestone: 0.24unknown
Owner: changed from Nigel to markk

comment:15 Changed 8 years ago by chr

Hi ppl!

I looked into the quartz renderer and made it going. I'll attach a patch against release-0.23-fixes.

  • EPG embed video shows up and scales proper
  • going back, fullscreen is restored
  • manual zoom works
  • manual aspect needed some hacks in myth api ...

Still buggy:

  • hit apple+q closes the video window but myth keeps running (how to tell myth to quit?)
  • I haven't tested the other gimmiks like floating window or output to the dock. I hardly miss that features.

Also to make 0.23 going for MacOsX, look at ticket:8179 and ticket:8442

Please apply that patch!

greetz

chr

Changed 8 years ago by chr

fixes quartz video renderer on OsX

comment:16 Changed 8 years ago by Stuart Auchterlonie

Cc: Stuart Auchterlonie added

comment:17 Changed 8 years ago by Nigel

chr, thanks for the patch. With it, bringing up the guide in Live TV does the right thing. Sadly, it creates another problem...
Aspect changing no longer works. Pressing W changes the aspect of the OSD, but the playback image is unchanged.
The patch does seem to contain a few things that are un-needed, but it did point me toward the API change in EmbedInWidget?() that I missed. I will commit a fix for that ASAP. Could you email me (nigel@… or on the developer's list) to discuss the other changes in your patch?

comment:18 Changed 8 years ago by Nigel

(In [25133]) API change missed in a long-ago mythtv-vid merge [19417], which meant EmbedInWidget?() wasn't overriding the base class's version. On Mac OS X, should prevent unusable window after exiting Program Guide, but does not correct the window scaling problems. Thanks to 'chr'. Refs #6211

comment:19 in reply to:  18 Changed 8 years ago by Mark <mythtv@…>

Replying to nigel:

(In [25133]) API change missed in a long-ago mythtv-vid merge [19417], which meant EmbedInWidget?() wasn't overriding the base class's version. On Mac OS X, should prevent unusable window after exiting Program Guide, but does not correct the window scaling problems. Thanks to 'chr'. Refs #6211

This cs(25133) breaks compilation for videoout_d3d.cpp as 'wid' is assigned to m_hEmbedWnd in the function. The #include "osdsurface.h" in videoout_d3d.cpp needs to go too If I don't set m_hEmbedWnd it seems to break HD playback? That could be something else tho

comment:20 Changed 8 years ago by Nigel

(In [25138]) Fix my oops in [25134]. Thanks Mark. Refs #6211. The osdsurface and HD playback probs will have to wait until I can test build.

comment:21 Changed 8 years ago by Nigel

(In [25139]) Fix my oops in [25133]. Thanks Mark. Refs #6211. The osdsurface and HD playback probs will have to wait until I can test build.

comment:22 in reply to:  17 Changed 8 years ago by chr

Replying to nigel:

chr, thanks for the patch. With it, bringing up the guide in Live TV does the right thing. Sadly, it creates another problem...
Aspect changing no longer works. Pressing W changes the aspect of the OSD, but the playback image is unchanged.
The patch does seem to contain a few things that are un-needed, ....

Well, guess what those uneeded things are fixing .... xD

I'll attach some patches, with some more comments, which are actually necessary to make myth0.23-fixes going on my mac-mini-ppc. I do believe, trunk needs that patches as well.

Press W and automatic aspect change of live tv works for me.

Changed 8 years ago by chr

Changed 8 years ago by chr

Changed 8 years ago by chr

Changed 8 years ago by chr

Changed 8 years ago by chr

comment:23 in reply to:  17 Changed 8 years ago by chr

Replying to nigel:

The patch does seem to contain a few things that are un-needed, but it did point me toward the API change in EmbedInWidget?() that I missed. I will commit a fix for that ASAP. Could you email me (nigel@… or on the developer's list) to discuss the other changes in your patch?

I dropped a line on the ML:

http://mythtv.org/pipermail/mythtv-dev/2010-July/068790.html

comment:24 Changed 8 years ago by Nigel

(In [25263]) Allow video out subclasses to implement ToggleAspectOverride?(), and do that in Mac OS Quartz code. Apple-W will now do something! Windows code probably also should have this enabled? Thanks to Christoph Rudorff. Refs #6211.

comment:25 Changed 8 years ago by Nigel

(In [25279]) Simple repair of embedded video in guide. Refs #6211. Does not obey aspect/fill in embedded area, or after exiting guide, but might enable PiP (untested)

comment:26 Changed 8 years ago by Nigel

(In [25291]) When pausing video output to access GUI (e.g. EPG from Recordings), hide that video rectangle so users can actually see the GUI and popups. Seems to only be a problem on Mac OS X. Refs #6211. Hopefully negates Christoph's part1.patch. (also contains some whitespace and comment changes)

comment:27 Changed 8 years ago by Nigel

(In [25292]) Also hide fullscreen output when video paused for GUI (e.g. EPG guide grid). Refs #6211. Now I just gotta backport all this to 23-fixes.

comment:28 Changed 8 years ago by Nigel

Resolution: fixed
Status: assignedclosed

(In [25294]) Mac OS X embedded playback, and paused-playback over EPG, fixes, from trunk. Mostly closes #6211.

comment:29 Changed 8 years ago by Nigel

(In [25295]) Prevent stack overflow with LiveTV on Mac OS X, by allocating buffer from heap. Thanks to Christoph Rudorff. Refs #6211. Refs #8179. Tidier solution than trunk's [24618]?

comment:30 Changed 8 years ago by Nigel

(In [25302]) Backport [25263] from trunk to enable ToggleAspectOverride?() on Mac OS X. Refs #6211.

comment:31 Changed 8 years ago by Nigel

(In [25333]) Backport [25326] from trunk. Refs #6211. Simplify embedding, repair window/fullscreen aspect after exiting EPG. Should also eliminate locking problem from enter/exit/enter/exit guide (which were caused by both ResizeForGui?() and EmbedInWidget?()

calling End() after my recent changes to enable embedding).

Note: See TracTickets for help on using tickets.