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

Function attach_displaymatrix

libavcodec/decode.c:2376–2395  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2374}
2375
2376static int attach_displaymatrix(AVCodecContext *avctx, AVFrame *frame, int orientation)
2377{
2378 AVFrameSideData *sd = NULL;
2379 int32_t *matrix;
2380 int ret;
2381 /* invalid orientation */
2382 if (orientation < 1 || orientation > 8)
2383 return AVERROR_INVALIDDATA;
2384 ret = ff_frame_new_side_data(avctx, frame, AV_FRAME_DATA_DISPLAYMATRIX, sizeof(int32_t) * 9, &sd);
2385 if (ret < 0) {
2386 av_log(avctx, AV_LOG_ERROR, "Could not allocate frame side data: %s\n", av_err2str(ret));
2387 return ret;
2388 }
2389 if (sd) {
2390 matrix = (int32_t *) sd->data;
2391 ret = av_exif_orientation_to_matrix(matrix, orientation);
2392 }
2393
2394 return ret;
2395}
2396
2397static int exif_attach_ifd(AVCodecContext *avctx, AVFrame *frame, const AVExifMetadata *ifd, AVBufferRef **pbuf)
2398{

Callers 1

exif_attach_ifdFunction · 0.85

Calls 3

ff_frame_new_side_dataFunction · 0.85
av_logFunction · 0.85

Tested by

no test coverage detected