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
2621be35
Commit
2621be35
authored
Mar 23, 2024
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavu/frame: add side data descriptors
They allow exporting extended information about side data types.
parent
6b213175
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
82 additions
and
31 deletions
+82
-31
APIchanges
doc/APIchanges
+4
-0
frame.c
libavutil/frame.c
+40
-30
frame.h
libavutil/frame.h
+37
-0
version.h
libavutil/version.h
+1
-1
No files found.
doc/APIchanges
View file @
2621be35
...
...
@@ -2,6 +2,10 @@ The last version increases of all libraries were on 2024-03-07
API changes, most recent first:
2024-03-27 - xxxxxxxxxx - lavu 59.10.100 - frame.h
Add AVSideDataDescriptor, enum AVSideDataProps, and
av_frame_side_data_desc().
-------- 8< --------- FFmpeg 7.0 was cut here -------- 8< ---------
2024-03-25 - 5df901ffa56 - lavu 59.7.100 - timestamp.h
...
...
libavutil/frame.c
View file @
2621be35
...
...
@@ -28,6 +28,36 @@
#include "samplefmt.h"
#include "hwcontext.h"
static
const
AVSideDataDescriptor
sd_props
[]
=
{
[
AV_FRAME_DATA_PANSCAN
]
=
{
"AVPanScan"
},
[
AV_FRAME_DATA_A53_CC
]
=
{
"ATSC A53 Part 4 Closed Captions"
},
[
AV_FRAME_DATA_MATRIXENCODING
]
=
{
"AVMatrixEncoding"
},
[
AV_FRAME_DATA_DOWNMIX_INFO
]
=
{
"Metadata relevant to a downmix procedure"
},
[
AV_FRAME_DATA_AFD
]
=
{
"Active format description"
},
[
AV_FRAME_DATA_MOTION_VECTORS
]
=
{
"Motion vectors"
},
[
AV_FRAME_DATA_SKIP_SAMPLES
]
=
{
"Skip samples"
},
[
AV_FRAME_DATA_GOP_TIMECODE
]
=
{
"GOP timecode"
},
[
AV_FRAME_DATA_S12M_TIMECODE
]
=
{
"SMPTE 12-1 timecode"
},
[
AV_FRAME_DATA_DYNAMIC_HDR_PLUS
]
=
{
"HDR Dynamic Metadata SMPTE2094-40 (HDR10+)"
},
[
AV_FRAME_DATA_DYNAMIC_HDR_VIVID
]
=
{
"HDR Dynamic Metadata CUVA 005.1 2021 (Vivid)"
},
[
AV_FRAME_DATA_REGIONS_OF_INTEREST
]
=
{
"Regions Of Interest"
},
[
AV_FRAME_DATA_VIDEO_ENC_PARAMS
]
=
{
"Video encoding parameters"
},
[
AV_FRAME_DATA_FILM_GRAIN_PARAMS
]
=
{
"Film grain parameters"
},
[
AV_FRAME_DATA_DETECTION_BBOXES
]
=
{
"Bounding boxes for object detection and classification"
},
[
AV_FRAME_DATA_DOVI_RPU_BUFFER
]
=
{
"Dolby Vision RPU Data"
},
[
AV_FRAME_DATA_DOVI_METADATA
]
=
{
"Dolby Vision Metadata"
},
[
AV_FRAME_DATA_STEREO3D
]
=
{
"Stereo 3D"
,
AV_SIDE_DATA_PROP_GLOBAL
},
[
AV_FRAME_DATA_REPLAYGAIN
]
=
{
"AVReplayGain"
,
AV_SIDE_DATA_PROP_GLOBAL
},
[
AV_FRAME_DATA_DISPLAYMATRIX
]
=
{
"3x3 displaymatrix"
,
AV_SIDE_DATA_PROP_GLOBAL
},
[
AV_FRAME_DATA_AUDIO_SERVICE_TYPE
]
=
{
"Audio service type"
,
AV_SIDE_DATA_PROP_GLOBAL
},
[
AV_FRAME_DATA_MASTERING_DISPLAY_METADATA
]
=
{
"Mastering display metadata"
,
AV_SIDE_DATA_PROP_GLOBAL
},
[
AV_FRAME_DATA_CONTENT_LIGHT_LEVEL
]
=
{
"Content light level metadata"
,
AV_SIDE_DATA_PROP_GLOBAL
},
[
AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT
]
=
{
"Ambient viewing environment"
,
AV_SIDE_DATA_PROP_GLOBAL
},
[
AV_FRAME_DATA_SPHERICAL
]
=
{
"Spherical Mapping"
,
AV_SIDE_DATA_PROP_GLOBAL
},
[
AV_FRAME_DATA_ICC_PROFILE
]
=
{
"ICC profile"
,
AV_SIDE_DATA_PROP_GLOBAL
},
[
AV_FRAME_DATA_SEI_UNREGISTERED
]
=
{
"H.26[45] User Data Unregistered SEI message"
,
AV_SIDE_DATA_PROP_MULTI
},
};
static
void
get_frame_defaults
(
AVFrame
*
frame
)
{
memset
(
frame
,
0
,
sizeof
(
*
frame
));
...
...
@@ -896,40 +926,20 @@ void av_frame_remove_side_data(AVFrame *frame, enum AVFrameSideDataType type)
remove_side_data
(
&
frame
->
side_data
,
&
frame
->
nb_side_data
,
type
);
}
const
char
*
av_frame_side_data_name
(
enum
AVFrameSideDataType
type
)
const
AVSideDataDescriptor
*
av_frame_side_data_desc
(
enum
AVFrameSideDataType
type
)
{
switch
(
type
)
{
case
AV_FRAME_DATA_PANSCAN
:
return
"AVPanScan"
;
case
AV_FRAME_DATA_A53_CC
:
return
"ATSC A53 Part 4 Closed Captions"
;
case
AV_FRAME_DATA_STEREO3D
:
return
"Stereo 3D"
;
case
AV_FRAME_DATA_MATRIXENCODING
:
return
"AVMatrixEncoding"
;
case
AV_FRAME_DATA_DOWNMIX_INFO
:
return
"Metadata relevant to a downmix procedure"
;
case
AV_FRAME_DATA_REPLAYGAIN
:
return
"AVReplayGain"
;
case
AV_FRAME_DATA_DISPLAYMATRIX
:
return
"3x3 displaymatrix"
;
case
AV_FRAME_DATA_AFD
:
return
"Active format description"
;
case
AV_FRAME_DATA_MOTION_VECTORS
:
return
"Motion vectors"
;
case
AV_FRAME_DATA_SKIP_SAMPLES
:
return
"Skip samples"
;
case
AV_FRAME_DATA_AUDIO_SERVICE_TYPE
:
return
"Audio service type"
;
case
AV_FRAME_DATA_MASTERING_DISPLAY_METADATA
:
return
"Mastering display metadata"
;
case
AV_FRAME_DATA_CONTENT_LIGHT_LEVEL
:
return
"Content light level metadata"
;
case
AV_FRAME_DATA_GOP_TIMECODE
:
return
"GOP timecode"
;
case
AV_FRAME_DATA_S12M_TIMECODE
:
return
"SMPTE 12-1 timecode"
;
case
AV_FRAME_DATA_SPHERICAL
:
return
"Spherical Mapping"
;
case
AV_FRAME_DATA_ICC_PROFILE
:
return
"ICC profile"
;
case
AV_FRAME_DATA_DYNAMIC_HDR_PLUS
:
return
"HDR Dynamic Metadata SMPTE2094-40 (HDR10+)"
;
case
AV_FRAME_DATA_DYNAMIC_HDR_VIVID
:
return
"HDR Dynamic Metadata CUVA 005.1 2021 (Vivid)"
;
case
AV_FRAME_DATA_REGIONS_OF_INTEREST
:
return
"Regions Of Interest"
;
case
AV_FRAME_DATA_VIDEO_ENC_PARAMS
:
return
"Video encoding parameters"
;
case
AV_FRAME_DATA_SEI_UNREGISTERED
:
return
"H.26[45] User Data Unregistered SEI message"
;
case
AV_FRAME_DATA_FILM_GRAIN_PARAMS
:
return
"Film grain parameters"
;
case
AV_FRAME_DATA_DETECTION_BBOXES
:
return
"Bounding boxes for object detection and classification"
;
case
AV_FRAME_DATA_DOVI_RPU_BUFFER
:
return
"Dolby Vision RPU Data"
;
case
AV_FRAME_DATA_DOVI_METADATA
:
return
"Dolby Vision Metadata"
;
case
AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT
:
return
"Ambient viewing environment"
;
}
unsigned
t
=
type
;
if
(
t
<
FF_ARRAY_ELEMS
(
sd_props
)
&&
sd_props
[
t
].
name
)
return
&
sd_props
[
t
];
return
NULL
;
}
const
char
*
av_frame_side_data_name
(
enum
AVFrameSideDataType
type
)
{
const
AVSideDataDescriptor
*
desc
=
av_frame_side_data_desc
(
type
);
return
desc
?
desc
->
name
:
NULL
;
}
static
int
calc_cropping_offsets
(
size_t
offsets
[
4
],
const
AVFrame
*
frame
,
const
AVPixFmtDescriptor
*
desc
)
{
...
...
libavutil/frame.h
View file @
2621be35
...
...
@@ -255,6 +255,37 @@ typedef struct AVFrameSideData {
AVBufferRef
*
buf
;
}
AVFrameSideData
;
enum
AVSideDataProps
{
/**
* The side data type can be used in stream-global structures.
* Side data types without this property are only meaningful on per-frame
* basis.
*/
AV_SIDE_DATA_PROP_GLOBAL
=
(
1
<<
0
),
/**
* Multiple instances of this side data type can be meaningfully present in
* a single side data array.
*/
AV_SIDE_DATA_PROP_MULTI
=
(
1
<<
1
),
};
/**
* This struct describes the properties of a side data type. Its instance
* corresponding to a given type can be obtained from av_frame_side_data_desc().
*/
typedef
struct
AVSideDataDescriptor
{
/**
* Human-readable side data description.
*/
const
char
*
name
;
/**
* Side data property flags, a combination of AVSideDataProps values.
*/
unsigned
props
;
}
AVSideDataDescriptor
;
/**
* Structure describing a single Region Of Interest.
*
...
...
@@ -992,6 +1023,12 @@ int av_frame_apply_cropping(AVFrame *frame, int flags);
*/
const
char
*
av_frame_side_data_name
(
enum
AVFrameSideDataType
type
);
/**
* @return side data descriptor corresponding to a given side data type, NULL
* when not available.
*/
const
AVSideDataDescriptor
*
av_frame_side_data_desc
(
enum
AVFrameSideDataType
type
);
/**
* Free all side data entries and their contents, then zeroes out the
* values which the pointers are pointing to.
...
...
libavutil/version.h
View file @
2621be35
...
...
@@ -79,7 +79,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 59
#define LIBAVUTIL_VERSION_MINOR
9
#define LIBAVUTIL_VERSION_MINOR
10
#define LIBAVUTIL_VERSION_MICRO 100
#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