diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2014-07-23 09:21:28 +0100 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2014-08-28 12:33:26 -0400 |
commit | 9301486408a480629336af4d7fd873c0f28fb2d5 (patch) | |
tree | 198fb73355d2e3890f8292b4786ef101cdfd0502 /libavcodec | |
parent | f2583bc86eb5d7decc639fc9a36edc93e6003eef (diff) | |
download | ffmpeg-9301486408a480629336af4d7fd873c0f28fb2d5.tar.gz |
avcodec: add stream-level stereo3d side data
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/avcodec.h | 6 | ||||
-rw-r--r-- | libavcodec/utils.c | 9 | ||||
-rw-r--r-- | libavcodec/version.h | 2 |
3 files changed, 16 insertions, 1 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 93aad35d33..14440fe3c1 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -911,6 +911,12 @@ enum AVPacketSideDataType { * See libavutil/display.h for a detailed description of the data. */ AV_PKT_DATA_DISPLAYMATRIX, + + /* + * This side data should be associated with a video stream and contains + * Stereoscopic 3D information in form of the AVStereo3D struct. + */ + AV_PKT_DATA_STEREO3D, }; typedef struct AVPacketSideData { diff --git a/libavcodec/utils.c b/libavcodec/utils.c index afc0396375..c5fa50d06b 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -596,6 +596,15 @@ int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame) memcpy(frame_sd->data, packet_sd, size); } + /* copy the stereo3d format to the output frame */ + packet_sd = av_packet_get_side_data(pkt, AV_PKT_DATA_STEREO3D, &size); + if (packet_sd) { + frame_sd = av_frame_new_side_data(frame, AV_FRAME_DATA_STEREO3D, size); + if (!frame_sd) + return AVERROR(ENOMEM); + + memcpy(frame_sd->data, packet_sd, size); + } return 0; } diff --git a/libavcodec/version.h b/libavcodec/version.h index b42b9704ad..8cc2fb0317 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -29,7 +29,7 @@ #include "libavutil/version.h" #define LIBAVCODEC_VERSION_MAJOR 56 -#define LIBAVCODEC_VERSION_MINOR 0 +#define LIBAVCODEC_VERSION_MINOR 1 #define LIBAVCODEC_VERSION_MICRO 0 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ |