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
4179a9e5
Commit
4179a9e5
authored
May 16, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added video_format_Setup to replace vout_InitFormat.
parent
b110c387
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
82 additions
and
75 deletions
+82
-75
include/vlc_es.h
include/vlc_es.h
+6
-0
src/libvlccore.sym
src/libvlccore.sym
+1
-0
src/misc/es_format.c
src/misc/es_format.c
+74
-0
src/video_output/vout_pictures.c
src/video_output/vout_pictures.c
+1
-75
No files found.
include/vlc_es.h
View file @
4179a9e5
...
@@ -171,6 +171,12 @@ static inline void video_format_Clean( video_format_t *p_src )
...
@@ -171,6 +171,12 @@ static inline void video_format_Clean( video_format_t *p_src )
p_src
->
p_palette
=
NULL
;
p_src
->
p_palette
=
NULL
;
}
}
/**
* It will fill up a video_format_tvideo_format_t using the given arguments.
* Becarefull that the video_format_t must already be initialized.
*/
VLC_EXPORT
(
void
,
video_format_Setup
,
(
video_format_t
*
,
vlc_fourcc_t
i_chroma
,
int
i_width
,
int
i_height
,
int
i_aspect
)
);
/**
/**
* subtitles format description
* subtitles format description
*/
*/
...
...
src/libvlccore.sym
View file @
4179a9e5
...
@@ -423,6 +423,7 @@ var_SetChecked
...
@@ -423,6 +423,7 @@ var_SetChecked
__var_TriggerCallback
__var_TriggerCallback
__var_Type
__var_Type
video_format_FixRgb
video_format_FixRgb
video_format_Setup
vlc_avcodec_mutex
vlc_avcodec_mutex
vlc_b64_decode
vlc_b64_decode
vlc_b64_decode_binary
vlc_b64_decode_binary
...
...
src/misc/es_format.c
View file @
4179a9e5
...
@@ -128,6 +128,80 @@ void video_format_FixRgb( video_format_t *p_fmt )
...
@@ -128,6 +128,80 @@ void video_format_FixRgb( video_format_t *p_fmt )
p_fmt
->
i_bmask
);
p_fmt
->
i_bmask
);
}
}
void
video_format_Setup
(
video_format_t
*
p_fmt
,
vlc_fourcc_t
i_chroma
,
int
i_width
,
int
i_height
,
int
i_aspect
)
{
p_fmt
->
i_chroma
=
vlc_fourcc_GetCodec
(
VIDEO_ES
,
i_chroma
);
p_fmt
->
i_width
=
p_fmt
->
i_visible_width
=
i_width
;
p_fmt
->
i_height
=
p_fmt
->
i_visible_height
=
i_height
;
p_fmt
->
i_x_offset
=
p_fmt
->
i_y_offset
=
0
;
p_fmt
->
i_aspect
=
i_aspect
;
switch
(
p_fmt
->
i_chroma
)
{
case
VLC_CODEC_YUVA
:
p_fmt
->
i_bits_per_pixel
=
32
;
break
;
case
VLC_CODEC_I444
:
case
VLC_CODEC_J444
:
p_fmt
->
i_bits_per_pixel
=
24
;
break
;
case
VLC_CODEC_I422
:
case
VLC_CODEC_YUYV
:
case
VLC_CODEC_YVYU
:
case
VLC_CODEC_UYVY
:
case
VLC_CODEC_VYUY
:
case
VLC_CODEC_J422
:
p_fmt
->
i_bits_per_pixel
=
16
;
break
;
case
VLC_CODEC_I440
:
case
VLC_CODEC_J440
:
p_fmt
->
i_bits_per_pixel
=
16
;
break
;
case
VLC_CODEC_I411
:
case
VLC_CODEC_YV12
:
case
VLC_CODEC_I420
:
case
VLC_CODEC_J420
:
p_fmt
->
i_bits_per_pixel
=
12
;
break
;
case
VLC_CODEC_I410
:
p_fmt
->
i_bits_per_pixel
=
9
;
break
;
case
VLC_CODEC_Y211
:
p_fmt
->
i_bits_per_pixel
=
8
;
break
;
case
VLC_CODEC_YUVP
:
p_fmt
->
i_bits_per_pixel
=
8
;
break
;
case
VLC_CODEC_RGB32
:
case
VLC_CODEC_RGBA
:
p_fmt
->
i_bits_per_pixel
=
32
;
break
;
case
VLC_CODEC_RGB24
:
p_fmt
->
i_bits_per_pixel
=
24
;
break
;
case
VLC_CODEC_RGB15
:
case
VLC_CODEC_RGB16
:
p_fmt
->
i_bits_per_pixel
=
16
;
break
;
case
VLC_CODEC_RGB8
:
p_fmt
->
i_bits_per_pixel
=
8
;
break
;
case
VLC_CODEC_GREY
:
case
VLC_CODEC_RGBP
:
p_fmt
->
i_bits_per_pixel
=
8
;
break
;
default:
p_fmt
->
i_bits_per_pixel
=
0
;
break
;
}
}
void
es_format_Init
(
es_format_t
*
fmt
,
void
es_format_Init
(
es_format_t
*
fmt
,
int
i_cat
,
vlc_fourcc_t
i_codec
)
int
i_cat
,
vlc_fourcc_t
i_codec
)
{
{
...
...
src/video_output/vout_pictures.c
View file @
4179a9e5
...
@@ -605,81 +605,7 @@ int __vout_AllocatePicture( vlc_object_t *p_this, picture_t *p_pic,
...
@@ -605,81 +605,7 @@ int __vout_AllocatePicture( vlc_object_t *p_this, picture_t *p_pic,
void
vout_InitFormat
(
video_frame_format_t
*
p_format
,
vlc_fourcc_t
i_chroma
,
void
vout_InitFormat
(
video_frame_format_t
*
p_format
,
vlc_fourcc_t
i_chroma
,
int
i_width
,
int
i_height
,
int
i_aspect
)
int
i_width
,
int
i_height
,
int
i_aspect
)
{
{
p_format
->
i_chroma
=
i_chroma
;
video_format_Setup
(
p_format
,
i_chroma
,
i_width
,
i_height
,
i_aspect
);
p_format
->
i_width
=
p_format
->
i_visible_width
=
i_width
;
p_format
->
i_height
=
p_format
->
i_visible_height
=
i_height
;
p_format
->
i_x_offset
=
p_format
->
i_y_offset
=
0
;
p_format
->
i_aspect
=
i_aspect
;
#if 0
/* Assume we have square pixels */
if( i_width && i_height )
p_format->i_aspect = i_width * VOUT_ASPECT_FACTOR / i_height;
else
p_format->i_aspect = 0;
#endif
switch
(
vlc_fourcc_GetCodec
(
VIDEO_ES
,
i_chroma
)
)
{
case
VLC_CODEC_YUVA
:
p_format
->
i_bits_per_pixel
=
32
;
break
;
case
VLC_CODEC_I444
:
case
VLC_CODEC_J444
:
p_format
->
i_bits_per_pixel
=
24
;
break
;
case
VLC_CODEC_I422
:
case
VLC_CODEC_YUYV
:
case
VLC_CODEC_YVYU
:
case
VLC_CODEC_UYVY
:
case
VLC_CODEC_VYUY
:
case
VLC_CODEC_J422
:
p_format
->
i_bits_per_pixel
=
16
;
break
;
case
VLC_CODEC_I440
:
case
VLC_CODEC_J440
:
p_format
->
i_bits_per_pixel
=
16
;
break
;
case
VLC_CODEC_I411
:
case
VLC_CODEC_YV12
:
case
VLC_CODEC_I420
:
case
VLC_CODEC_J420
:
p_format
->
i_bits_per_pixel
=
12
;
break
;
case
VLC_CODEC_I410
:
p_format
->
i_bits_per_pixel
=
9
;
break
;
case
VLC_CODEC_Y211
:
p_format
->
i_bits_per_pixel
=
8
;
break
;
case
VLC_CODEC_YUVP
:
p_format
->
i_bits_per_pixel
=
8
;
break
;
case
VLC_CODEC_RGB32
:
case
VLC_CODEC_RGBA
:
p_format
->
i_bits_per_pixel
=
32
;
break
;
case
VLC_CODEC_RGB24
:
p_format
->
i_bits_per_pixel
=
24
;
break
;
case
VLC_CODEC_RGB15
:
case
VLC_CODEC_RGB16
:
p_format
->
i_bits_per_pixel
=
16
;
break
;
case
VLC_CODEC_RGB8
:
p_format
->
i_bits_per_pixel
=
8
;
break
;
case
VLC_CODEC_GREY
:
case
VLC_CODEC_RGBP
:
p_format
->
i_bits_per_pixel
=
8
;
break
;
default:
p_format
->
i_bits_per_pixel
=
0
;
break
;
}
}
}
/**
/**
...
...
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