Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
ac1de0c7
Commit
ac1de0c7
authored
Apr 04, 2006
by
Benjamin Pracht
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Implement Aspect ratio change in the QT vout
parent
00788d2d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
16 deletions
+31
-16
modules/gui/macosx/intf.m
modules/gui/macosx/intf.m
+2
-2
modules/gui/macosx/voutqt.m
modules/gui/macosx/voutqt.m
+29
-14
No files found.
modules/gui/macosx/intf.m
View file @
ac1de0c7
...
...
@@ -1154,10 +1154,10 @@ static VLCMain *_o_sharedMainInstance = nil;
{
vlc_object_t
*
p_dec_obj
;
[
o_controls
setupVarMenuItem
:
o_mi_aspect_ratio
target
:
(
vlc_object_t
*
)
[
VLCVoutView
getRealVout
:
p_vout
]
[
o_controls
setupVarMenuItem
:
o_mi_aspect_ratio
target
:
(
vlc_object_t
*
)
p_vout
var:
"aspect-ratio"
selector
:
@selector
(
toggleVar
:
)];
[
o_controls
setupVarMenuItem
:
o_mi_crop
target
:
(
vlc_object_t
*
)
[
VLCVoutView
getRealVout
:
p_vout
]
[
o_controls
setupVarMenuItem
:
o_mi_crop
target
:
(
vlc_object_t
*
)
p_vout
var:
"crop"
selector
:
@selector
(
toggleVar
:
)];
[
o_controls
setupVarMenuItem
:
o_mi_screen
target
:
(
vlc_object_t
*
)
p_vout
...
...
modules/gui/macosx/voutqt.m
View file @
ac1de0c7
...
...
@@ -9,6 +9,7 @@
* Jon Lech Johansen <jon-vl@nanocrew.net>
* Derk-Jan Hartman <hartman at videolan dot org>
* Eric Petit <titer@m0k.org>
* Benjamin Pracht <bigben AT videolan DOT org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -81,7 +82,7 @@ struct picture_sys_t
{
void
*
p_data
;
unsigned
int
i_size
;
/* When using I420 output */
PlanarPixmapInfoYUV420
pixmap_i420
;
};
...
...
@@ -378,14 +379,21 @@ static int ManageVideo( vout_thread_t *p_vout )
p_vout
->
i_changes
|=
VOUT_SIZE_CHANGE
;
}
if
(
p_vout
->
i_changes
&
VOUT_SIZE_CHANGE
)
if
(
p_vout
->
i_changes
&
VOUT_SIZE_CHANGE
||
p_vout
->
i_changes
&
VOUT_ASPECT_CHANGE
)
{
QTScaleMatrix
(
p_vout
);
SetDSequenceMatrix
(
p_vout
->
p_sys
->
i_seq
,
p_vout
->
p_sys
->
p_matrix
);
}
if
(
p_vout
->
i_changes
&
VOUT_SIZE_CHANGE
)
{
p_vout
->
i_changes
&=
~
VOUT_SIZE_CHANGE
;
}
if
(
p_vout
->
i_changes
&
VOUT_ASPECT_CHANGE
)
{
p_vout
->
i_changes
&=
~
VOUT_ASPECT_CHANGE
;
}
[
p_vout
->
p_sys
->
o_vout_view
manage
];
return
(
0
);
...
...
@@ -525,8 +533,8 @@ static int CoToggleFullscreen( vout_thread_t *p_vout )
if
(
QTCreateSequence
(
p_vout
)
)
{
msg_Err
(
p_vout
,
"unable to initialize QT: QTCreateSequence failed"
);
return
(
1
);
}
return
(
1
);
}
[
o_pool
release
];
return
0
;
...
...
@@ -591,27 +599,34 @@ static void QTScaleMatrix( vout_thread_t *p_vout )
Long2Fix
(
p_vout
->
output
.
i_height
)
);
}
else
if
(
i_height
*
p_vout
->
output
.
i_aspect
<
i_width
*
VOUT_ASPECT_FACTOR
)
else
if
(
i_height
*
p_vout
->
fmt_in
.
i_visible_width
*
p_vout
->
fmt_in
.
i_sar_num
<
i_width
*
p_vout
->
fmt_in
.
i_visible_height
*
p_vout
->
fmt_in
.
i_sar_den
)
{
int
i_adj_width
=
i_height
*
p_vout
->
output
.
i_aspect
/
VOUT_ASPECT_FACTOR
;
int
i_adj_width
=
i_height
*
p_vout
->
fmt_in
.
i_visible_width
*
p_vout
->
fmt_in
.
i_sar_num
/
(
p_vout
->
fmt_in
.
i_sar_den
*
p_vout
->
fmt_in
.
i_visible_height
);
factor_x
=
FixDiv
(
Long2Fix
(
i_adj_width
),
Long2Fix
(
p_vout
->
output
.
i
_width
)
);
Long2Fix
(
p_vout
->
fmt_in
.
i_visible
_width
)
);
factor_y
=
FixDiv
(
Long2Fix
(
i_height
),
Long2Fix
(
p_vout
->
output
.
i
_height
)
);
Long2Fix
(
p_vout
->
fmt_in
.
i_visible
_height
)
);
i_offset_x
=
(
i_width
-
i_adj_width
)
/
2
;
}
else
{
int
i_adj_height
=
i_width
*
VOUT_ASPECT_FACTOR
/
p_vout
->
output
.
i_aspect
;
int
i_adj_height
=
i_width
*
p_vout
->
fmt_in
.
i_visible_height
*
p_vout
->
fmt_in
.
i_sar_den
/
(
p_vout
->
fmt_in
.
i_sar_num
*
p_vout
->
fmt_in
.
i_visible_width
);
factor_x
=
FixDiv
(
Long2Fix
(
i_width
),
Long2Fix
(
p_vout
->
output
.
i
_width
)
);
Long2Fix
(
p_vout
->
fmt_in
.
i_visible
_width
)
);
factor_y
=
FixDiv
(
Long2Fix
(
i_adj_height
),
Long2Fix
(
p_vout
->
output
.
i
_height
)
);
Long2Fix
(
p_vout
->
fmt_in
.
i_visible
_height
)
);
i_offset_y
=
(
i_height
-
i_adj_height
)
/
2
;
}
...
...
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