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
cfe5b8d5
Commit
cfe5b8d5
authored
Oct 22, 2010
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved vout_GetSnapshot() to video_output.c
parent
41d4b8bd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
43 deletions
+35
-43
src/video_output/video_output.c
src/video_output/video_output.c
+35
-0
src/video_output/vout_intf.c
src/video_output/vout_intf.c
+0
-43
No files found.
src/video_output/video_output.c
View file @
cfe5b8d5
...
...
@@ -44,6 +44,7 @@
#include <vlc_filter.h>
#include <vlc_vout_osd.h>
#include <vlc_image.h>
#include <libvlc.h>
#include "vout_internal.h"
...
...
@@ -440,6 +441,40 @@ void vout_HoldPicture(vout_thread_t *vout, picture_t *picture)
vlc_mutex_unlock
(
&
vout
->
p
->
picture_lock
);
}
/* */
int
vout_GetSnapshot
(
vout_thread_t
*
vout
,
block_t
**
image_dst
,
picture_t
**
picture_dst
,
video_format_t
*
fmt
,
const
char
*
type
,
mtime_t
timeout
)
{
picture_t
*
picture
=
vout_snapshot_Get
(
&
vout
->
p
->
snapshot
,
timeout
);
if
(
!
picture
)
{
msg_Err
(
vout
,
"Failed to grab a snapshot"
);
return
VLC_EGENERIC
;
}
if
(
image_dst
)
{
vlc_fourcc_t
codec
=
VLC_CODEC_PNG
;
if
(
type
&&
image_Type2Fourcc
(
type
))
codec
=
image_Type2Fourcc
(
type
);
const
int
override_width
=
var_GetInteger
(
vout
,
"snapshot-width"
);
const
int
override_height
=
var_GetInteger
(
vout
,
"snapshot-height"
);
if
(
picture_Export
(
VLC_OBJECT
(
vout
),
image_dst
,
fmt
,
picture
,
codec
,
override_width
,
override_height
))
{
msg_Err
(
vout
,
"Failed to convert image for snapshot"
);
picture_Release
(
picture
);
return
VLC_EGENERIC
;
}
}
if
(
picture_dst
)
*
picture_dst
=
picture
;
else
picture_Release
(
picture
);
return
VLC_SUCCESS
;
}
/* vout_Control* are usable by anyone at anytime */
void
vout_ControlChangeFullscreen
(
vout_thread_t
*
vout
,
bool
fullscreen
)
{
...
...
src/video_output/vout_intf.c
View file @
cfe5b8d5
...
...
@@ -32,18 +32,12 @@
#include <stdio.h>
#include <stdlib.h>
/* free() */
#include <sys/types.h>
/* opendir() */
#include <dirent.h>
/* opendir() */
#include <assert.h>
#include <time.h>
/* strftime */
#include <vlc_interface.h>
#include <vlc_block.h>
#include <vlc_playlist.h>
#include <vlc_modules.h>
#include <vlc_vout.h>
#include <vlc_image.h>
#include <vlc_vout_osd.h>
#include <vlc_strings.h>
#include <vlc_charset.h>
...
...
@@ -396,43 +390,6 @@ static void VoutOsdSnapshot( vout_thread_t *p_vout, picture_t *p_pic, const char
}
}
/* */
int
vout_GetSnapshot
(
vout_thread_t
*
p_vout
,
block_t
**
pp_image
,
picture_t
**
pp_picture
,
video_format_t
*
p_fmt
,
const
char
*
psz_format
,
mtime_t
i_timeout
)
{
picture_t
*
p_picture
=
vout_snapshot_Get
(
&
p_vout
->
p
->
snapshot
,
i_timeout
);
if
(
!
p_picture
)
{
msg_Err
(
p_vout
,
"Failed to grab a snapshot"
);
return
VLC_EGENERIC
;
}
if
(
pp_image
)
{
vlc_fourcc_t
i_format
=
VLC_CODEC_PNG
;
if
(
psz_format
&&
image_Type2Fourcc
(
psz_format
)
)
i_format
=
image_Type2Fourcc
(
psz_format
);
const
int
i_override_width
=
var_GetInteger
(
p_vout
,
"snapshot-width"
);
const
int
i_override_height
=
var_GetInteger
(
p_vout
,
"snapshot-height"
);
if
(
picture_Export
(
VLC_OBJECT
(
p_vout
),
pp_image
,
p_fmt
,
p_picture
,
i_format
,
i_override_width
,
i_override_height
)
)
{
msg_Err
(
p_vout
,
"Failed to convert image for snapshot"
);
picture_Release
(
p_picture
);
return
VLC_EGENERIC
;
}
}
if
(
pp_picture
)
*
pp_picture
=
p_picture
;
else
picture_Release
(
p_picture
);
return
VLC_SUCCESS
;
}
/**
* This function will handle a snapshot request
*/
...
...
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