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
1d67f7b1
Commit
1d67f7b1
authored
Oct 26, 2007
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add snapshot command to rc interface and make snapshot-width and snapshot-height user modifiable.
parent
a8de7281
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
13 deletions
+36
-13
modules/control/rc.c
modules/control/rc.c
+17
-8
src/libvlc-module.c
src/libvlc-module.c
+14
-0
src/video_output/vout_intf.c
src/video_output/vout_intf.c
+5
-5
No files found.
modules/control/rc.c
View file @
1d67f7b1
...
...
@@ -408,6 +408,7 @@ static void RegisterCallbacks( intf_thread_t *p_intf )
ADD
(
"vratio"
,
STRING
,
VideoConfig
)
ADD
(
"vcrop"
,
STRING
,
VideoConfig
)
ADD
(
"vzoom"
,
STRING
,
VideoConfig
)
ADD
(
"snapshot"
,
VOID
,
VideoConfig
)
/* audio commands */
ADD
(
"volume"
,
STRING
,
Volume
)
...
...
@@ -883,6 +884,7 @@ static void Help( intf_thread_t *p_intf, vlc_bool_t b_longhelp)
msg_rc
(
_
(
"| vratio [X] . . . . . . . set/get video aspect ratio"
));
msg_rc
(
_
(
"| vcrop [X] . . . . . . . . . . . set/get video crop"
));
msg_rc
(
_
(
"| vzoom [X] . . . . . . . . . . . set/get video zoom"
));
msg_rc
(
_
(
"| snapshot . . . . . . . . . . . . take video snapshot"
));
msg_rc
(
_
(
"| strack [X] . . . . . . . . . set/get subtitles track"
));
msg_rc
(
_
(
"| key [hotkey name] . . . . . . simulate hotkey press"
));
msg_rc
(
_
(
"| menu . . [on|off|up|down|left|right|select] use menu"
));
...
...
@@ -1634,7 +1636,6 @@ static int VideoConfig( vlc_object_t *p_this, char const *psz_cmd,
input_thread_t
*
p_input
=
NULL
;
vout_thread_t
*
p_vout
;
const
char
*
psz_variable
;
vlc_value_t
val_name
;
int
i_error
;
p_input
=
vlc_object_find
(
p_this
,
VLC_OBJECT_INPUT
,
FIND_ANYWHERE
);
...
...
@@ -1654,16 +1655,14 @@ static int VideoConfig( vlc_object_t *p_this, char const *psz_cmd,
{
psz_variable
=
"aspect-ratio"
;
}
else
/* if( !strcmp( psz_cmd, "vzoom" ) ) */
else
if
(
!
strcmp
(
psz_cmd
,
"vzoom"
)
)
{
psz_variable
=
"zoom"
;
}
/* Get the descriptive name of the variable */
var_Change
(
p_vout
,
psz_variable
,
VLC_VAR_GETTEXT
,
&
val_name
,
NULL
);
if
(
!
val_name
.
psz_string
)
val_name
.
psz_string
=
strdup
(
psz_variable
);
else
if
(
!
strcmp
(
psz_cmd
,
"snapshot"
)
)
{
psz_variable
=
"video-snapshot"
;
}
if
(
newval
.
psz_string
&&
*
newval
.
psz_string
)
{
...
...
@@ -1679,9 +1678,14 @@ static int VideoConfig( vlc_object_t *p_this, char const *psz_cmd,
i_error
=
var_Set
(
p_vout
,
psz_variable
,
newval
);
}
}
else
if
(
!
strcmp
(
psz_cmd
,
"snapshot"
)
)
{
i_error
=
var_Set
(
p_vout
,
psz_variable
,
newval
);
}
else
{
/* get */
vlc_value_t
val_name
;
vlc_value_t
val
,
text
;
int
i
;
float
f_value
=
0
.;
...
...
@@ -1708,6 +1712,11 @@ static int VideoConfig( vlc_object_t *p_this, char const *psz_cmd,
return
VLC_EGENERIC
;
}
/* Get the descriptive name of the variable */
var_Change
(
p_vout
,
psz_variable
,
VLC_VAR_GETTEXT
,
&
val_name
,
NULL
);
if
(
!
val_name
.
psz_string
)
val_name
.
psz_string
=
strdup
(
psz_variable
);
msg_rc
(
"+----[ %s ]"
,
val_name
.
psz_string
);
if
(
!
strcmp
(
psz_variable
,
"zoom"
)
)
{
...
...
src/libvlc-module.c
View file @
1d67f7b1
...
...
@@ -444,6 +444,16 @@ static const char *ppsz_pos_descriptions[] =
#define SNAP_SEQUENTIAL_LONGTEXT N_( \
"Use sequential numbers instead of timestamps for snapshot numbering")
#define SNAP_WIDTH_TEXT N_("Video snapshot width")
#define SNAP_WIDTH_LONGTEXT N_( \
"You can enforce the width of the video snapshot. By default " \
"it will be 320 pixels." )
#define SNAP_HEIGHT_TEXT N_("Video snapshot height")
#define SNAP_HEIGHT_LONGTEXT N_( \
"You can enforce the height of the video snapshot. By default " \
"it will be 200 pixels." )
#define CROP_TEXT N_("Video cropping")
#define CROP_LONGTEXT N_( \
"This forces the cropping of the source video. " \
...
...
@@ -1475,6 +1485,10 @@ vlc_module_begin();
SNAP_PREVIEW_LONGTEXT
,
VLC_FALSE
);
add_bool
(
"snapshot-sequential"
,
VLC_FALSE
,
NULL
,
SNAP_SEQUENTIAL_TEXT
,
SNAP_SEQUENTIAL_LONGTEXT
,
VLC_FALSE
);
add_integer
(
"snapshot-width"
,
320
,
NULL
,
SNAP_WIDTH_TEXT
,
SNAP_WIDTH_LONGTEXT
,
VLC_TRUE
);
add_integer
(
"snapshot-height"
,
200
,
NULL
,
SNAP_HEIGHT_TEXT
,
SNAP_HEIGHT_LONGTEXT
,
VLC_TRUE
);
set_section
(
N_
(
"Window properties"
),
NULL
);
add_integer
(
"width"
,
-
1
,
NULL
,
WIDTH_TEXT
,
WIDTH_LONGTEXT
,
VLC_TRUE
);
...
...
src/video_output/vout_intf.c
View file @
1d67f7b1
...
...
@@ -202,6 +202,8 @@ void vout_IntfInit( vout_thread_t *p_vout )
VLC_VAR_BOOL
|
VLC_VAR_DOINHERIT
);
var_Create
(
p_vout
,
"snapshot-num"
,
VLC_VAR_INTEGER
);
var_SetInteger
(
p_vout
,
"snapshot-num"
,
1
);
var_Create
(
p_vout
,
"snapshot-width"
,
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
var_Create
(
p_vout
,
"snapshot-height"
,
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
var_Create
(
p_vout
,
"width"
,
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
var_Create
(
p_vout
,
"height"
,
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
...
...
@@ -516,9 +518,10 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic )
fmt_out
.
i_sar_num
=
fmt_out
.
i_sar_den
=
1
;
/* FIXME: should not be hardcoded. We should be able to
specify the snapshot size (snapshot-width and snapshot-height). */
fmt_out
.
i_width
=
320
;
fmt_out
.
i_height
=
200
;
fmt_out
.
i_width
=
var_GetInteger
(
p_vout
,
"snapshot-width"
)
;
fmt_out
.
i_height
=
var_GetInteger
(
p_vout
,
"snapshot-height"
)
;
fmt_out
.
i_chroma
=
VLC_FOURCC
(
'p'
,
'n'
,
'g'
,
' '
);
p_block
=
(
block_t
*
)
image_Write
(
p_image
,
p_pic
,
&
fmt_in
,
&
fmt_out
);
if
(
!
p_block
)
{
...
...
@@ -571,7 +574,6 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic )
return
VLC_SUCCESS
;
}
#if defined(__APPLE__) || defined(SYS_BEOS)
if
(
!
val
.
psz_string
&&
p_vout
->
p_libvlc
->
psz_homedir
)
{
...
...
@@ -658,7 +660,6 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic )
* Did the user specify a directory? If not, path = NULL.
*/
path
=
utf8_opendir
(
(
const
char
*
)
val
.
psz_string
);
if
(
path
!=
NULL
)
{
char
*
psz_prefix
=
var_GetNonEmptyString
(
p_vout
,
"snapshot-prefix"
);
...
...
@@ -1193,4 +1194,3 @@ static int TitleCallback( vlc_object_t *p_this, char const *psz_cmd,
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