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

Function ff_decode_mastering_display_new_ext

libavcodec/decode.c:2194–2224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2192}
2193
2194int ff_decode_mastering_display_new_ext(const AVCodecContext *avctx,
2195 AVFrameSideData ***sd, int *nb_sd,
2196 struct AVMasteringDisplayMetadata **mdm)
2197{
2198 AVBufferRef *buf;
2199 size_t size;
2200
2201 if (side_data_pref(avctx, sd, nb_sd, AV_FRAME_DATA_MASTERING_DISPLAY_METADATA)) {
2202 *mdm = NULL;
2203 return 0;
2204 }
2205
2206 *mdm = av_mastering_display_metadata_alloc_size(&size);
2207 if (!*mdm)
2208 return AVERROR(ENOMEM);
2209
2210 buf = av_buffer_create((uint8_t *)*mdm, size, NULL, NULL, 0);
2211 if (!buf) {
2212 av_freep(mdm);
2213 return AVERROR(ENOMEM);
2214 }
2215
2216 if (!av_frame_side_data_add(sd, nb_sd, AV_FRAME_DATA_MASTERING_DISPLAY_METADATA,
2217 &buf, 0)) {
2218 *mdm = NULL;
2219 av_buffer_unref(&buf);
2220 return AVERROR(ENOMEM);
2221 }
2222
2223 return 0;
2224}
2225
2226int ff_decode_mastering_display_new(const AVCodecContext *avctx, AVFrame *frame,
2227 AVMasteringDisplayMetadata **mdm)

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