Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
72baa591
Commit
72baa591
authored
Nov 06, 2001
by
Stéphane Borel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Maybe corrected aspect ratio issue in fullscreen xvideo.
parent
b0f6c87b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
43 deletions
+67
-43
plugins/x11/vout_xvideo.c
plugins/x11/vout_xvideo.c
+67
-43
No files found.
plugins/x11/vout_xvideo.c
View file @
72baa591
...
...
@@ -2,7 +2,7 @@
* vout_xvideo.c: Xvideo video output display method
*****************************************************************************
* Copyright (C) 1998, 1999, 2000, 2001 VideoLAN
* $Id: vout_xvideo.c,v 1.2
8 2001/09/30 01:05:37
stef Exp $
* $Id: vout_xvideo.c,v 1.2
9 2001/11/06 16:59:06
stef Exp $
*
* Authors: Shane Harper <shanegh@optusnet.com.au>
* Vincent Seguin <seguin@via.ecp.fr>
...
...
@@ -1114,38 +1114,6 @@ static void XVideoOutputCoords( const picture_t *p_pic, const boolean_t scale,
const
int
win_w
,
const
int
win_h
,
int
*
dx
,
int
*
dy
,
int
*
w
,
int
*
h
)
{
if
(
!
scale
)
{
*
w
=
p_pic
->
i_width
;
*
h
=
p_pic
->
i_height
;
}
else
{
*
h
=
win_h
;
switch
(
p_pic
->
i_aspect_ratio
)
{
case
AR_3_4_PICTURE
:
*
w
=
win_h
*
4
/
3
;
break
;
case
AR_16_9_PICTURE
:
*
w
=
win_h
*
16
/
9
;
break
;
case
AR_221_1_PICTURE
:
*
w
=
win_h
*
221
/
100
;
break
;
case
AR_SQUARE_PICTURE
:
default:
*
w
=
win_h
*
p_pic
->
i_width
/
p_pic
->
i_height
;
break
;
}
}
/* Set picture position */
*
dx
=
(
win_w
-
*
w
)
/
2
;
*
dy
=
(
win_h
-
*
h
)
/
2
;
}
...
...
@@ -1322,19 +1290,70 @@ static int XVideoGetPort( Display *dpy )
*****************************************************************************/
static
void
XVideoDisplay
(
vout_thread_t
*
p_vout
)
{
int
i_dest_width
,
i_dest_height
,
i_dest_x
,
i_dest_y
;
int
i_dest_width
,
i_dest_height
;
if
(
!
p_vout
->
p_sys
->
p_xvimage
)
{
return
;
}
XVideoOutputCoords
(
p_vout
->
p_rendered_pic
,
p_vout
->
b_scale
,
p_vout
->
p_sys
->
i_window_width
,
p_vout
->
p_sys
->
i_window_height
,
&
i_dest_x
,
&
i_dest_y
,
&
i_dest_width
,
&
i_dest_height
);
i_dest_height
=
p_vout
->
p_sys
->
i_window_height
>
p_vout
->
p_rendered_pic
->
i_height
?
p_vout
->
p_sys
->
i_window_height
:
p_vout
->
p_rendered_pic
->
i_height
;
i_dest_width
=
p_vout
->
p_sys
->
i_window_width
>
p_vout
->
p_rendered_pic
->
i_width
?
p_vout
->
p_sys
->
i_window_width
:
p_vout
->
p_rendered_pic
->
i_width
;
if
(
p_vout
->
b_scale
)
{
int
i_ratio
=
900
*
i_dest_width
/
i_dest_height
;
switch
(
p_vout
->
p_rendered_pic
->
i_aspect_ratio
)
{
case
AR_3_4_PICTURE
:
if
(
i_ratio
<
1200
)
{
i_dest_width
=
i_dest_height
*
4
/
3
;
}
else
{
i_dest_height
=
i_dest_width
*
3
/
4
;
}
break
;
case
AR_16_9_PICTURE
:
if
(
i_ratio
<
1600
)
{
i_dest_width
=
i_dest_height
*
16
/
9
;
}
else
{
i_dest_height
=
i_dest_width
*
9
/
16
;
}
break
;
case
AR_221_1_PICTURE
:
if
(
i_ratio
<
1989
)
{
i_dest_width
=
i_dest_height
*
221
/
100
;
}
else
{
i_dest_height
=
i_dest_width
*
100
/
221
;
}
break
;
case
AR_SQUARE_PICTURE
:
default:
if
(
i_ratio
<
900
)
{
i_dest_width
=
i_dest_height
*
p_vout
->
p_rendered_pic
->
i_width
/
p_vout
->
p_rendered_pic
->
i_height
;
}
else
{
i_dest_height
=
i_dest_width
*
p_vout
->
p_rendered_pic
->
i_height
/
p_vout
->
p_rendered_pic
->
i_width
;
}
break
;
}
}
XvShmPutImage
(
p_vout
->
p_sys
->
p_display
,
p_vout
->
p_sys
->
xv_port
,
p_vout
->
p_sys
->
yuv_window
,
p_vout
->
p_sys
->
gc
,
...
...
@@ -1348,8 +1367,6 @@ static void XVideoDisplay( vout_thread_t *p_vout )
/* YUV window */
XResizeWindow
(
p_vout
->
p_sys
->
p_display
,
p_vout
->
p_sys
->
yuv_window
,
i_dest_width
,
i_dest_height
);
XMoveWindow
(
p_vout
->
p_sys
->
p_display
,
p_vout
->
p_sys
->
yuv_window
,
i_dest_x
,
i_dest_y
);
/* Root window */
if
(
(
(
i_dest_width
!=
p_vout
->
p_sys
->
i_window_width
)
||
...
...
@@ -1362,7 +1379,14 @@ static void XVideoDisplay( vout_thread_t *p_vout )
XResizeWindow
(
p_vout
->
p_sys
->
p_display
,
p_vout
->
p_sys
->
window
,
i_dest_width
,
i_dest_height
);
}
#if 0
/* Set picture position */
i_dest_x = (p_vout->p_sys->i_window_width - i_dest_width) / 2;
i_dest_y = (p_vout->p_sys->i_window_height - i_dest_height) / 2;
XMoveWindow( p_vout->p_sys->p_display, p_vout->p_sys->yuv_window,
i_dest_x, i_dest_y );
#endif
/* Send the order to the X server */
XSync
(
p_vout
->
p_sys
->
p_display
,
False
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment