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
773363e0
Commit
773363e0
authored
Mar 08, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a vout_GetSnapshot to retreive snapshot from vout.
It will allows to remove libvlc hack.
parent
44de9534
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
21 deletions
+43
-21
include/vlc_vout.h
include/vlc_vout.h
+17
-0
src/libvlccore.sym
src/libvlccore.sym
+1
-0
src/video_output/vout_intf.c
src/video_output/vout_intf.c
+25
-21
No files found.
include/vlc_vout.h
View file @
773363e0
...
@@ -683,6 +683,23 @@ static inline void vout_CloseAndRelease( vout_thread_t *p_vout )
...
@@ -683,6 +683,23 @@ static inline void vout_CloseAndRelease( vout_thread_t *p_vout )
vlc_object_release
(
p_vout
);
vlc_object_release
(
p_vout
);
}
}
/**
* This function will handle a snapshot request.
*
* pp_image, pp_picture and p_fmt can be NULL otherwise they will be
* set with returned value in case of success.
*
* pp_image will hold an encoded picture in psz_format format.
*
* i_timeout specifies the time the function will wait for a snapshot to be
* available.
*
*/
VLC_EXPORT
(
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
)
);
/* */
/* */
VLC_EXPORT
(
int
,
vout_ChromaCmp
,
(
uint32_t
,
uint32_t
)
);
VLC_EXPORT
(
int
,
vout_ChromaCmp
,
(
uint32_t
,
uint32_t
)
);
...
...
src/libvlccore.sym
View file @
773363e0
...
@@ -513,6 +513,7 @@ vout_CreatePicture
...
@@ -513,6 +513,7 @@ vout_CreatePicture
vout_DestroyPicture
vout_DestroyPicture
vout_DisplayPicture
vout_DisplayPicture
vout_EnableFilter
vout_EnableFilter
vout_GetSnapshot
vout_InitFormat
vout_InitFormat
__vout_InitPicture
__vout_InitPicture
vout_LinkPicture
vout_LinkPicture
...
...
src/video_output/vout_intf.c
View file @
773363e0
...
@@ -745,13 +745,12 @@ static void VoutOsdSnapshot( vout_thread_t *p_vout, picture_t *p_pic, const char
...
@@ -745,13 +745,12 @@ static void VoutOsdSnapshot( vout_thread_t *p_vout, picture_t *p_pic, const char
msg_Warn
(
p_vout
,
"Failed to display snapshot"
);
msg_Warn
(
p_vout
,
"Failed to display snapshot"
);
}
}
}
}
/**
* This function will retreive a snapshot from vout
/* */
*/
int
vout_GetSnapshot
(
vout_thread_t
*
p_vout
,
static
int
VoutGetSnapshot
(
vout_thread_t
*
p_vout
,
block_t
**
pp_image
,
picture_t
**
pp_picture
,
block_t
**
pp_image
,
picture_t
**
pp_picture
,
video_format_t
*
p_fmt
,
video_format_t
*
p_fmt
,
const
char
*
psz_format
,
mtime_t
i_timeout
)
const
char
*
psz_format
,
mtime_t
i_timeout
)
{
{
vout_thread_sys_t
*
p_sys
=
p_vout
->
p
;
vout_thread_sys_t
*
p_sys
=
p_vout
->
p
;
...
@@ -779,22 +778,27 @@ static int VoutGetSnapshot( vout_thread_t *p_vout,
...
@@ -779,22 +778,27 @@ static int VoutGetSnapshot( vout_thread_t *p_vout,
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
vlc_fourcc_t
i_format
=
VLC_FOURCC
(
'p'
,
'n'
,
'g'
,
' '
);
if
(
pp_image
)
if
(
psz_format
&&
image_Ext2Fourcc
(
psz_format
)
)
{
i_format
=
image_Ext2Fourcc
(
psz_format
);
vlc_fourcc_t
i_format
=
VLC_FOURCC
(
'p'
,
'n'
,
'g'
,
' '
);
if
(
psz_format
&&
image_Ext2Fourcc
(
psz_format
)
)
i_format
=
image_Ext2Fourcc
(
psz_format
);
const
int
i_override_width
=
var_GetInteger
(
p_vout
,
"snapshot-width"
);
const
int
i_override_width
=
var_GetInteger
(
p_vout
,
"snapshot-width"
);
const
int
i_override_height
=
var_GetInteger
(
p_vout
,
"snapshot-height"
);
const
int
i_override_height
=
var_GetInteger
(
p_vout
,
"snapshot-height"
);
if
(
picture_Export
(
VLC_OBJECT
(
p_vout
),
pp_image
,
p_fmt
,
if
(
picture_Export
(
VLC_OBJECT
(
p_vout
),
pp_image
,
p_fmt
,
p_picture
,
i_format
,
i_override_width
,
i_override_height
)
)
p_picture
,
i_format
,
i_override_width
,
i_override_height
)
)
{
{
msg_Err
(
p_vout
,
"Failed to convert image for snapshot"
);
msg_Err
(
p_vout
,
"Failed to convert image for snapshot"
);
picture_Release
(
p_picture
);
picture_Release
(
p_picture
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
}
if
(
pp_picture
)
*
pp_picture
=
p_picture
;
*
pp_picture
=
p_picture
;
else
picture_Release
(
p_picture
);
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
...
@@ -817,7 +821,7 @@ static void VoutSaveSnapshot( vout_thread_t *p_vout )
...
@@ -817,7 +821,7 @@ static void VoutSaveSnapshot( vout_thread_t *p_vout )
/* 500ms timeout
/* 500ms timeout
* XXX it will cause trouble with low fps video (< 2fps) */
* XXX it will cause trouble with low fps video (< 2fps) */
if
(
Vout
GetSnapshot
(
p_vout
,
&
p_image
,
&
p_picture
,
&
fmt
,
psz_format
,
500
*
1000
)
)
if
(
vout_
GetSnapshot
(
p_vout
,
&
p_image
,
&
p_picture
,
&
fmt
,
psz_format
,
500
*
1000
)
)
{
{
if
(
b_embedded
)
if
(
b_embedded
)
VoutMemorySnapshot
(
p_vout
,
p_obj
,
NULL
,
NULL
);
VoutMemorySnapshot
(
p_vout
,
p_obj
,
NULL
,
NULL
);
...
...
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