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
66603abb
Commit
66603abb
authored
Mar 07, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added picture_Export (internal) helper.
parent
5a604332
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
88 additions
and
4 deletions
+88
-4
include/vlc_vout.h
include/vlc_vout.h
+15
-0
src/libvlccore.sym
src/libvlccore.sym
+1
-0
src/video_output/vout_internal.h
src/video_output/vout_internal.h
+0
-4
src/video_output/vout_pictures.c
src/video_output/vout_pictures.c
+72
-0
No files found.
include/vlc_vout.h
View file @
66603abb
...
...
@@ -208,6 +208,21 @@ static inline void picture_Copy( picture_t *p_dst, const picture_t *p_src )
picture_CopyProperties
(
p_dst
,
p_src
);
}
/**
* This function will export a picture to an encoded bitstream.
*
* pp_image will contain the encoded bitstream in psz_format format.
*
* p_fmt can be NULL otherwise it will be set with the format used for the
* picture before encoding.
*
* i_override_width/height allow to override the width and/or the height of the
* picture to be encoded. If at most one of them is > 0 then the picture aspect
* ratio will be kept.
*/
VLC_EXPORT
(
int
,
picture_Export
,
(
vlc_object_t
*
p_obj
,
block_t
**
pp_image
,
video_format_t
*
p_fmt
,
picture_t
*
p_picture
,
vlc_fourcc_t
i_format
,
int
i_override_width
,
int
i_override_height
)
);
/**
* Video picture heap, either render (to store pictures used
* by the decoder) or output (to store pictures displayed by the vout plugin)
...
...
src/libvlccore.sym
View file @
66603abb
...
...
@@ -271,6 +271,7 @@ __osd_Volume
path_sanitize
picture_CopyPixels
picture_Delete
picture_Export
picture_New
plane_CopyPixels
playlist_Add
...
...
src/video_output/vout_internal.h
View file @
66603abb
...
...
@@ -107,10 +107,6 @@ picture_t *vout_RenderPicture( vout_thread_t *, picture_t *,
*/
void
vout_UsePictureLocked
(
vout_thread_t
*
p_vout
,
picture_t
*
p_pic
);
/*
* DO NOT use vout_UsePictureLocked unless you are in src/video_ouput.
*/
int
vout_Snapshot
(
vout_thread_t
*
,
picture_t
*
p_pic
);
#endif
...
...
src/video_output/vout_pictures.c
View file @
66603abb
...
...
@@ -36,6 +36,9 @@
#include <vlc_vout.h>
#include <vlc_osd.h>
#include <vlc_filter.h>
#include <vlc_image.h>
#include <vlc_block.h>
#include "vout_pictures.h"
#include "vout_internal.h"
...
...
@@ -1111,4 +1114,73 @@ void plane_CopyPixels( plane_t *p_dst, const plane_t *p_src )
/*****************************************************************************
*
*****************************************************************************/
int
picture_Export
(
vlc_object_t
*
p_obj
,
block_t
**
pp_image
,
video_format_t
*
p_fmt
,
picture_t
*
p_picture
,
vlc_fourcc_t
i_format
,
int
i_override_width
,
int
i_override_height
)
{
/* */
video_format_t
fmt_in
=
p_picture
->
format
;
if
(
fmt_in
.
i_sar_num
<=
0
||
fmt_in
.
i_sar_den
<=
0
)
{
fmt_in
.
i_sar_num
=
fmt_in
.
i_sar_den
=
1
;
}
/* */
video_format_t
fmt_out
;
memset
(
&
fmt_out
,
0
,
sizeof
(
fmt_out
)
);
fmt_out
.
i_sar_num
=
fmt_out
.
i_sar_den
=
1
;
fmt_out
.
i_chroma
=
i_format
;
fmt_out
.
i_width
=
i_override_width
;
fmt_out
.
i_height
=
i_override_height
;
if
(
fmt_out
.
i_height
==
0
&&
fmt_out
.
i_width
>
0
)
{
fmt_out
.
i_height
=
fmt_in
.
i_height
*
fmt_out
.
i_width
/
fmt_in
.
i_width
;
const
int
i_height
=
fmt_out
.
i_height
*
fmt_in
.
i_sar_den
/
fmt_in
.
i_sar_num
;
if
(
i_height
>
0
)
fmt_out
.
i_height
=
i_height
;
}
else
{
if
(
fmt_out
.
i_width
==
0
&&
fmt_out
.
i_height
>
0
)
{
fmt_out
.
i_width
=
fmt_in
.
i_width
*
fmt_out
.
i_height
/
fmt_in
.
i_height
;
}
else
{
fmt_out
.
i_width
=
fmt_in
.
i_width
;
fmt_out
.
i_height
=
fmt_in
.
i_height
;
}
const
int
i_width
=
fmt_out
.
i_width
*
fmt_in
.
i_sar_num
/
fmt_in
.
i_sar_den
;
if
(
i_width
>
0
)
fmt_out
.
i_width
=
i_width
;
}
image_handler_t
*
p_image
=
image_HandlerCreate
(
p_obj
);
block_t
*
p_block
=
image_Write
(
p_image
,
p_picture
,
&
fmt_in
,
&
fmt_out
);
image_HandlerDelete
(
p_image
);
if
(
!
p_block
)
return
VLC_EGENERIC
;
p_block
->
i_pts
=
p_block
->
i_dts
=
p_picture
->
date
;
if
(
p_fmt
)
*
p_fmt
=
fmt_out
;
*
pp_image
=
p_block
;
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