[vlc-devel] [vlc-commits] vout_macosx: re-write VOUT_DISPLAY_CHANGE_FULLSCREEN the way it was intended and update the display size correctly , so we get sharp OSD rendering

David Fuhrmann david.fuhrmann at googlemail.com
Tue Apr 10 09:59:11 CEST 2012


Am 08.04.2012 um 15:06 schrieb Felix Paul Kühne:

> vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Sun Apr  8 15:05:30 2012 +0200| [4a10b45f3147f524ce09bff7b939d09a3f59f108] | committer: Felix Paul Kühne
> 
> vout_macosx: re-write VOUT_DISPLAY_CHANGE_FULLSCREEN the way it was intended and update the display size correctly, so we get sharp OSD rendering
> 
>> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4a10b45f3147f524ce09bff7b939d09a3f59f108
> ---
> 
> modules/video_output/macosx.m |   38 ++++++++++++++++++++++++++++----------
> 1 files changed, 28 insertions(+), 10 deletions(-)
> 
> diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m
> index 5efd3c3..2e1bcea 100644
> --- a/modules/video_output/macosx.m
> +++ b/modules/video_output/macosx.m
> @@ -313,16 +313,33 @@ static int Control (vout_display_t *vd, int query, va_list ap)
>     {
>         case VOUT_DISPLAY_CHANGE_FULLSCREEN:
>         {
> -            NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
> -            id window = [sys->glView window];
> -            if ([window respondsToSelector:@selector(updateFullscreen)])
> -            {
> -                [[sys->glView window] performSelectorOnMainThread:@selector(updateFullscreen) withObject: nil waitUntilDone:NO];
> -                [o_pool release];
> -                return VLC_SUCCESS;
> -            }
> -            [o_pool release];
> -            return VLC_EGENERIC;
> +            const vout_display_cfg_t *cfg = va_arg (ap, const vout_display_cfg_t *);
> +            if (vout_window_SetFullScreen (sys->embed, cfg->is_fullscreen))
> +                return VLC_EGENERIC;
> +
> +            NSRect frame;
> +
> +            /* when entering fullscreen, set the OSD / display size to the visible screen size.
> +             * this way, the text rendering will be as sharp as possible.
> +             * when returning from fullscreen, pick the dimensions from cfg, which can be different
> +             * from the native video size because of crop and zoom */
> +            if (cfg->is_fullscreen)
> +                frame = [[[sys->glView window] screen] visibleFrame];
> +            else
> +                frame = NSMakeRect( 0., 0., cfg->display.width, cfg->display.height );
> +
> +            vout_display_SendEventDisplaySize( vd, frame.size.width, frame.size.height, cfg->is_fullscreen );
> +
> +            const video_format_t * source;
> +            source = &vd->source;
> +            vout_display_cfg_t place_cfg = *cfg;
> +            place_cfg.display.width  = frame.size.width;
> +            place_cfg.display.height = frame.size.height;
> +
> +            vout_display_place_t place;
> +            vout_display_PlacePicture(&place, source, &place_cfg, false);
> +
> +            return VLC_SUCCESS;

Hello,

Why do you call vout_display_PlacePicture here? AFAIK this would only make sense if you actually use the result stored in place, afterwards.

Generally, for me the question arises: How is the "normal" window resize (from user or vlc core) handled regarding display size? Is this already done in vlc core?

Best,
David




More information about the vlc-devel mailing list