summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-05-19 19:12:30 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-05-19 19:12:30 +0200
commitef1d4ee2f8b621a009d482d5b183a905bcb1cd74 (patch)
tree88d5e961383f04d5c1e521242dc2e0ceb7eedd1b /libavcodec
parentaf72f62d7b2ab00d6f69c0838f662beb566862d8 (diff)
parentbddd8cbf68551f6405b2bf77cc3e212af9fbe834 (diff)
Merge commit 'bddd8cbf68551f6405b2bf77cc3e212af9fbe834'
* commit 'bddd8cbf68551f6405b2bf77cc3e212af9fbe834': Add transformation matrix API. Conflicts: libavcodec/avcodec.h libavcodec/utils.c libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/avcodec.h9
-rw-r--r--libavcodec/utils.c10
2 files changed, 19 insertions, 0 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 45a9a7de20..5bff631a6a 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1053,6 +1053,15 @@ enum AVPacketSideDataType {
AV_PKT_DATA_REPLAYGAIN,
/**
+ * This side data contains a 3x3 transformation matrix describing an affine
+ * transformation that needs to be applied to the decoded video frames for
+ * correct presentation.
+ *
+ * See libavutil/display.h for a detailed description of the data.
+ */
+ AV_PKT_DATA_DISPLAYMATRIX,
+
+ /**
* Recommmends skipping the specified number of samples
* @code
* u32le number of samples to skip from start of this packet
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 8e813d0dbb..be2b40d45c 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -767,6 +767,16 @@ int ff_init_buffer_info(AVCodecContext *avctx, AVFrame *frame)
memcpy(frame_sd->data, packet_sd, size);
}
+
+ /* copy the displaymatrix to the output frame */
+ packet_sd = av_packet_get_side_data(pkt, AV_PKT_DATA_DISPLAYMATRIX, &size);
+ if (packet_sd) {
+ frame_sd = av_frame_new_side_data(frame, AV_FRAME_DATA_DISPLAYMATRIX, size);
+ if (!frame_sd)
+ return AVERROR(ENOMEM);
+
+ memcpy(frame_sd->data, packet_sd, size);
+ }
} else {
frame->pkt_pts = AV_NOPTS_VALUE;
av_frame_set_pkt_pos (frame, -1);