diff options
author | James Almer <jamrial@gmail.com> | 2017-05-08 13:08:02 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2017-05-08 13:08:02 -0300 |
commit | a47bd5d77e3f1dd8bb3d4ba0955bd7b1323c7d83 (patch) | |
tree | c59282acb59cac554c2cad5b5a42ceb8fd2a0007 | |
parent | 8ef2c791c99e7c103782e889e2bca2f6e13a07be (diff) | |
parent | 52627248e49e58eb4b78e4fcda90a64f4c476ea3 (diff) | |
download | ffmpeg-a47bd5d77e3f1dd8bb3d4ba0955bd7b1323c7d83.tar.gz |
Merge commit '52627248e49e58eb4b78e4fcda90a64f4c476ea3'
* commit '52627248e49e58eb4b78e4fcda90a64f4c476ea3':
frame: add a cropping rectangle to AVFrame
Merged-by: James Almer <jamrial@gmail.com>
-rw-r--r-- | doc/APIchanges | 4 | ||||
-rw-r--r-- | libavutil/frame.c | 4 | ||||
-rw-r--r-- | libavutil/frame.h | 28 | ||||
-rw-r--r-- | libavutil/version.h | 3 |
4 files changed, 37 insertions, 2 deletions
diff --git a/doc/APIchanges b/doc/APIchanges index 01c55a1ed0..ae5490b4c2 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -15,6 +15,10 @@ libavutil: 2015-08-28 API changes, most recent first: +2017-xx-xx - xxxxxxx - lavu 55.62.100 / 55.30.0 - frame.h + Add AVFrame.crop_left/right/top/bottom fields for attaching cropping + information to video frames. + 2017-xx-xx - xxxxxxxxxx Change av_sha_update(), av_sha512_update() and av_md5_sum()/av_md5_update() length parameter type to size_t at next major bump. diff --git a/libavutil/frame.c b/libavutil/frame.c index dd12c5549c..24d5d5f184 100644 --- a/libavutil/frame.c +++ b/libavutil/frame.c @@ -297,6 +297,10 @@ static int frame_copy_props(AVFrame *dst, const AVFrame *src, int force_copy) dst->key_frame = src->key_frame; dst->pict_type = src->pict_type; dst->sample_aspect_ratio = src->sample_aspect_ratio; + dst->crop_top = src->crop_top; + dst->crop_bottom = src->crop_bottom; + dst->crop_left = src->crop_left; + dst->crop_right = src->crop_right; dst->pts = src->pts; dst->repeat_pict = src->repeat_pict; dst->interlaced_frame = src->interlaced_frame; diff --git a/libavutil/frame.h b/libavutil/frame.h index 4d8c1bed4f..26261d7e40 100644 --- a/libavutil/frame.h +++ b/libavutil/frame.h @@ -25,6 +25,7 @@ #ifndef AVUTIL_FRAME_H #define AVUTIL_FRAME_H +#include <stddef.h> #include <stdint.h> #include "avutil.h" @@ -240,9 +241,18 @@ typedef struct AVFrame { uint8_t **extended_data; /** - * width and height of the video frame + * @name Video dimensions + * Video frames only. The coded dimensions (in pixels) of the video frame, + * i.e. the size of the rectangle that contains some well-defined values. + * + * @note The part of the frame intended for display/presentation is further + * restricted by the @ref cropping "Cropping rectangle". + * @{ */ int width, height; + /** + * @} + */ /** * number of audio samples (per channel) described by this frame @@ -530,6 +540,22 @@ typedef struct AVFrame { * purpose. */ AVBufferRef *opaque_ref; + + /** + * @anchor cropping + * @name Cropping + * Video frames only. The number of pixels to discard from the the + * top/bottom/left/right border of the frame to obtain the sub-rectangle of + * the frame intended for presentation. + * @{ + */ + size_t crop_top; + size_t crop_bottom; + size_t crop_left; + size_t crop_right; + /** + * @} + */ } AVFrame; /** diff --git a/libavutil/version.h b/libavutil/version.h index e7a657971f..6762bf300a 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -78,8 +78,9 @@ * @{ */ + #define LIBAVUTIL_VERSION_MAJOR 55 -#define LIBAVUTIL_VERSION_MINOR 61 +#define LIBAVUTIL_VERSION_MINOR 62 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ |