[mythtv] PPC and OsX quartz renderer

Christoph Rudorff chris at rudorff.com
Mon Jul 5 21:19:38 UTC 2010


Nigel Pearson schrieb:
>> I used opengl a long time until 0.22 (if I remember correctly), now there
>> is a shift of -1,-1 of the video picture which leaves permanent lines on
>> right and bottom corner. Very nasty.

>>>> Is this true? I've never hear it before and can't find any reference.

Well, I could swear I saw a ticket about that ... actually I have found
more bugs and I still got some more patches for you ;)

> 
> Annoying, but probably easily fixed,
> with something like the following (untested):
> 
> 
> VideoOutputOpenGL::MoveResize()
> {
>     QMutexLocker locker(&gl_context_lock);
> #ifdef Q_WS_MACX
>     // Apple OpenGL is offset vert/hor by one pixel, so...
>     display_video_rect.moveLeft(1);
>     display_video_rect.moveTop(1)
> #endif
>     VideoOutput::MoveResize();
> }
>

This hack reminds me to a discussion on winehq. They never ever accept
patches which hardcodes workarounds for buggy applications ... unless
windows does.

When I saw that displacement I thought no problem. There is a screen setup
wizzard setup in myth where I can ... ops ... wft? eeehm no.

Second try: General Playback, page2, Scan displacement
(X/YScanDisplacement) ... doesn't work either, no effect at all.


> 
>> Also the output window does not
>> properly ineract with osx window manager: on "apple+tab" the input focus
>> changes to the next application but the opengl output stays on top.
> 
> Yes, I'm still thinking about that one, along with the Apple-Q probs.

I pray that the 'really quit' dialog will appear onto the video :P

Just saw in linux the 'quit' option in the window managers menu is
disabled. Lame.

> 
> Another OpenGL problem: if the window has decorations
> (i.e. the buttons and title), that is not taken into
> account in the rendered overlay's offset.

Reminds me when trying -w with quartz: black bar instead of window
decorations (If I remember correctly)

[...]

> The W key is by default mapped to TOGGLEFILL,
> and thus calls ToggleAdjustFill().
> 
> Cntl+W (or Apple+W on Mac OS X),
> is the one that calls TOGGLEASPECT,
> which calls ToggleAspectOverride().
> 
> I have never used this forced aspect feature,
> so have not missed it, but part2 looks gut.,
> so I just applied it to trunk, and will try
> to backport to 23-fixes tonight, Christoph.

Well, to clarify this confusion ... I used to map W to ToggleAspect and
vice versa a long time ago because automatic aspect switch didn't work so
I had to hit W five times without ctrl.

> 
> It is the original patch, or the later part1,
> that I am still wrestling with, though.
> It breaks W (ToggleAdjustFill() zoom modes) for me.

Actually I think, part1 makes too much damage to the code. I just thought
of reusing code since the calculations are error prone.

I was surprised what was left for part2 after I 'git rebase'd all my hacks.

> Mostly, the patch scales all four output rects from
> windows[0].GetDisplayVideoRect(), which is a problem
> when they are all possibly different shapes and res.
> 
> What I don't understand is why it fixes the embedded
> widget's location and size, because for several months,
> the window ordering has obscured the guide behind the
> paused (recordings) or still playing (Live TV) output,
> for me.

