Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
2b50847e
Commit
2b50847e
authored
Sep 21, 2017
by
Vittorio Giovara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pixdesc: Add API to map color property names to enum values
Signed-off-by:
Vittorio Giovara
<
vittorio.giovara@gmail.com
>
parent
a5a6ac1a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
95 additions
and
1 deletion
+95
-1
APIchanges
doc/APIchanges
+5
-0
pixdesc.c
libavutil/pixdesc.c
+64
-0
pixdesc.h
libavutil/pixdesc.h
+25
-0
version.h
libavutil/version.h
+1
-1
No files found.
doc/APIchanges
View file @
2b50847e
...
...
@@ -13,6 +13,11 @@ libavutil: 2017-03-23
API changes, most recent first:
2017-xx-xx - xxxxxxx - lavu 56.6.0 - pixdesc.h
Add av_color_range_from_name(), av_color_primaries_from_name(),
av_color_transfer_from_name(), av_color_space_from_name(), and
av_chroma_location_from_name().
2016-xx-xx - xxxxxxx - lavf 58.1.0 - avio.h
Add avio_read_partial().
...
...
libavutil/pixdesc.c
View file @
2b50847e
...
...
@@ -2013,27 +2013,91 @@ const char *av_color_range_name(enum AVColorRange range)
color_range_names
[
range
]
:
NULL
;
}
int
av_color_range_from_name
(
const
char
*
name
)
{
int
i
;
for
(
i
=
0
;
i
<
FF_ARRAY_ELEMS
(
color_range_names
);
i
++
)
{
size_t
len
=
strlen
(
color_range_names
[
i
]);
if
(
!
strncmp
(
color_range_names
[
i
],
name
,
len
))
return
i
;
}
return
AVERROR
(
EINVAL
);
}
const
char
*
av_color_primaries_name
(
enum
AVColorPrimaries
primaries
)
{
return
(
unsigned
)
primaries
<
AVCOL_PRI_NB
?
color_primaries_names
[
primaries
]
:
NULL
;
}
int
av_color_primaries_from_name
(
const
char
*
name
)
{
int
i
;
for
(
i
=
0
;
i
<
FF_ARRAY_ELEMS
(
color_primaries_names
);
i
++
)
{
size_t
len
=
strlen
(
color_primaries_names
[
i
]);
if
(
!
strncmp
(
color_primaries_names
[
i
],
name
,
len
))
return
i
;
}
return
AVERROR
(
EINVAL
);
}
const
char
*
av_color_transfer_name
(
enum
AVColorTransferCharacteristic
transfer
)
{
return
(
unsigned
)
transfer
<
AVCOL_TRC_NB
?
color_transfer_names
[
transfer
]
:
NULL
;
}
int
av_color_transfer_from_name
(
const
char
*
name
)
{
int
i
;
for
(
i
=
0
;
i
<
FF_ARRAY_ELEMS
(
color_transfer_names
);
i
++
)
{
size_t
len
=
strlen
(
color_transfer_names
[
i
]);
if
(
!
strncmp
(
color_transfer_names
[
i
],
name
,
len
))
return
i
;
}
return
AVERROR
(
EINVAL
);
}
const
char
*
av_color_space_name
(
enum
AVColorSpace
space
)
{
return
(
unsigned
)
space
<
AVCOL_SPC_NB
?
color_space_names
[
space
]
:
NULL
;
}
int
av_color_space_from_name
(
const
char
*
name
)
{
int
i
;
for
(
i
=
0
;
i
<
FF_ARRAY_ELEMS
(
color_space_names
);
i
++
)
{
size_t
len
=
strlen
(
color_space_names
[
i
]);
if
(
!
strncmp
(
color_space_names
[
i
],
name
,
len
))
return
i
;
}
return
AVERROR
(
EINVAL
);
}
const
char
*
av_chroma_location_name
(
enum
AVChromaLocation
location
)
{
return
(
unsigned
)
location
<
AVCHROMA_LOC_NB
?
chroma_location_names
[
location
]
:
NULL
;
}
int
av_chroma_location_from_name
(
const
char
*
name
)
{
int
i
;
for
(
i
=
0
;
i
<
FF_ARRAY_ELEMS
(
chroma_location_names
);
i
++
)
{
size_t
len
=
strlen
(
chroma_location_names
[
i
]);
if
(
!
strncmp
(
chroma_location_names
[
i
],
name
,
len
))
return
i
;
}
return
AVERROR
(
EINVAL
);
}
libavutil/pixdesc.h
View file @
2b50847e
...
...
@@ -297,24 +297,49 @@ enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt);
*/
const
char
*
av_color_range_name
(
enum
AVColorRange
range
);
/**
* @return the AVColorRange value for name or an AVError if not found.
*/
int
av_color_range_from_name
(
const
char
*
name
);
/**
* @return the name for provided color primaries or NULL if unknown.
*/
const
char
*
av_color_primaries_name
(
enum
AVColorPrimaries
primaries
);
/**
* @return the AVColorPrimaries value for name or an AVError if not found.
*/
int
av_color_primaries_from_name
(
const
char
*
name
);
/**
* @return the name for provided color transfer or NULL if unknown.
*/
const
char
*
av_color_transfer_name
(
enum
AVColorTransferCharacteristic
transfer
);
/**
* @return the AVColorTransferCharacteristic value for name or an AVError if not found.
*/
int
av_color_transfer_from_name
(
const
char
*
name
);
/**
* @return the name for provided color space or NULL if unknown.
*/
const
char
*
av_color_space_name
(
enum
AVColorSpace
space
);
/**
* @return the AVColorSpace value for name or an AVError if not found.
*/
int
av_color_space_from_name
(
const
char
*
name
);
/**
* @return the name for provided chroma location or NULL if unknown.
*/
const
char
*
av_chroma_location_name
(
enum
AVChromaLocation
location
);
/**
* @return the AVChromaLocation value for name or an AVError if not found.
*/
int
av_chroma_location_from_name
(
const
char
*
name
);
#endif
/* AVUTIL_PIXDESC_H */
libavutil/version.h
View file @
2b50847e
...
...
@@ -54,7 +54,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 56
#define LIBAVUTIL_VERSION_MINOR
5
#define LIBAVUTIL_VERSION_MINOR
6
#define LIBAVUTIL_VERSION_MICRO 0
#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