Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
10c71709
Commit
10c71709
authored
Dec 16, 2007
by
Antoine Cellerier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some more vout_intf.c simplification and compile warning fixes.
parent
415c99db
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
35 deletions
+63
-35
src/video_output/vout_intf.c
src/video_output/vout_intf.c
+63
-35
No files found.
src/video_output/vout_intf.c
View file @
10c71709
...
...
@@ -63,7 +63,12 @@ static int FullscreenCallback( vlc_object_t *, char const *,
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
SnapshotCallback
(
vlc_object_t
*
,
char
const
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
TitleCallback
(
vlc_object_t
*
,
char
const
*
,
static
int
TitleShowCallback
(
vlc_object_t
*
,
char
const
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
TitleTimeoutCallback
(
vlc_object_t
*
,
char
const
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
TitlePositionCallback
(
vlc_object_t
*
,
char
const
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
/*****************************************************************************
...
...
@@ -88,10 +93,8 @@ void *vout_RequestWindow( vout_thread_t *p_vout,
if
(
!
var_Type
(
p_vout
,
"aspect-ratio"
)
)
vout_IntfInit
(
p_vout
);
/* Get requested coordinates */
var_Get
(
p_vout
,
"video-x"
,
&
val
);
*
pi_x_hint
=
val
.
i_int
;
var_Get
(
p_vout
,
"video-y"
,
&
val
);
*
pi_y_hint
=
val
.
i_int
;
*
pi_x_hint
=
var_GetInteger
(
p_vout
,
"video-x"
);
*
pi_y_hint
=
var_GetInteger
(
p_vout
,
"video-y"
);
*
pi_width_hint
=
p_vout
->
i_window_width
;
*
pi_height_hint
=
p_vout
->
i_window_height
;
...
...
@@ -286,9 +289,9 @@ void vout_IntfInit( vout_thread_t *p_vout )
p_vout
->
i_title_position
=
var_CreateGetInteger
(
p_vout
,
"video-title-position"
);
var_AddCallback
(
p_vout
,
"video-title-show"
,
TitleCallback
,
NULL
);
var_AddCallback
(
p_vout
,
"video-title-timeout"
,
TitleCallback
,
NULL
);
var_AddCallback
(
p_vout
,
"video-title-position"
,
TitleCallback
,
NULL
);
var_AddCallback
(
p_vout
,
"video-title-show"
,
Title
Show
Callback
,
NULL
);
var_AddCallback
(
p_vout
,
"video-title-timeout"
,
Title
Timeout
Callback
,
NULL
);
var_AddCallback
(
p_vout
,
"video-title-position"
,
Title
Position
Callback
,
NULL
);
/* Zoom object var */
var_Create
(
p_vout
,
"zoom"
,
VLC_VAR_FLOAT
|
VLC_VAR_ISCOMMAND
|
...
...
@@ -313,10 +316,10 @@ void vout_IntfInit( vout_thread_t *p_vout )
var_AddCallback
(
p_vout
,
"zoom"
,
ZoomCallback
,
NULL
);
/* Crop offset vars */
var_Create
(
p_vout
,
"crop-left"
,
VLC_VAR_INTEGER
);
var_Create
(
p_vout
,
"crop-top"
,
VLC_VAR_INTEGER
);
var_Create
(
p_vout
,
"crop-right"
,
VLC_VAR_INTEGER
);
var_Create
(
p_vout
,
"crop-bottom"
,
VLC_VAR_INTEGER
);
var_Create
(
p_vout
,
"crop-left"
,
VLC_VAR_INTEGER
|
VLC_VAR_ISCOMMAND
);
var_Create
(
p_vout
,
"crop-top"
,
VLC_VAR_INTEGER
|
VLC_VAR_ISCOMMAND
);
var_Create
(
p_vout
,
"crop-right"
,
VLC_VAR_INTEGER
|
VLC_VAR_ISCOMMAND
);
var_Create
(
p_vout
,
"crop-bottom"
,
VLC_VAR_INTEGER
|
VLC_VAR_ISCOMMAND
);
var_AddCallback
(
p_vout
,
"crop-left"
,
CropCallback
,
NULL
);
var_AddCallback
(
p_vout
,
"crop-top"
,
CropCallback
,
NULL
);
...
...
@@ -324,7 +327,7 @@ void vout_IntfInit( vout_thread_t *p_vout )
var_AddCallback
(
p_vout
,
"crop-bottom"
,
CropCallback
,
NULL
);
/* Crop object var */
var_Create
(
p_vout
,
"crop"
,
VLC_VAR_STRING
|
var_Create
(
p_vout
,
"crop"
,
VLC_VAR_STRING
|
VLC_VAR_ISCOMMAND
|
VLC_VAR_HASCHOICE
|
VLC_VAR_DOINHERIT
);
text
.
psz_string
=
_
(
"Crop"
);
...
...
@@ -385,7 +388,7 @@ void vout_IntfInit( vout_thread_t *p_vout )
if
(
val
.
psz_string
)
free
(
val
.
psz_string
);
/* Aspect-ratio object var */
var_Create
(
p_vout
,
"aspect-ratio"
,
VLC_VAR_STRING
|
var_Create
(
p_vout
,
"aspect-ratio"
,
VLC_VAR_STRING
|
VLC_VAR_ISCOMMAND
|
VLC_VAR_HASCHOICE
|
VLC_VAR_DOINHERIT
);
text
.
psz_string
=
_
(
"Aspect-ratio"
);
...
...
@@ -417,7 +420,8 @@ void vout_IntfInit( vout_thread_t *p_vout )
&
p_vout
->
i_window_height
);
/* Add a variable to indicate if the window should be on top of others */
var_Create
(
p_vout
,
"video-on-top"
,
VLC_VAR_BOOL
|
VLC_VAR_DOINHERIT
);
var_Create
(
p_vout
,
"video-on-top"
,
VLC_VAR_BOOL
|
VLC_VAR_DOINHERIT
|
VLC_VAR_ISCOMMAND
);
text
.
psz_string
=
_
(
"Always on top"
);
var_Change
(
p_vout
,
"video-on-top"
,
VLC_VAR_SETTEXT
,
&
text
,
NULL
);
var_AddCallback
(
p_vout
,
"video-on-top"
,
OnTopCallback
,
NULL
);
...
...
@@ -426,7 +430,7 @@ void vout_IntfInit( vout_thread_t *p_vout )
var_Create
(
p_vout
,
"video-deco"
,
VLC_VAR_BOOL
|
VLC_VAR_DOINHERIT
);
/* Add a fullscreen variable */
if
(
var_CreateGetBool
(
p_vout
,
"fullscreen"
)
)
if
(
var_CreateGetBool
Command
(
p_vout
,
"fullscreen"
)
)
{
/* user requested fullscreen */
p_vout
->
i_changes
|=
VOUT_FULLSCREEN_CHANGE
;
...
...
@@ -466,8 +470,8 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic )
DIR
*
path
;
int
i_ret
;
memset
(
&
fmt_in
,
0
,
sizeof
(
video_format_t
));
memset
(
&
fmt_out
,
0
,
sizeof
(
video_format_t
));
memset
(
&
fmt_in
,
0
,
sizeof
(
video_format_t
)
);
memset
(
&
fmt_out
,
0
,
sizeof
(
video_format_t
)
);
var_Get
(
p_vout
,
"snapshot-path"
,
&
val
);
if
(
val
.
psz_string
&&
!*
val
.
psz_string
)
...
...
@@ -667,18 +671,29 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic )
FILE
*
p_file
;
do
{
asprintf
(
&
psz_filename
,
"%s"
DIR_SEP
"%s%05d.%s"
,
val
.
psz_string
,
psz_prefix
,
i_num
++
,
format
.
psz_string
);
if
(
asprintf
(
&
psz_filename
,
"%s"
DIR_SEP
"%s%05d.%s"
,
val
.
psz_string
,
psz_prefix
,
i_num
++
,
format
.
psz_string
)
==
-
1
)
{
msg_Err
(
p_vout
,
"could not create snapshot"
);
image_HandlerDelete
(
p_image
);
return
VLC_EGENERIC
;
}
}
while
(
(
p_file
=
utf8_fopen
(
psz_filename
,
"r"
)
)
&&
!
fclose
(
p_file
)
);
var_SetInteger
(
p_vout
,
"snapshot-num"
,
i_num
);
}
else
{
asprintf
(
&
psz_filename
,
"%s"
DIR_SEP
"%s%u.%s"
,
val
.
psz_string
,
psz_prefix
,
if
(
asprintf
(
&
psz_filename
,
"%s"
DIR_SEP
"%s%u.%s"
,
val
.
psz_string
,
psz_prefix
,
(
unsigned
int
)(
p_pic
->
date
/
100000
)
&
0xFFFFFF
,
format
.
psz_string
);
format
.
psz_string
)
==
-
1
)
{
msg_Err
(
p_vout
,
"could not create snapshot"
);
image_HandlerDelete
(
p_image
);
return
VLC_EGENERIC
;
}
}
free
(
psz_prefix
);
...
...
@@ -781,8 +796,12 @@ void vout_EnableFilter( vout_thread_t *p_vout, char *psz_name,
if
(
!
psz_parser
)
{
psz_parser
=
psz_string
;
asprintf
(
&
psz_string
,
(
*
psz_string
)
?
"%s:%s"
:
"%s%s"
,
psz_string
,
psz_name
);
if
(
asprintf
(
&
psz_string
,
(
*
psz_string
)
?
"%s:%s"
:
"%s%s"
,
psz_string
,
psz_name
)
==
-
1
)
{
free
(
psz_parser
);
return
;
}
free
(
psz_parser
);
}
else
...
...
@@ -1176,20 +1195,29 @@ static int SnapshotCallback( vlc_object_t *p_this, char const *psz_cmd,
{
vout_thread_t
*
p_vout
=
(
vout_thread_t
*
)
p_this
;
vout_Control
(
p_vout
,
VOUT_SNAPSHOT
);
(
void
)
psz_cmd
;
(
void
)
oldval
;
(
void
)
newval
;
(
void
)
p_data
;
return
VLC_SUCCESS
;
}
static
int
TitleCallback
(
vlc_object_t
*
p_this
,
char
const
*
psz_cmd
,
static
int
Title
Show
Callback
(
vlc_object_t
*
p_this
,
char
const
*
psz_cmd
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
p_data
)
{
vout_thread_t
*
p_vout
=
(
vout_thread_t
*
)
p_this
;
if
(
!
strncmp
(
psz_cmd
,
"video-title-show"
,
16
)
)
p_vout
->
b_title_show
=
newval
.
b_bool
;
else
if
(
!
strncmp
(
psz_cmd
,
"video-title-timeout"
,
19
)
)
return
VLC_SUCCESS
;
}
static
int
TitleTimeoutCallback
(
vlc_object_t
*
p_this
,
char
const
*
psz_cmd
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
p_data
)
{
vout_thread_t
*
p_vout
=
(
vout_thread_t
*
)
p_this
;
p_vout
->
i_title_timeout
=
(
mtime_t
)
newval
.
i_int
;
else
if
(
!
strncmp
(
psz_cmd
,
"video-title-position"
,
20
)
)
return
VLC_SUCCESS
;
}
static
int
TitlePositionCallback
(
vlc_object_t
*
p_this
,
char
const
*
psz_cmd
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
p_data
)
{
vout_thread_t
*
p_vout
=
(
vout_thread_t
*
)
p_this
;
p_vout
->
i_title_position
=
newval
.
i_int
;
return
VLC_SUCCESS
;
}
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