And these bugs still exists :(

We must set up a proper text matrix (mac/quartz,opengl linux/xv,opengl
...) and try more buttons:

With my hacking branch, using quartz, watch a recording, menu, program guide.

I see an epg guide under a paused video. DOH!

And I never recently tried the "Jump to Program", "Recorded Program":
paused video ... whats happening???

sql error:  mythtv/libs/libmyth/programinfo.cpp line 3600 missing some
spaces in that statement. If u fix this, it doesn't fix that. Still I get
a paused video. It just uncovers the next bug:

ESC

I see for a fraction of a second "wrong password". I have one recoding
group with a password. The Prompt was under the video. DOH!

Also I think the prompt comes too early, should come if I select this
password protected group. Why does this function create another pass
dialog instead reusing ... ?

On linux/opengl epg works with watching a recording but it also got
problems with the password prompt.

By the way, the quartz does not support picture in picture, does it?

> 
>> Also I am wondering why an aspect change doesn't pass
>> VideoOutputQuartz::VideoAspectRatioChanged() !!!!
> 
> I think that is only called when the video stream data
> changes aspect. Depending on your TV network provider,
> that might never happen!

Is that an event protocol feature of DVB or is that event generated from
the video stream? I mean the videooutput must not care if the desired
aspect is manual or automatic (the trick question is, what's desired).
Also how about a recording? Actually automatic switching works for me.

The API is confusing me. That just made me set some breakpoints. I cut out
10 seconds of a recording which contains a switch from 16:9 to 4:3

Player Thread(!)
(gdb) bt
#0  VideoOutputQuartz::InputChanged (this=0x442ba00,
input_size=@0x6de380c, aspect=3.68934881e+19, av_codec_id=kCodec_MPEG2,
codec_private=0x0, aspect_only=@0xf07acf94) at videoout_quartz.cpp:1145
#1  0x00e81478 in NuppelVideoPlayer::ReinitVideo (this=0x6de3000) at
NuppelVideoPlayer.cpp:809
#2  0x00e81c68 in NuppelVideoPlayer::SetVideoParams (this=0x6de3000,
width=115226636, height=576, fps=1.3333333730697632,
keyframedistance=-260386924, aspect=3.68934881e+19, scan=kScan_Detect,
video_codec_changed=false) at NuppelVideoPlayer.cpp:1129
#3  0x00ece88c in AvFormatDecoder::MpegPreProcessPkt (this=0x43d2800,
stream=0x10f09e10, pkt=0x15e77c00) at avformatdecoder.cpp:2882
#4  0x00ee3914 in AvFormatDecoder::GetFrame (this=0x43d2800,
decodetype=kDecodeAV) at avformatdecoder.cpp:3842
#5  0x00e5a4e4 in NuppelVideoPlayer::GetFrameNormal (this=0x6de3000,
decodetype=<value temporarily unavailable, due to optimizations>) at
NuppelVideoPlayer.cpp:1490
#6  0x00e5b2ac in NuppelVideoPlayer::GetFrame (this=0x6de3000,
decodetype=kDecodeAV, unsafe=71481856) at NuppelVideoPlayer.cpp:1576
#7  0x00e8c7fc in NuppelVideoPlayer::StartPlaying (this=0x6de3000,
openfile=<value temporarily unavailable, due to optimizations>) at
NuppelVideoPlayer.cpp:3735
#8  0x00ea03ec in SpawnDecode (param=0x6de3000) at playercontext.cpp:29
#9  0x906d30d4 in _pthread_start ()

calls:
VideoOutputQuartz::InputChanged
VideoOutput::InputChanged
VideoOutWindow::InputChanged


---
ToggleAspect via keypress:

from main thread (!)

Breakpoint 12, VideoOutputQuartz::ToggleAspectOverride (this=0x442ba00,
aspectMode=kAspect_Toggle) at videoout_quartz.cpp:1137
1137        VideoOutput::ToggleAspectOverride(aspectMode);
(gdb) bt
#0  VideoOutputQuartz::ToggleAspectOverride (this=0x442ba00,
aspectMode=kAspect_Toggle) at videoout_quartz.cpp:1137
#1  0x00e4f9ec in NuppelVideoPlayer::ToggleAspectOverride (this=0x6de3000,
aspectMode=<value temporarily unavailable, due to optimizations>) at
NuppelVideoPlayer.cpp:5122
#2  0x00de58fc in TV::ToggleAspectOverride (this=0x4151c00,
ctx=0x10f1f2f0, aspectMode=kAspect_Toggle) at tv_play.cpp:8509
#3  0x00e20bb8 in TV::ToggleHandleAction (this=0x4151c00, ctx=0x10f1f2f0,
actions=@0xbfffad18, isDVD=false) at tv_play.cpp:4508
#4  0x00e402d8 in TV::ProcessKeypress (this=0x4151c00, actx=0x10f1f2f0,
e=0x15e72610) at tv_play.cpp:3674
#5  0x00e418e8 in TV::timerEvent (this=0x4151c00, te=<value temporarily
unavailable, due to optimizations>) at tv_play.cpp:2640
#6  0x039bf5c0 in QObject::event () at qstring.h:825
...

calls:
VideoOutput::ToggleAspectOverride
VideoOutWindow::ToggleAspectOverride

so I double checked that quartz Transform() is doing a proper locking!

ok, that's it for today. All I want to do is watching TV !!!1

xD


chr





More information about the mythtv-dev mailing list