diff options
author | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2012-04-03 11:32:54 +0200 |
---|---|---|
committer | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2012-12-14 17:45:08 +0100 |
commit | bcc6270bac5b26c1b6f2cfe0de870e3472bc0369 (patch) | |
tree | 0581551e9e237ba55c189c2f77ca87cf8322740a | |
parent | 8865fd148a4444b26c35197b3176f87fb2e85393 (diff) | |
download | libva-bcc6270bac5b26c1b6f2cfe0de870e3472bc0369.tar.gz |
API: vpp: add rotation state.
Add the ability to rotate a source surface clockwise by a fixed number
of degrees (VA_ROTATION_xxx flags). The outcome of this operation is
scaled to fit the specified output_region.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
-rw-r--r-- | va/va.h | 14 | ||||
-rw-r--r-- | va/va_vpp.h | 51 |
2 files changed, 64 insertions, 1 deletions
@@ -2302,11 +2302,23 @@ typedef struct _VARectangle * before calling vaPutSurface() */ -/* attribute value for VADisplayAttribRotation */ +/** + * @name Rotation angles + * + * Those values could be used for VADisplayAttribRotation attribute or + * VAProcPipelineParameterBuffer::rotation_state. The rotation operation + * is clockwise. + */ +/**@{*/ +/** \brief No rotation. */ #define VA_ROTATION_NONE 0x00000000 +/** \brief Rotation by 90° clockwise. */ #define VA_ROTATION_90 0x00000001 +/** \brief Rotation by 180° clockwise. */ #define VA_ROTATION_180 0x00000002 +/** \brief Rotation by 270° clockwise. */ #define VA_ROTATION_270 0x00000003 +/**@}*/ /* attribute value for VADisplayAttribOutOfLoopDeblock */ #define VA_OOL_DEBLOCKING_FALSE 0x00000000 diff --git a/va/va_vpp.h b/va/va_vpp.h index edc108a..fcbb196 100644 --- a/va/va_vpp.h +++ b/va/va_vpp.h @@ -347,6 +347,32 @@ typedef struct _VAProcPipelineCaps { unsigned int pipeline_flags; /** \brief Extra filter flags. See VAProcPipelineParameterBuffer::filter_flags. */ unsigned int filter_flags; + /** + * \brief Rotation flags. + * + * For each rotation angle supported by the underlying hardware, + * the corresponding bit is set in \ref rotation_flags. See + * "Rotation angles" for a description of rotation angles. + * + * A value of 0 means the underlying hardware does not support any + * rotation. Otherwise, a check for a specific rotation angle can be + * performed as follows: + * + * \code + * VAProcPipelineCaps pipeline_caps; + * ... + * vaQueryVideoProcPipelineCaps(va_dpy, vpp_ctx, + * filter_bufs, num_filter_bufs, + * &pipeline_caps + * ); + * ... + * if (pipeline_caps.rotation_flags & (1 << VA_ROTATION_xxx)) { + * // Clockwise rotation by xxx degrees is supported + * ... + * } + * \endcode + */ + unsigned int rotation_flags; /** \brief Number of forward reference frames that are needed. */ unsigned int num_forward_references; /** \brief Number of backward reference frames that are needed. */ @@ -461,6 +487,31 @@ typedef struct _VAProcPipelineParameterBuffer { */ VAProcColorStandardType output_color_standard; /** + * \brief Rotation state. See rotation angles. + * + * The rotation angle is clockwise. There is no specific rotation + * center for this operation. Rather, The source \ref surface is + * first rotated by the specified angle and then scaled to fit the + * \ref output_region. + * + * This means that the top-left hand corner (0,0) of the output + * (rotated) surface is expressed as follows: + * - \ref VA_ROTATION_NONE: (0,0) is the top left corner of the + * source surface -- no rotation is performed ; + * - \ref VA_ROTATION_90: (0,0) is the bottom-left corner of the + * source surface ; + * - \ref VA_ROTATION_180: (0,0) is the bottom-right corner of the + * source surface -- the surface is flipped around the X axis ; + * - \ref VA_ROTATION_270: (0,0) is the top-right corner of the + * source surface. + * + * Check VAProcPipelineCaps::rotation_flags first prior to + * defining a specific rotation angle. Otherwise, the hardware can + * perfectly ignore this variable if it does not support any + * rotation. + */ + unsigned int rotation_state; + /** * \brief Pipeline filters. See video pipeline flags. * * Flags to control the pipeline, like whether to apply subpictures |