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
58961aa8
Commit
58961aa8
authored
May 13, 2006
by
Antoine Cellerier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow the <width>x<height>+<left>+<top> syntax in video output core cropping
parent
b73b4a12
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
18 deletions
+49
-18
src/video_output/vout_intf.c
src/video_output/vout_intf.c
+49
-18
No files found.
src/video_output/vout_intf.c
View file @
58961aa8
...
@@ -770,7 +770,7 @@ static int ZoomCallback( vlc_object_t *p_this, char const *psz_cmd,
...
@@ -770,7 +770,7 @@ static int ZoomCallback( vlc_object_t *p_this, char const *psz_cmd,
vout_thread_t
*
p_vout
=
(
vout_thread_t
*
)
p_this
;
vout_thread_t
*
p_vout
=
(
vout_thread_t
*
)
p_this
;
InitWindowSize
(
p_vout
,
&
p_vout
->
i_window_width
,
InitWindowSize
(
p_vout
,
&
p_vout
->
i_window_width
,
&
p_vout
->
i_window_height
);
&
p_vout
->
i_window_height
);
vout_Control
(
p_vout
,
VOUT_SET_SIZE
,
p_vout
->
i_window_width
,
vout_Control
(
p_vout
,
VOUT_SET_SIZE
,
p_vout
->
i_window_width
,
p_vout
->
i_window_height
);
p_vout
->
i_window_height
);
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
...
@@ -790,30 +790,61 @@ static int CropCallback( vlc_object_t *p_this, char const *psz_cmd,
...
@@ -790,30 +790,61 @@ static int CropCallback( vlc_object_t *p_this, char const *psz_cmd,
p_vout
->
fmt_in
.
i_y_offset
=
p_vout
->
fmt_render
.
i_y_offset
;
p_vout
->
fmt_in
.
i_y_offset
=
p_vout
->
fmt_render
.
i_y_offset
;
p_vout
->
fmt_in
.
i_visible_height
=
p_vout
->
fmt_render
.
i_visible_height
;
p_vout
->
fmt_in
.
i_visible_height
=
p_vout
->
fmt_render
.
i_visible_height
;
if
(
!
psz_parser
)
goto
crop_end
;
if
(
psz_parser
)
{
/* We're using the 3:4 syntax */
i_aspect_num
=
strtol
(
newval
.
psz_string
,
&
psz_end
,
10
);
if
(
psz_end
==
newval
.
psz_string
||
!
i_aspect_num
)
goto
crop_end
;
i_aspect_num
=
strtol
(
newval
.
psz_string
,
&
psz_end
,
10
);
i_aspect_den
=
strtol
(
++
psz_parser
,
&
psz_end
,
10
);
if
(
psz_end
==
newval
.
psz_string
||
!
i_aspect_num
)
goto
crop_end
;
if
(
psz_end
==
psz_parser
||
!
i_aspect_den
)
goto
crop_end
;
i_aspect_den
=
strtol
(
++
psz_parser
,
&
psz_end
,
10
);
i_width
=
p_vout
->
fmt_in
.
i_sar_den
*
p_vout
->
fmt_render
.
i_visible_height
*
if
(
psz_end
==
psz_parser
||
!
i_aspect_den
)
goto
crop_end
;
i_aspect_num
/
i_aspect_den
/
p_vout
->
fmt_in
.
i_sar_num
;
i_height
=
p_vout
->
fmt_render
.
i_visible_width
*
p_vout
->
fmt_in
.
i_sar_num
*
i_aspect_den
/
i_aspect_num
/
p_vout
->
fmt_in
.
i_sar_den
;
i_width
=
p_vout
->
fmt_in
.
i_sar_den
*
p_vout
->
fmt_render
.
i_visible_height
*
if
(
i_width
<
p_vout
->
fmt_render
.
i_visible_width
)
i_aspect_num
/
i_aspect_den
/
p_vout
->
fmt_in
.
i_sar_num
;
{
i_height
=
p_vout
->
fmt_render
.
i_visible_width
*
p_vout
->
fmt_in
.
i_sar_num
*
p_vout
->
fmt_in
.
i_x_offset
=
p_vout
->
fmt_render
.
i_x_offset
+
i_aspect_den
/
i_aspect_num
/
p_vout
->
fmt_in
.
i_sar_den
;
(
p_vout
->
fmt_render
.
i_visible_width
-
i_width
)
/
2
;
p_vout
->
fmt_in
.
i_visible_width
=
i_width
;
if
(
i_width
<
p_vout
->
fmt_render
.
i_visible_width
)
}
{
else
p_vout
->
fmt_in
.
i_x_offset
=
p_vout
->
fmt_render
.
i_x_offset
+
{
(
p_vout
->
fmt_render
.
i_visible_width
-
i_width
)
/
2
;
p_vout
->
fmt_in
.
i_y_offset
=
p_vout
->
fmt_render
.
i_y_offset
+
p_vout
->
fmt_in
.
i_visible_width
=
i_width
;
(
p_vout
->
fmt_render
.
i_visible_height
-
i_height
)
/
2
;
p_vout
->
fmt_in
.
i_visible_height
=
i_height
;
}
}
}
else
else
{
{
p_vout
->
fmt_in
.
i_y_offset
=
p_vout
->
fmt_render
.
i_y_offset
+
/* Maybe we're using the <width> x <height> + <left> + <top> syntax */
(
p_vout
->
fmt_render
.
i_visible_height
-
i_height
)
/
2
;
unsigned
int
i_crop_width
,
i_crop_height
,
i_crop_top
,
i_crop_left
;
psz_parser
=
strchr
(
newval
.
psz_string
,
'x'
);
i_crop_width
=
strtol
(
newval
.
psz_string
,
&
psz_end
,
10
);
if
(
psz_end
!=
psz_parser
)
goto
crop_end
;
psz_parser
=
strchr
(
++
psz_end
,
'+'
);
i_crop_height
=
strtol
(
psz_end
,
&
psz_end
,
10
);
if
(
psz_end
!=
psz_parser
)
goto
crop_end
;
psz_parser
=
strchr
(
++
psz_end
,
'+'
);
i_crop_left
=
strtol
(
psz_end
,
&
psz_end
,
10
);
if
(
psz_end
!=
psz_parser
)
goto
crop_end
;
i_crop_top
=
strtol
(
++
psz_end
,
&
psz_end
,
10
);
if
(
*
psz_end
!=
'\0'
)
goto
crop_end
;
i_width
=
i_crop_width
;
p_vout
->
fmt_in
.
i_visible_width
=
i_width
;
i_height
=
i_crop_height
;
p_vout
->
fmt_in
.
i_visible_height
=
i_height
;
p_vout
->
fmt_in
.
i_visible_height
=
i_height
;
p_vout
->
fmt_in
.
i_x_offset
=
i_crop_left
;
p_vout
->
fmt_in
.
i_y_offset
=
i_crop_top
;
}
}
crop_end:
crop_end:
...
...
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