MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / ff_decode_content_light_new_ext

Function ff_decode_content_light_new_ext

libavcodec/decode.c:2239–2269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2237}
2238
2239int ff_decode_content_light_new_ext(const AVCodecContext *avctx,
2240 AVFrameSideData ***sd, int *nb_sd,
2241 AVContentLightMetadata **clm)
2242{
2243 AVBufferRef *buf;
2244 size_t size;
2245
2246 if (side_data_pref(avctx, sd, nb_sd, AV_FRAME_DATA_CONTENT_LIGHT_LEVEL)) {
2247 *clm = NULL;
2248 return 0;
2249 }
2250
2251 *clm = av_content_light_metadata_alloc(&size);
2252 if (!*clm)
2253 return AVERROR(ENOMEM);
2254
2255 buf = av_buffer_create((uint8_t *)*clm, size, NULL, NULL, 0);
2256 if (!buf) {
2257 av_freep(clm);
2258 return AVERROR(ENOMEM);
2259 }
2260
2261 if (!av_frame_side_data_add(sd, nb_sd, AV_FRAME_DATA_CONTENT_LIGHT_LEVEL,
2262 &buf, 0)) {
2263 *clm = NULL;
2264 av_buffer_unref(&buf);
2265 return AVERROR(ENOMEM);
2266 }
2267
2268 return 0;
2269}
2270
2271int ff_decode_content_light_new(const AVCodecContext *avctx, AVFrame *frame,
2272 AVContentLightMetadata **clm)

Callers 1

h2645_sei_to_side_dataFunction · 0.85

Calls 6

side_data_prefFunction · 0.85
av_buffer_createFunction · 0.85
av_freepFunction · 0.85
av_frame_side_data_addFunction · 0.85
av_buffer_unrefFunction · 0.85

Tested by

no test coverage detected