On Tue, Dec 27, 2016 at 7:31 PM, Anton Khirnov <an...@khirnov.net> wrote: > Extend the width/height doy to clarify that it should store coded > values.
s/doy/documentation/ ? > --- > doc/APIchanges | 4 ++++ > libavutil/frame.c | 4 ++++ > libavutil/frame.h | 28 +++++++++++++++++++++++++++- > libavutil/version.h | 2 +- > 4 files changed, 36 insertions(+), 2 deletions(-) > > diff --git a/doc/APIchanges b/doc/APIchanges > index 7633c99..10a2da4 100644 > --- a/doc/APIchanges > +++ b/doc/APIchanges > @@ -13,6 +13,10 @@ libavutil: 2015-08-28 > > API changes, most recent first: > > +2016-xx-xx - xxxxxxx - lavu 55.30.0 - frame.h > + Add AVFrame.crop_left/right/top/bottom fields for attaching cropping > + information to video frames. > + > 2016-xx-xx - xxxxxxx - lavc 57.29.0 - avcodec.h > Add AV_PKT_DATA_SPHERICAL packet side data to export AVSphericalMapping > information from containers. > diff --git a/libavutil/frame.c b/libavutil/frame.c > index 1c14f5f..aafaa57 100644 > --- a/libavutil/frame.c > +++ b/libavutil/frame.c > @@ -390,6 +390,10 @@ int av_frame_copy_props(AVFrame *dst, const AVFrame *src) > 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 4052199..c718f7b 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" > @@ -180,9 +181,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". Can you add a note mentioning the semantics of these fields are different than the ones in avctx? > + * @{ > */ > int width, height; > + /** > + * @} > + */ > > /** > * number of audio samples (per channel) described by this frame > @@ -369,6 +379,22 @@ typedef struct AVFrame { > * AVHWFramesContext describing the frame. > */ > AVBufferRef *hw_frames_ctx; > + > + /** > + * @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; I think it makes sense to use size_t here, even though it creates a precedent WRT older API. I would agree to a small overhaul to update the type elsewhere. > + /** > + * @} > + */ > } AVFrame; > > /** > diff --git a/libavutil/version.h b/libavutil/version.h > index f110231..e9940f2 100644 > --- a/libavutil/version.h > +++ b/libavutil/version.h > @@ -54,7 +54,7 @@ > */ > > #define LIBAVUTIL_VERSION_MAJOR 55 > -#define LIBAVUTIL_VERSION_MINOR 29 > +#define LIBAVUTIL_VERSION_MINOR 30 > #define LIBAVUTIL_VERSION_MICRO 0 > > #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ > -- ok I guess -- Vittorio _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel