| 2237 | } |
| 2238 | |
| 2239 | int 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 | |
| 2271 | int ff_decode_content_light_new(const AVCodecContext *avctx, AVFrame *frame, |
| 2272 | AVContentLightMetadata **clm) |
no test coverage detected