Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
6dd83267
Commit
6dd83267
authored
Feb 23, 2024
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc: add content light/mastering display side data wrappers
parent
8a70c5cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
0 deletions
+46
-0
decode.c
libavcodec/decode.c
+25
-0
decode.h
libavcodec/decode.h
+21
-0
No files found.
libavcodec/decode.c
View file @
6dd83267
...
...
@@ -35,6 +35,7 @@
#include "libavutil/hwcontext.h"
#include "libavutil/imgutils.h"
#include "libavutil/internal.h"
#include "libavutil/mastering_display_metadata.h"
#include "avcodec.h"
#include "avcodec_internal.h"
...
...
@@ -1857,6 +1858,30 @@ finish:
return
ret
;
}
int
ff_decode_mastering_display_new
(
const
AVCodecContext
*
avctx
,
AVFrame
*
frame
,
AVMasteringDisplayMetadata
**
mdm
)
{
if
(
side_data_pref
(
avctx
,
frame
,
AV_FRAME_DATA_MASTERING_DISPLAY_METADATA
))
{
*
mdm
=
NULL
;
return
0
;
}
*
mdm
=
av_mastering_display_metadata_create_side_data
(
frame
);
return
*
mdm
?
0
:
AVERROR
(
ENOMEM
);
}
int
ff_decode_content_light_new
(
const
AVCodecContext
*
avctx
,
AVFrame
*
frame
,
AVContentLightMetadata
**
clm
)
{
if
(
side_data_pref
(
avctx
,
frame
,
AV_FRAME_DATA_CONTENT_LIGHT_LEVEL
))
{
*
clm
=
NULL
;
return
0
;
}
*
clm
=
av_content_light_metadata_create_side_data
(
frame
);
return
*
clm
?
0
:
AVERROR
(
ENOMEM
);
}
int
ff_copy_palette
(
void
*
dst
,
const
AVPacket
*
src
,
void
*
logctx
)
{
size_t
size
;
...
...
libavcodec/decode.h
View file @
6dd83267
...
...
@@ -175,4 +175,25 @@ int ff_frame_new_side_data_from_buf(const AVCodecContext *avctx,
AVFrame
*
frame
,
enum
AVFrameSideDataType
type
,
AVBufferRef
**
buf
,
AVFrameSideData
**
sd
);
struct
AVMasteringDisplayMetadata
;
struct
AVContentLightMetadata
;
/**
* Wrapper around av_mastering_display_metadata_create_side_data(), which
* rejects side data overridden by the demuxer. Returns 0 on success, and a
* negative error code otherwise. If successful, *mdm may either be a pointer to
* the new side data, or NULL in case the side data was already present.
*/
int
ff_decode_mastering_display_new
(
const
AVCodecContext
*
avctx
,
AVFrame
*
frame
,
struct
AVMasteringDisplayMetadata
**
mdm
);
/**
* Wrapper around av_content_light_metadata_create_side_data(), which
* rejects side data overridden by the demuxer. Returns 0 on success, and a
* negative error code otherwise. If successful, *clm may either be a pointer to
* the new side data, or NULL in case the side data was already present.
*/
int
ff_decode_content_light_new
(
const
AVCodecContext
*
avctx
,
AVFrame
*
frame
,
struct
AVContentLightMetadata
**
clm
);
#endif
/* AVCODEC_DECODE_H */
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