Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
9c8aeacf
Commit
9c8aeacf
authored
Aug 31, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avutil: add av_get_colorspace_name()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
63139f62
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
16 deletions
+29
-16
utils.c
libavcodec/utils.c
+6
-15
frame.c
libavutil/frame.c
+16
-0
frame.h
libavutil/frame.h
+6
-0
version.h
libavutil/version.h
+1
-1
No files found.
libavcodec/utils.c
View file @
9c8aeacf
...
@@ -2631,6 +2631,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
...
@@ -2631,6 +2631,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
case
AVMEDIA_TYPE_VIDEO
:
case
AVMEDIA_TYPE_VIDEO
:
if
(
enc
->
pix_fmt
!=
AV_PIX_FMT_NONE
)
{
if
(
enc
->
pix_fmt
!=
AV_PIX_FMT_NONE
)
{
char
detail
[
256
]
=
"("
;
char
detail
[
256
]
=
"("
;
const
char
*
colorspace_name
;
snprintf
(
buf
+
strlen
(
buf
),
buf_size
-
strlen
(
buf
),
snprintf
(
buf
+
strlen
(
buf
),
buf_size
-
strlen
(
buf
),
", %s"
,
", %s"
,
av_get_pix_fmt_name
(
enc
->
pix_fmt
));
av_get_pix_fmt_name
(
enc
->
pix_fmt
));
...
@@ -2640,21 +2641,11 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
...
@@ -2640,21 +2641,11 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
if
(
enc
->
color_range
!=
AVCOL_RANGE_UNSPECIFIED
)
if
(
enc
->
color_range
!=
AVCOL_RANGE_UNSPECIFIED
)
av_strlcatf
(
detail
,
sizeof
(
detail
),
av_strlcatf
(
detail
,
sizeof
(
detail
),
enc
->
color_range
==
AVCOL_RANGE_MPEG
?
"tv, "
:
"pc, "
);
enc
->
color_range
==
AVCOL_RANGE_MPEG
?
"tv, "
:
"pc, "
);
if
(
enc
->
colorspace
<
9U
)
{
static
const
char
*
name
[]
=
{
colorspace_name
=
av_get_colorspace_name
(
enc
->
colorspace
);
"GBR"
,
if
(
colorspace_name
)
"bt709"
,
av_strlcatf
(
detail
,
sizeof
(
detail
),
"%s, "
,
colorspace_name
);
NULL
,
NULL
,
"fcc"
,
"bt470bg"
,
"smpte170m"
,
"smpte240m"
,
"YCgCo"
,
};
if
(
name
[
enc
->
colorspace
])
av_strlcatf
(
detail
,
sizeof
(
detail
),
"%s, "
,
name
[
enc
->
colorspace
]);
}
if
(
strlen
(
detail
)
>
1
)
{
if
(
strlen
(
detail
)
>
1
)
{
detail
[
strlen
(
detail
)
-
2
]
=
0
;
detail
[
strlen
(
detail
)
-
2
]
=
0
;
av_strlcatf
(
buf
,
buf_size
,
"%s)"
,
detail
);
av_strlcatf
(
buf
,
buf_size
,
"%s)"
,
detail
);
...
...
libavutil/frame.c
View file @
9c8aeacf
...
@@ -70,6 +70,22 @@ int8_t *av_frame_get_qp_table(AVFrame *f, int *stride, int *type)
...
@@ -70,6 +70,22 @@ int8_t *av_frame_get_qp_table(AVFrame *f, int *stride, int *type)
return
f
->
qp_table_buf
->
data
;
return
f
->
qp_table_buf
->
data
;
}
}
const
char
*
av_get_colorspace_name
(
enum
AVColorSpace
val
)
{
static
const
char
*
name
[]
=
{
[
AVCOL_SPC_RGB
]
=
"GBR"
,
[
AVCOL_SPC_BT709
]
=
"bt709"
,
[
AVCOL_SPC_FCC
]
=
"fcc"
,
[
AVCOL_SPC_BT470BG
]
=
"bt470bg"
,
[
AVCOL_SPC_SMPTE170M
]
=
"smpte170m"
,
[
AVCOL_SPC_SMPTE240M
]
=
"smpte240m"
,
[
AVCOL_SPC_YCOCG
]
=
"YCgCo"
,
};
if
(
val
<
0
||
val
>=
FF_ARRAY_ELEMS
(
name
))
return
NULL
;
return
name
[
val
];
}
static
void
get_frame_defaults
(
AVFrame
*
frame
)
static
void
get_frame_defaults
(
AVFrame
*
frame
)
{
{
if
(
frame
->
extended_data
!=
frame
->
data
)
if
(
frame
->
extended_data
!=
frame
->
data
)
...
...
libavutil/frame.h
View file @
9c8aeacf
...
@@ -508,6 +508,12 @@ void av_frame_set_colorspace(AVFrame *frame, enum AVColorSpace val);
...
@@ -508,6 +508,12 @@ void av_frame_set_colorspace(AVFrame *frame, enum AVColorSpace val);
enum
AVColorRange
av_frame_get_color_range
(
const
AVFrame
*
frame
);
enum
AVColorRange
av_frame_get_color_range
(
const
AVFrame
*
frame
);
void
av_frame_set_color_range
(
AVFrame
*
frame
,
enum
AVColorRange
val
);
void
av_frame_set_color_range
(
AVFrame
*
frame
,
enum
AVColorRange
val
);
/**
* Get the name of a colorspace.
* @return a static string identifying the colorspace; can be NULL.
*/
const
char
*
av_get_colorspace_name
(
enum
AVColorSpace
val
);
/**
/**
* Allocate an AVFrame and set its fields to default values. The resulting
* Allocate an AVFrame and set its fields to default values. The resulting
* struct must be freed using av_frame_free().
* struct must be freed using av_frame_free().
...
...
libavutil/version.h
View file @
9c8aeacf
...
@@ -75,7 +75,7 @@
...
@@ -75,7 +75,7 @@
*/
*/
#define LIBAVUTIL_VERSION_MAJOR 52
#define LIBAVUTIL_VERSION_MAJOR 52
#define LIBAVUTIL_VERSION_MINOR 4
4
#define LIBAVUTIL_VERSION_MINOR 4
5
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
...
...
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