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
2e2de104
Commit
2e2de104
authored
Jan 04, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec: split TestFfmpegChroma() in two functions
parent
fd6cead7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
17 deletions
+23
-17
modules/codec/avcodec/chroma.c
modules/codec/avcodec/chroma.c
+16
-10
modules/codec/avcodec/chroma.h
modules/codec/avcodec/chroma.h
+3
-1
modules/codec/avcodec/encoder.c
modules/codec/avcodec/encoder.c
+3
-5
modules/codec/avcodec/video.c
modules/codec/avcodec/video.c
+1
-1
No files found.
modules/codec/avcodec/chroma.c
View file @
2e2de104
...
...
@@ -122,16 +122,6 @@ static const struct
{
0
,
0
,
0
,
0
,
0
}
};
int
TestFfmpegChroma
(
int
i_ffmpeg_id
,
vlc_fourcc_t
i_vlc_fourcc
)
{
for
(
int
i
=
0
;
chroma_table
[
i
].
i_chroma
!=
0
;
i
++
)
{
if
(
chroma_table
[
i
].
i_chroma
==
i_vlc_fourcc
||
chroma_table
[
i
].
i_chroma_id
==
i_ffmpeg_id
)
return
VLC_SUCCESS
;
}
return
VLC_EGENERIC
;
}
/* FIXME special case the RGB formats */
int
GetFfmpegChroma
(
int
*
restrict
i_ffmpeg_chroma
,
const
video_format_t
*
fmt
)
{
...
...
@@ -154,6 +144,14 @@ int GetFfmpegChroma( int *restrict i_ffmpeg_chroma, const video_format_t *fmt )
return
VLC_EGENERIC
;
}
vlc_fourcc_t
FindVlcChroma
(
int
i_ffmpeg_id
)
{
for
(
int
i
=
0
;
chroma_table
[
i
].
i_chroma
!=
0
;
i
++
)
if
(
chroma_table
[
i
].
i_chroma_id
==
i_ffmpeg_id
)
return
chroma_table
[
i
].
i_chroma
;
return
0
;
}
int
GetVlcChroma
(
video_format_t
*
fmt
,
int
i_ffmpeg_chroma
)
{
/* TODO FIXME for rgb format we HAVE to set rgb mask/shift */
...
...
@@ -170,3 +168,11 @@ int GetVlcChroma( video_format_t *fmt, int i_ffmpeg_chroma )
}
return
VLC_EGENERIC
;
}
int
FindFfmpegChroma
(
vlc_fourcc_t
fourcc
)
{
for
(
int
i
=
0
;
chroma_table
[
i
].
i_chroma
!=
0
;
i
++
)
if
(
chroma_table
[
i
].
i_chroma
==
fourcc
)
return
chroma_table
[
i
].
i_chroma_id
;
return
PIX_FMT_NONE
;
}
modules/codec/avcodec/chroma.h
View file @
2e2de104
...
...
@@ -26,8 +26,10 @@
#ifndef _VLC_AVUTIL_CHROMA_H
#define _VLC_AVUTIL_CHROMA_H 1
int
TestFfmpegChroma
(
int
i_ffmpeg_id
,
vlc_fourcc_t
i_vlc_fourcc
);
int
FindFfmpegChroma
(
vlc_fourcc_t
);
int
GetFfmpegChroma
(
int
*
i_ffmpeg_chroma
,
const
video_format_t
*
fmt
);
vlc_fourcc_t
FindVlcChroma
(
int
);
int
GetVlcChroma
(
video_format_t
*
fmt
,
int
i_ffmpeg_chroma
);
#endif
modules/codec/avcodec/encoder.c
View file @
2e2de104
...
...
@@ -220,11 +220,9 @@ int OpenEncoder( vlc_object_t *p_this )
else
if
(
!
GetFfmpegCodec
(
p_enc
->
fmt_out
.
i_codec
,
&
i_cat
,
&
i_codec_id
,
&
psz_namecodec
)
)
{
if
(
TestFfmpegChroma
(
-
1
,
p_enc
->
fmt_out
.
i_codec
)
!=
VLC_SUCCESS
)
{
/* handed chroma output */
return
VLC_EGENERIC
;
}
if
(
FindFfmpegChroma
(
p_enc
->
fmt_out
.
i_codec
)
==
PIX_FMT_NONE
)
return
VLC_EGENERIC
;
/* handed chroma output */
i_cat
=
VIDEO_ES
;
i_codec_id
=
CODEC_ID_RAWVIDEO
;
psz_namecodec
=
"Raw video"
;
...
...
modules/codec/avcodec/video.c
View file @
2e2de104
...
...
@@ -902,7 +902,7 @@ static void ffmpeg_CopyPicture( decoder_t *p_dec,
{
vlc_va_Extract
(
p_sys
->
p_va
,
p_pic
,
p_ff_pic
);
}
else
if
(
TestFfmpegChroma
(
p_sys
->
p_context
->
pix_fmt
,
-
1
)
==
VLC_SUCCESS
)
else
if
(
FindVlcChroma
(
p_sys
->
p_context
->
pix_fmt
)
)
{
int
i_plane
,
i_size
,
i_line
;
uint8_t
*
p_dst
,
*
p_src
;
...
...
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