/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved. * * NVIDIA Corporation and its licensors retain all intellectual property * and proprietary rights in and to this software, related documentation * and any modifications thereto. Any use, reproduction, disclosure or * distribution of this software and related documentation without an * express license agreement from NVIDIA Corporation is strictly prohibited. */ /** @file GFVx.h GFSDK Video API header file. */ #ifndef __GFVX_H__ #define __GFVX_H__ #include "GFRm.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #include "GFVxScr.h" /** @addtogroup groupVx VxAPI Video API
| Minimum stride | 0 bytes |
| Minimum width | 1 |
| Minimum height | 1 |
| Maximum stride | 4095 bytes |
| Maximum width | 4064 (YUV)
(YUV data restricted by JPEG encoder), 32767 (RGB) (RGB data restricted by stride) |
| Maximum height | 32766, or unlimited if \a pDestRect is specified |
| Minimum stride | 0 bytes |
| Minimum width | 1 |
| Minimum height | 1 |
| Maximum stride | 4095 bytes |
| Maximum width | 16383 (SC15), 2032 (SC12), 496 (SC5, RGB or YUV422), 512 (SC5), 496 (SC10, SC4), 312 (SC3 and below), or unlimited if \a pSrcRect is specified |
| Maximum height | 32766, or unlimited if \a pDestRect is specified |
| Minimum width | 1 |
| Minimum height | 1 |
| Maximum width | 4064 (YUV), 32767 (RGB) |
| Maximum height | 32766 |
| Minimum width | 1 |
| Minimum height | 1 |
| Maximum width | 16383 (SC15), 2032 (SC12), 496 (SC5, RGB or YUV422), 512 (SC5), 496 (SC10, SC4), 312 (SC3 and below) |
| Maximum height | 32766 |
| #GFVX_BLT_DISABLE_WAIT_VSYNC | Disable VSync |
| #GFVX_BLT_SRC_KEY | Source color key |
| #GFVX_AUTO_BLT | Auto-blit at end of VIP frame |
| #GFVX_AUTO_DISPLAY | Auto-show destination surface |
| #GFVX_AUTO_DISPLAY_OVERLAY2 | Auto-show destination surface from overlay window 2 |
| #GFVX_BLT_PARTIAL | Configure partial blit parameters |
| #GFVX_BLT_PARTIAL_TRIGGER | Trigger partial blit at end of circular buffer |
| #GFVX_BLT_ENABLE_WAIT_CAMERA_VSYNC | Enable wait for camera VSYNC |
| 0 | Default. Flip uses first overlay window |
| GFVX_FLIP_SECOND_OVERLAY | Flip uses second overlay window |
| #GFVX_UO_ROTATE_0 | Overlay without rotation |
| #GFVX_UO_ROTATE_180 | Overlay with 180 degree rotation |
| #GFVX_UO_H_FLIP | Overlay with horizontal flip |
| #GFVX_UO_V_FLIP | Overlay with vertical flip |
| #GFVX_UO_SRC_COLOR_KEY | Source color keying |
| #GFVX_UO_DEST_COLOR_KEY | Destination color keying |
| #GFVX_UO_ALPHA_BLENDING | Alpha blending |
| #GFVX_UO_COLOR_KEY_ALPHA_ONLY | Overlay based on destination alpha |
| #GFVX_UO_COLOR_KEY_ALPHA_COLOR | Overlay based on destination alpha and color |
| #GFVX_UO_BLD_COLOR_KEY_ALPHA_ONLY | Alpha Blending based on destination alpha |
| #GFVX_UO_BLD_COLOR_KEY_ALPHA_COLOR | Alpha Blending based on destination alpha and color |
| #GFVX_UO_OVERLAY2 | Enable second overlay window |
| #GFVX_UO_ACTIVETOP | Show this overlay window on top |
| #GFVX_UO_DIGITAL_VIBRANCE | Enable digital vibrance for first overlay window |
| #GFVX_UO_ROTATE_0 | Overlay without rotation |
| #GFVX_UO_ROTATE_180 | Overlay with 180 degree rotation |
| #GFVX_UO_H_FLIP | Overlay with horizontal flip |
| #GFVX_UO_V_FLIP | Overlay with vertical flip |
| #GFVX_UO_SRC_COLOR_KEY | Source color keying |
| #GFVX_UO_DEST_COLOR_KEY | Destination color keying |
| #GFVX_UO_ALPHA_BLENDING | Alpha blending |
| #GFVX_UO_COLOR_KEY_ALPHA_ONLY | Overlay based on destination alpha |
| #GFVX_UO_COLOR_KEY_ALPHA_COLOR | Overlay based on destination alpha and color |
| #GFVX_UO_BLD_COLOR_KEY_ALPHA_ONLY | Alpha Blending based on destination alpha |
| #GFVX_UO_BLD_COLOR_KEY_ALPHA_COLOR | Alpha Blending based on destination alpha and color |
| #GFVX_UO_ACTIVETOP | Show this overlay window on top |
| #GFVX_UO_DIGITAL_VIBRANCE | Enable digital vibrance for second overlay window |
| #GFVX_VIP_CAP_SHRINK | VIP supports image shrinking |
| #GFVX_VIP_CAP_ENLARGE | VIP supports image enlarging |
| #GFVX_VIP_CAP_PARALLEL | Parallel video input supported |
| #GFVX_VIP_CAP_SERIAL | Serial video input supported |
| #GFVX_VIP_CAP_RGB_VH_FLIP | Vertical and horizontal flip supported for VIP output RGB image |
| #GFVX_VIP_CAP_OUTPUT_VCLOCK_VHSYNC | VIP can supply VClock and VHSync signals to the camera chip |
| #GFVX_VIP_CAP_OUTPUT_MASTER_CLOCK | VIP can supply a master clock to the camera chip |
| #GFVX_VIP_CAP_TYPE_A | VIP can accept a JPEG bitstream from a camera with type A interface |
| #GFVX_VIP_CAP_TYPE_B | VIP can accept a JPEG bitstream from a camera with type B interface |
| #GFVX_VIP_CAP_TYPE_C | VIP can accept a JPEG bitstream from a camera with type C interface |
| #GFVX_VIP_CAP_BAYER | VIP can accept Bayer format input |
| #GFVX_VIP_CAP_RGB565 | VIP can accept RGB565 format input |
| #GFVX_VIP_CAP_RGB888 | VIP can accept RGB888 format input |
| #GFVX_VIP_CAP_RGB444 | VIP can accept RGB444 format input |
| #GFVX_VIP_CAP_YUV420NP | VIP can accept YUV420NP format input |
| #GFVX_VIP_CAP_TYPE_C_RAW | VIP can accept JPEG image from Camera through type C_RAW interface |
| #GF_SURFACE_YUYV | YUV422 in YUYV order |
| #GF_SURFACE_YVYU | YUV422 in YVYU order |
| #GF_SURFACE_UYVY | YUV422 in UYVY order |
| #GF_SURFACE_VYUY | YUV422 in VYUY order |
| #GF_SURFACE_RGB565 | RGB565, 16 bpp |
| #GF_SURFACE_RGB888 | RGB888, 24 bpp |
| #GF_SURFACE_ARGB8888 | ARGB8888, 32 bpp |
if ((DestFormat & GF_SURFACE_RGB565) == GF_SURFACE_RGB565)
{
// RGB565 is supported
}
*/
NvU32 HMaxNumerator; /**< Maximum horizontal numerator for VI
decimation. VI decimation is configured via
GFVxVIPSetVIP(), GFVXVIPINFO::HNumerator's
valid value range is 1 to \a HMaxNumerator.
*/
NvU32 HMaxDenominator; /**< Maximum horizontal denominator for VI
decimation. VI decimation is configured via
GFVxVIPSetVIP(), GFVXVIPINFO::HDenominator's
valid value range is 1 to \a HMaxDenominator.
*/
NvU32 VMaxNumerator; /**< Maximum vertical numerator for VI decimation.
VI decimation is configured via
GFVxVIPSetVIP(), GFVXVIPINFO::VNumerator's
valid value range is 1 to \a VMaxNumerator.
*/
NvU32 VMaxDenominator; /**< Maximum vertical denominator for VI decimation.
VI decimation is configured via
GFVxVIPSetVIP(), GFVXVIPINFO::VDenominator's
valid value range is 1 to \a VMaxDenominator.
*/
} GFVXVIPPROPERTY, *PGFVXVIPPROPERTY;
/** Structure used to describe the input frame size if input data format is Bayer.
This structure is not used when input source is VIP.
@see
*/
typedef struct _GFVXBAYERINPUTFRAME
{
NvU16 Width; /**< Host Input source width. */
NvU16 Height; /**< Host Input source height. */
} GFVXBAYERINPUTFRAME, *PGFVXBAYERINPUTFRAME;
/** Structure used to describe ISP scan size if input data format is Bayer.
Scan size is camera specific.
The application should populate this structure with
values filled by GFCameraSetup() in GFCAMERATABLETYPE::GFCAMERARESOLUTIONTYPE::pBayerInfo.
The application should also configure ISP with values in
GFCAMERATABLETYPE::GFCAMERARESOLUTIONTYPE::pBayerInfo::ScanWidth and
GFCAMERATABLETYPE::GFCAMERARESOLUTIONTYPE::pBayerInfo::ScanHeight.
This structure is used only when input source is VIP and input data format is Bayer.
@see GFISPIMGTIMING
*/
typedef struct _GFVXBAYERSCANSIZE
{
NvU16 HScan; /**< VIP input signal horizontal scan size. */
NvU16 VScan; /**< VIP input signal vertical scan size. */
} GFVXBAYERSCANSIZE, *PGFVXBAYERSCANSIZE;
/** Structure used to describe ISP Active Area if input data format is Bayer.
Active Area is camera specific.
The application should populate this structure with
values filled by GFCameraSetup() in GFCAMERATABLETYPE::GFCAMERARESOLUTIONTYPE::pBayerInfo.
The application should also configure ISP with values in
GFCAMERATABLETYPE::GFCAMERARESOLUTIONTYPE::pBayerInfo::ActiveFrameStart,
GFCAMERATABLETYPE::GFCAMERARESOLUTIONTYPE::pBayerInfo::ActiveLineStart,
GFCAMERATABLETYPE::GFCAMERARESOLUTIONTYPE::pBayerInfo::ActiveFrameHeight and
GFCAMERATABLETYPE::GFCAMERARESOLUTIONTYPE::pBayerInfo::ActiveLineWidth.
Active Area rectangle should fall inside the Scan Size.
This structure is used only when input source is VIP and input data format is Bayer.
@see GFISPIMGTIMING
*/
typedef struct _GFVXBAYERACTIVEAREA
{
NvU16 LineStart; /**< VIP input signal horizontal active offset. */
NvU16 FrameStart; /**< VIP input signal vertical active offset. */
NvU16 LineWidth; /**< VIP input signal horizontal active width. */
NvU16 FrameHeight; /**< VIP input signal vertical active height. */
} GFVXBAYERACTIVEAREA, *PGFVXBAYERACTIVEAREA;
/** Structure used to describe ISP Output Area if input data format is Bayer.
This structure is not used by VI. It is used to configure ISP.
Output Area rectangle can be equal to or less than Active Area rectangle.
This structure is used only when input source is VIP and input data format is Bayer.
@see GFISPIMGTIMING
*/
typedef struct _GFVXBAYEROUTPUTAREA
{
NvU16 LineStart; /**< VIP input signal horizontal output offset. */
NvU16 FrameStart; /**< VIP input signal vertical output offset. */
NvU16 LineWidth; /**< VIP input signal horizontal output width. */
NvU16 FrameHeight; /**< VIP input signal vertical output height. */
} GFVXBAYEROUTPUTAREA, *PGFVXBAYEROUTPUTAREA;
/** Structure used to describe the rectangles needed by ISP to properly process Bayer input from camera.
This structure is used only when input source is VIP and input data format is Bayer.
@see GFVXBAYERINPUTFRAME, GFVXBAYERSCANSIZE, GFVXBAYERACTIVEAREA, GFVXBAYEROUTPUTAREA
*/
typedef struct _GFVXBAYERINFO
{
PGFVXBAYERINPUTFRAME pInputFrameSize; /**< For VIP input, this field is not used.
*/
PGFVXBAYERSCANSIZE pScanSize; /**< ISP Scan Size.
Scan size is camera specific. This field is set
by GFCameraAPI in GFCAMERARESOLUTIONTYPE::pBayerInfo.
*/
PGFVXBAYERACTIVEAREA pActiveArea; /**< ISP Active Area.
Active Area is camera specific. This field is set
by GFCameraAPI in
GFCAMERATABLETYPE::GFCAMERARESOLUTIONTYPE::pBayerInfo.
Active Area rectangle should fall inside the Scan Size.
*/
PGFVXBAYEROUTPUTAREA pOutputArea; /**< ISP Output Area. This field is not used by VI.
Output Area rectangle can be equal to or less than
Active Area rectangle.
*/
NvU8 DemosaicKernelSize; /**< For VIP input, this field is not used.
*/
NvU16 IspDownscaleUsed; /**< Use Isp downscale (Only for sc17 and above)
*/
} GFVXBAYERINFO, *PGFVXBAYERINFO;
///////////Cindy: Following is CSI defination.
/* flags optoins */
/** Pixel Parser stream is from CSI A
*/
#define GFVX_CSI_SOURCE_CSI_A 0x00000001
/** Pixel Parser stream is from CSI B
*/
#define GFVX_CSI_SOURCE_CSI_B 0x00000002
/** Pixel Parser stream is from HOST
*/
#define GFVX_CSI_SOURCE_HOST 0x00000004
/** Pixel Parser stream is from VIP
*/
#define GFVX_CSI_SOURCE_VIP 0x00000008
/** Pixel Parser A enable
*/
#define GFVX_CSI_PPA_ENABLE 0x00000010
/** Pixel Parser B enable
*/
#define GFVX_CSI_PPA_DISABLE 0x00000020
//#define GFVX_CSI_PPA_MASK 0x00000030
/** Pixel Parser A enable
*/
#define GFVX_CSI_PPB_ENABLE 0x00000040
/** Pixel Parser B enable
*/
#define GFVX_CSI_PPB_DISABLE 0x00000080
//#define GFVX_CSI_PPB_MASK 0x000000C0
/** whether packet header is sent in the beginning of packet or not. payload only mode: no header
*/
#define GFVX_CSI_PACKET_HEADER_ENABLE 0x00000100
/** Check data_type and Virtural_Channel_ID or not
*/
#define GFVX_CSI_DATA_IDENTIFIER_ENABLE 0x00000200
/** check WordCount from header or register
*/
#define GFVX_CSI_WORD_COUNT_SELECT_HEADER 0x00000400
/** check ECC from header
*/
#define GFVX_CSI_HEADER_EC_DISABLE 0x00000800
/** pad short line with 0
*/
#define GFVX_CSI_LINE_PAD_NONE 0x00001000
/** pad short line with 1
*/
#define GFVX_CSI_LINE_PAD_1 0x00002000
/** pad short frame with 0
*/
#define GFVX_CSI_FRAME_PAD_NONE 0x00004000
/** pad short frame with 1
*/
#define GFVX_CSI_FRAME_PAD_1 0x00008000
/** 2 bytes CRC Check enable
*/
#define GFVX_CSI_CRC_CHECK 0x00010000
/** Embedded data enable
*/
#define GFVX_CSI_EMBEDDED_DATA_ENABLE 0x00020000
/** enable timeout checking
*/
#define GFVX_CSI_LINE_TIMEOUT_ENABLE 0x00040000
#define GFVX_CSI_VSYNC_START_MARK_VSYNC 0x00080000
#define GFVX_CSI_VI_HSYNC_CONTROL 0x00100000
#define GFVX_CSI_VI_VSYNC_CONTROL 0x00200000
typedef struct _GFVXCSISET
{
NvU32 flags; /** flag options see above */
NvU32 HOffset; /**< VIP input signal horizontal offset. */
NvU32 HActive; /**< VIP input signal horizontal active width. */
NvU32 VOffset; /**< VIP input signal vertical offset. */
NvU32 VActive; /**< VIP input signal vertical active height.*/
NvU32 ColorFormat; /** | #GFVX_VIP_PARALLEL_INPUT | 8-bit/clock video data |
| #GFVX_VIP_SERIAL_INPUT | Serial input |
| #GFVX_VIP_HVSYNC_IN_STREAM | VHSYNC and VVSYNC in the data stream |
| #GFVX_VIP_EXTERNAL_VHSYNC | Camera VHSYNC asserted by external signal |
| #GFVX_VIP_INTERNAL_VHSYNC | Camera VHSYNC generated by GoForce chip |
| #GFVX_VIP_EXTERNAL_VCLK | VCLK generated externally |
| #GFVX_VIP_INTERNAL_VCLK | VCLK generated by GoForce chip |
| #GFVX_VIP_DETECT_FIELD | Detect field 0 or 1, will not work for internal VHSYNC (#GFVX_VIP_INTERNAL_VHSYNC) |
| #GFVX_VIP_RGB_H_FLIP | Horizontal flip |
| #GFVX_VIP_RGB_V_FLIP | Vertical flip |
| #GFVX_VIP_HOST_IMAGE | CPU feeds image to VIP |
| #GFVX_VIP_CHANGE_DEFAULT_TIMING | Change the default timing for VHSYNC and VCLK |
| #GFVX_VIP_ASK_FOR_MCLOCK | Camera master clock provided by GoForce chip |
| #GFVX_VIP_TYPE_A | VIP input type A interface |
| #GFVX_VIP_TYPE_B | VIP input type B interface |
| #GFVX_VIP_TYPE_C | VIP input type C interface |
| #GFVX_VIP_DEST_BYTE_SWAP | Enable destination byte swap for YUV/RGB data written to preview surface |
| #GFVX_VIP_TYPE_C_RAW | Do not remove the 0xFF, 0x02 sequence when camera is running at type C interface |
| #GFVX_VIP_VIP_ROTATE_0 | VI output without rotation |
| #GFVX_VIP_VIP_ROTATE_90 | VI output with 90 degree rotation |
| #GFVX_VIP_VIP_ROTATE_180 | VI output with 180 degree rotation |
| #GFVX_VIP_VIP_ROTATE_270 | VI output with 270 degree rotation |
| #GFVX_VIP_RGB565 | RGB565 input to EPP |
| #GFVX_VIP_RGB888 | RGB888 input to EPP |
| #GFVX_VIP_RGB444 | RGB444 input to EPP |
| #GFVX_VIP_BYPASS_MCLOCK_PIN | Bypass any manipulation on internal master clock generation output pin |
| #GFVX_VIP_BYPASS_NON_MCLOCK_PINS | Bypass any manipulation on VCLK, VHSYNC, and VID[7:0] pins |
| #GFVX_VIP_PRE_GENERATE_MCLOCK | Pre-generation of master clock |
| #GFVX_VIP_PDL_FALLING_VCLK | Parallel data latched at falling edge of VCLK (default is rising edge) |
| #GFVX_VIP_SDL_RISING_VCLK | Serial data lacthed at rising edge of VCLK (default is falling edge) |
| #GFVX_VIP_VHSYNC_ACTIVE_LOW | VHSYNC active low (default is active high) |
| #GFVX_VIP_VVSYNC_ACTIVE_LOW | VVSYNC active low (default is active high) |
| #GFVX_VIP_VHSYNC_ACTIVE_EDGE_LEAD | VHSYNC active leading edge (default is trailing edge) |
| #GFVX_VIP_VVSYNC_ACTIVE_EDGE_LEAD | VVSYNC active leading edge (default is trailing edge) |
| #GFVX_VIP_SFRAME_ACTIVE_LOW | Serial video frame sync active low, falling edge indicates start of data frame (default is active high, rising edge indicates start of data frame) |
| #GFVX_VIP_SFRAME_SIZE_16 | Serial video input is 16 bit per frame (default is 8 bit per frame) |
| #GFVX_VIP_FILED_0_BOTTOM | Field 0 is bottom/even field (default is top/odd field) |
| #GFVX_VIP_VCLK_OUTPUT_ACTIVE_LOW | VCLK output from GoForce chip active low (default is active high) |
| #GFVX_VIP_START | Start VIP data feeding | |
| #GFVX_VIP_STOP | Stop VIP data feeding | |
| #GFVX_VIP_AUTO_FLIP | Start VIP data feeding and enable auto-display of the last VIP target surface | |
| #GFVX_VIP_AUTO_TRIGER_BLT | Start VIP data feeding and enable auto-blit from the last target surface to additional surfaces | |
| #GFVX_VIP_AUTO_TRIGER_BLT_OFF | Disable auto-blit |
NvU32 Bitmask with interrupt status
For bitpositions see the VI status register in the GoForce
technical manual (Register VI11 on SC12)
Attribute is get only.
@see GFVxGetAttribute()
*/
GFVX_ATTR_VIDEO_BUF,
/** VxAPI attribute: Video VIP input status.
Use this attribute with GFVxGetAttribute() to read the current number
of frames received
*/
GFVX_ATTR_VIP_INPUT_FRAME_COUNT,
/** VxAPI attribute: Video VIP input status.
Use this attribute with GFVxGetAttribute() to read the current number
of lines received
*/
GFVX_ATTR_VIP_INPUT_LINE_COUNT,
} GFVXATTRIBUTES;
/** YUV Color Space Conversion (CSC) coefficients.
Parameter structure for GFVxVIPSetCSCCoeff(), GFVxBltSetCSCCoeff(),
GFVxVIPGetCSCCoeff(), and GFVxBltGetCSCCoeff()
YUV color space conversion is used when converting from a YUV formatted
surface to RGB formatted surface. The YUV color space conversion formular
appears as follows:
R = sat(KYRGB*(Y + YOF) + KUR*U + KVR*V)
G = sat(KYRGB*(Y + YOF) + KUG*U + KVG*V)
B = sat(KYRGB*(Y + YOF) + KUB*U + KVB*V)
By default, the YUV color space conversion coefficients are:
KYRGB, KUR, KVR 1.1644 0.0000 1.5960
KYRGB, KUG, KVG = 1.1644 -0.3918 -0.8130
KYRGB, KUB, KVB 1.1644 2.0172 0.0000
and YOF = -16.0000
The value corresponding to each of these YUV color space conversion
coefficients is a Q16 (signed 15.16 fixed point value).
For examples:
YOF = -16.0000, the value corresponding is 0xFFF00000
KYRGB = 1.1644, the value corresponding is 0x00012A16
KVR = 1.5960, the value corresponding is 0x00019893
KUG = -0.3918, the value corresponding is 0xFFFF9BB3
KVG = -0.8130, the value corresponding is 0xFFFF2FE0
KUB = 2.0172, the value corresponding is 0x00020467
*/
typedef struct _GFVXCSCCOEF
{
NvU32 YOF;
NvU32 KYRGB;
NvU32 KUR;
NvU32 KVR;
NvU32 KUG;
NvU32 KVG;
NvU32 KUB;
NvU32 KVB;
} GFVXCSCCOEF;
// Typesafe functions for opening and closing this component
GF_RETTYPE GFVxOpen(GFRmHandle hRm, GFVxHandle *phVx,
GF_STATE_TYPE state, GFRmChHandle hCh);
void GFVxClose(GFVxHandle *phVx);
/** @name Functions
@{*/
/** This function returns version and capabilities of API and hardware.
@param VxHandle (#GFVxHandle) Handle to VxAPI
@param pVXProp (#PGFPROPERTY) Pointer to property structure to be
filled in
@retval #GF_SUCCESS \a pJXProp filled in successfully
@retval #GF_ERROR Some error occured
This function returns information about the VxAPI, including the following:
- VxAPI module version
- VIP support
- Overlay support
- MPEG decoding and encoding
- JPEG decoding and encoding
The #GFPROPERTY structure passed with parameter \a pVXProp will be
filled in on successfull return. The #GFPROPERTY::Capability field
will hold a combination of flagbits indicating capabilities specific
to the VxAPI:
| #GFVX_CAP_CSC | Color space conversion supported |
| #GFVX_CAP_VIP | VIP functions available |
| #GFVX_CAP_ENLARGE | Enlarge source image supported |
| #GFVX_CAP_SHRINK | Shrink source image supported |
| #GFVX_CAP_COLOR_CONTROL | Color control supported |
| #GFVX_CAP_OVERLAY | Overlay supported |
| #GFVX_CAP_MPEGDEC | MPEG4 decoder supported |
| #GFVX_CAP_MPEGENC | MPEG4 encoder supported |
| #GFVX_CAP_JPEGDEC | JPEG decoder supported |
| #GFVX_CAP_JPEGENC | JPEG encoder supported |
| #GFVX_CAP_ALPHA_BLEND | Alpha blending supported |
| #GFVX_CAP_EXTEND_RGB | Extended RGB format 32 bpp supported |
| #GFVX_CAP_OVERLAY_YUV | YUV overlay supported |
| #GFVX_CAP_OVERLAY_SCALE | Overlay with scaling supported |
| #GFVX_CAP_OVERLAY_MULTIPLE | Multiple overlay supported |
| #GFVX_CAP_ENCODE_TYPE | Variable sized data camera interface (Type A/B/C) supported |
src * AlphaValue + dest * (1-AlphaValue)
Otherwise, the original pixel is not updated.
Alpha blending is supported only on GoForce 4800 and above.
SC15 supports alphablending with the following restriction - You cannot alpha-match
(alpha-blend) in non-key-match areas, at the same time you alpha-blend in key-match areas.
In other words, the following flag combinations will not work -
#GFVX_UO_DEST_COLOR_KEY|#GFVX_UO_ALPHA_BLENDING|#GFVX_UO_BLD_COLOR_KEY_ALPHA_ONLY
#GFVX_UO_DEST_COLOR_KEY|#GFVX_UO_COLOR_KEY_ALPHA_COLOR|#GFVX_UO_ALPHA_BLENDING|#GFVX_UO_BLD_COLOR_KEY_ALPHA_ONLY
#GFVX_UO_DEST_COLOR_KEY|#GFVX_UO_COLOR_KEY_ALPHA_ONLY|#GFVX_UO_ALPHA_BLENDING
#GFVX_UO_DEST_COLOR_KEY|#GFVX_UO_COLOR_KEY_ALPHA_ONLY|#GFVX_UO_ALPHA_BLENDING|#GFVX_UO_BLD_COLOR_KEY_ALPHA_COLOR
@see GFVXUPDATEOVERLAY
*/
GF_RETTYPE GFVxUpdateOverlay(GFVxHandle VxHandle,
PGFVXUPDATEOVERLAY pOverlay);
/** Feed image data from host to VIP.
@param VxHandle (#GFVxHandle) Handle to VxAPI
@param pImage (#PGFVXVIPFEEDIMAGE) Pointer to #GFVXVIPFEEDIMAGE parameter
structure
@retval #GF_SUCCESS Success
@retval GFVX_ERROR_COLORFORMAT_NOT_SUPPORTED If Source ColorFormat is unsupported
This function feeds an image from the CPU host via the VI source FIFO to
the VIP. It supports YUV420, YUV422 (YUYV, YVYU, UYVY, VYUY), YUV422 planar and
Bayer (8, 12) formats.
For an YUV420 image, it feeds Y-Fifo, U-Fifo, V-Fifo interleaved at 32 bit.
For an YUV422 image, it feeds the Y-Fifo only.
This function is intended to be used for feeding YUV data to the JPEG
encoder, or for feeding input for VIP preview display (GFVxVIPSetVIP()
and GFVxVIPUpdate()). YUV data for MPEG encoding is fed with
GFMxEncFeedImage().
Parameter \a pImage passes a surface containing source image data and an
optional source clipping rectangle. Surface data has to reside in memory
accessible by the host CPU, e.g. a surface allocated as type
#GF_SURFACE_SYSTEM_MEMORY.
@see GFVXVIPFEEDIMAGE, GFVX_VIP_HOST_IMAGE
*/
GF_RETTYPE GFVxVIPFeedImage(GFVxHandle VxHandle,
PGFVXVIPFEEDIMAGE pImage);
/** Setup partial feed image data from host to VIP.
@param VxHandle (#GFVxHandle) Handle to VxAPI
@param colorFormat Color format of feed image surface
@param width Width of feed image
@param height Height of feed image
@retval #GF_SUCCESS Success
@retval GFVX_ERROR_ILLEGAL_PARAMETER If width and height values are incorrect
@retval GFVX_ERROR_COLORFORMAT_NOT_SUPPORTED If color format of feed image surface is unsupported
This function setups partial feed image from the CPU host via the VI source FIFO to
the VIP. It supports YUV420, YUV422 (YUYV, YVYU, UYVY, VYUY), YUV422 planar formats.
The partial image data is fed with
GFVxVIPPartialFeedImage().
@see GFVxVIPPartialFeedImage, GFVX_VIP_HOST_IMAGE
*/
GF_RETTYPE GFVxVIPPartialFeedImageSetup(GFVxHandle VxHandle,
NvU32 colorFormat,
NvU32 width,
NvU32 height);
/** Feed partial image data from host to VIP.
@param VxHandle (#GFVxHandle) Handle to VxAPI
@param pSrcSurf Pointer to source feed image surface
@param pSrcRect Pointer to a clip rectangle from source feed image surface
@retval #GF_SUCCESS Success
@retval GFVX_ERROR_ILLEGAL_PARAMETER If pSrcSurf is NULL
This function feeds a partial image from the CPU host via the VI source FIFO to
the VIP. It supports YUV420, YUV422 (YUYV, YVYU, UYVY, VYUY), YUV422 planar formats.
For an YUV420 image, it feeds Y-Fifo, U-Fifo, V-Fifo interleaved at 32 bit.
For an YUV422 image, it feeds the Y-Fifo only.
This function is intended to be used for feeding partial YUV data to the JPEG
encoder, or for feeding partial input for VIP preview display (GFVxVIPSetVIP()
and GFVxVIPUpdate()). YUV data for MPEG encoding is fed with
GFMxEncFeedImage().
Parameter \a pSrcRect is an optional source clipping rectangle.
Surface data has to reside in memory accessible by the host CPU,
e.g. a surface allocated as type
#GF_SURFACE_SYSTEM_MEMORY.
*/
GF_RETTYPE GFVxVIPPartialFeedImage(GFVxHandle VxHandle,
PGFRMSURFACE pSrcSurf,
PGFRECT pSrcRect);
/** Put video unit into sleep mode.
@param VxHandle (#GFVxHandle) Handle to VxAPI
@retval #GF_SUCCESS Success
@retval #GF_ERROR Some error occured
@note Not implemented by default, this function is intended to be
implemented only in GFSDK ports to platforms that are in need of
this feature.
@see GFVxWakeup()
*/
GF_RETTYPE GFVxSleep(GFVxHandle VxHandle);
/** Wake up video unit from sleep mode.
@param VxHandle (#GFVxHandle) Handle to VxAPI
@retval #GF_SUCCESS Success
@retval #GF_ERROR Some error occured
@note Not implemented by default, this function is intended to be
implemented only in GFSDK ports to platforms that are in need of
this feature.
@see GFVxSleep()
*/
GF_RETTYPE GFVxWakeup(GFVxHandle VxHandle);
/** This function enumerates capabilities of the Video Input Port (VIP).
@param VxHandle (#GFVxHandle) Handle to VxAPI
@param pVIPProp (#PGFVXVIPPROPERTY) Pointer to #GFVXVIPPROPERTY structure
to be filled in
@retval #GF_SUCCESS \a pVIPProp filled in successfully
@retval #GF_ERROR Some error occured
The #GFPROPERTY structure passed with parameter \a pVIPProp will be
filled in on successfull return.
The following GoForce VIP features are described by this function:
- Image decimation (scaling) limits
- Image flipping
- Video input interface type
Parameters that are passed with a #GFVXVIPINFO structure to GFVxVIPSetVIP()
must be within the limits returned by this function.
@see GFVXVIPPROPERTY, GFVxVIPSetVIP(), GFVXVIPINFO
*/
GF_RETTYPE GFVxVIPGetProperty(GFVxHandle VxHandle,
PGFVXVIPPROPERTY pVIPProp);
/** Configure video input to VIP.
@param VxHandle (#GFVxHandle) Handle to VxAPI
@param pVIPInfo (#PGFVXVIPINFO) Pointer to GFVXVIPINFO parameter structure
@retval #GF_SUCCESS Success
@retval GFVX_ERROR_ILLEGAL_BAYER_VALUES If values in BayerInfo structure are incorrect
@retval GFVX_ERROR_COLORFORMAT_NOT_SUPPORTED If Source ColorFormat is unsupported
The following VIP properties can be configured using this function, see
#GFVXVIPINFO for details:
- Data source and format (CPU host or video input)
- VIP input cropping rectangle
- Image decimation
- Input (camera) color format
After configuring video input, the flow of data has to be explicitly
enabled with GFVxVIPUpdate().
See GFVxVIPGetProperty() for how to test for VIP capabilities at runtime.
This function returns GFVX_ERROR_COLORFORMAT_NOT_SUPPORTED error if color format
is not supported. Supported color formats for HOST input are - YUV422, YUV422 Planar,
YUV420 and Bayer (8 and 12). YUV420 is not supported if input source is VIP.
@see GFVXVIPINFO, GFVxVIPUpdate(), GFVxVIPGetProperty()
*/
GF_RETTYPE GFVxVIPSetVIP(GFVxHandle VxHandle,
PGFVXVIPINFO pVIPInfo);
/** Enable or disable video feeding through VIP.
@param VxHandle (#GFVxHandle) Handle to VxAPI
@param pUpdate (#GFVXVIPUPDATE) Pointer to a #GFVXVIPUPDATE structure
@retval #GF_SUCCESS Success
@retval GFVX_ERROR_COLORFORMAT_NOT_SUPPORTED If Source ColorFormat is unsupported
This function enables or disables data feeding through VIP after it has
been configured with GFVxVIPSetVIP().
The action to be performed by this function is defined by the action
identifier passed in GFVXVIPUPDATE::UpdateOption of parameter \a pUpdate.
| #GFVX_VIP_START | Enable VIP data feeding The structure passed via \a pUpdate controls the output of the VIP, setting the following parameters: - Destination surface(s) (single or double buffered) - Top-left corner the output video is written to the destination surfaces GFVXVIPUPDATE::ppSurf passes an array of 1 or 2 destination surfaces to capture the incoming video stream. If 2 surfaces are passed, the VIP target surface is flipped after each frame of VIP input if #GFVX_VIP_AUTO_FLIP or #GFVX_VIP_AUTO_FLIP_OVERLAY2 flag is specified. Color space conversion (CSC) is performed depending on the output surface color formats: - #GF_SURFACE_RGB565 (16 bpp): VI CSC is used. - #GF_SURFACE_ARGB8888 (32 bpp): VI CSC is used, only available for SC12 and above - #GF_SURFACE_YUV422: (32 bits per two pixels): No CSC is used, data from the VIP is stored as is in memory - any other format is considered to be YUV422, and the data is stored as is If GFVXVIPUPDATE::ppSurf is NULL, data flow through the VIP is still enabled. Data from the VIP is not written to target surfaces, but is is fed to the MPEG or JPEG encoder pre-processor. This mode of operation is useful for the following two cases: - There is not enough memory for JPEG encoding. The application could turn off the screen, enable this mode, and let the JPEG encoder utilize screen memory (the primary surface). - In single-shot mode, the application does not want to display the video image on the screen after enabling the JPEG encoder, thus allowing faster captures and power savings, and freeing bandwidth. After the image is captured, the application enables the JPEG decoder to decode the captured image and shows it on the screen. |
| #GFVX_VIP_AUTO_FLIP | Enable VIP data feeding with auto-display Behaviour is identical to #GFVX_VIP_START, additionally auto-display of the last captured VIP frame is enabled. It is recommended to use this feature in double buffer mode, passing 2 surfaces in GFVXVIPUPDATE::ppSurf. |
| #GFVX_VIP_AUTO_FLIP_OVERLAY2 | Enable VIP data feeding with auto-display from overlay window2 If surfaces to be flipped are overlay surfaces, they are associated with first overlay surface unless #GFVX_VIP_AUTO_FLIP_OVERLAY2 flag is defined. This flag should be used only if UpdateOverlay has been previously called with #GFVX_UO_OVERLAY2 UpdateOption and VxFlip has been called with #GFVX_FLIP_OVERLAY2 FlipOption. |
| #GFVX_VIP_AUTO_TRIGER_BLT | Enable VIP data feeding with auto-blit Behaviour is identical to #GFVX_VIP_START, additionally auto-blit of the last captured VIP frame is enabled. It is recommended to use this feature in double buffer mode, passing 2 surfaces in GFVXVIPUPDATE::ppSurf. If #GFVX_VIP_AUTO_FLIP and #GFVX_VIP_AUTO_TRIGER_BLT are required at the same time, these two action identifiers can be logically OR'ed and passed in GFVXVIPUPDATE::UpdateOption. |
| #GFVX_VIP_STOP | Disable VIP data feeding Stop data feeding through VIP. All other flags and parameters passed in \a pUpdate are ignored. |
| #GFVX_VIP_AUTO_TRIGER_BLT_OFF | Disable VIP auto-blit Stop auto-blit that has been enabled earlier with this function via #GFVX_VIP_AUTO_TRIGER_BLT. This does not disable VIP data feed. |
| #GF_GPIO_SET_INPUT_ENABLE | Input enable set to 1 |
| #GF_GPIO_CLR_INPUT_ENABLE | Input enable clr to 0. |
| #GF_GPIO_GET_INPUT_ENABLE | Get input enable. |
| #GF_GPIO_SET_OUTPUT_ENABLE | Output enable set to 1. |
| #GF_GPIO_CLR_OUTPUT_ENABLE | Output enable clr to 0. |
| #GF_GPIO_GET_OUTPUT_ENABLE | Get output enable. |
| #GF_GPIO_SET_DATA | Output data set to 1. |
| #GF_GPIO_CLR_DATA | Output data clr to 0. |
| #GF_GPIO_GET_DATA | Get output data.
| #GFVX_INTERRUPT_ENABLE | Enable interrupt/status assertion for interrupt type \a IntType. \a pData is ignored. |
| #GFVX_INTERRUPT_DISABLE | Disable interrupt/status assertion for interrupt type \a IntType. \a pData is ignored. |
| #GFVX_INTERRUPT_DISABLE | Clear interrupt/status assertion for interrupt type \a IntType. \a pData is ignored. |
| #GFVX_INTERRUPT_QUERY_STATUS | Query for interrupt/status assertion for interrupt type \a IntType.
Interpretation of associated data block \a pData:
NvU32 Interrupt/status assertion state, one of:
GF_INTERRUPT_ON_STATUS_TRUE = asserted
GF_INTERRUPT_ON_STATUS_FALSE = not asserted
|
| #GFVX_INTERRUPT_SET_Y_FIFO_THRESHOLD, #GFVX_INTERRUPT_GET_Y_FIFO_THRESHOLD |
Set or get DMA FIFO threshold value that controls interrupt/status
assertion for interrupt type #GFVX_Y_FIFO_THRESHOLD_INTR. If the
number of filled locations in the Y-FIFO is greater or equal
than the programmed value, #GFVX_Y_FIFO_THRESHOLD_INTR is asserted.
Note that the threshold value must not be changed within a frame.
Parameter \a IntType is ignored.
Interpretation of associated data block \a pData:
NvU32 Y-FIFO threshold value in range 0..31
|
| #GFVX_INTERRUPT_SET_V_COUNTER_THRESHOLD, #GFVX_INTERRUPT_GET_V_COUNTER_THRESHOLD |
Set or get threshold value that controls interrupt/status assertion
for interrupt type #GFVX_VERTICAL_COUNTER_THRESHOLD_INTR. If the
vertical scanline position for data from parallel video input is
greater or equal than the programmed value,
#GFVX_VERTICAL_COUNTER_THRESHOLD_INTRis asserted.
Parameter \a IntType is ignored.
Interpretation of associated data block \a pData:
NvU32 Vertical counter threshold value in range 0..4095
|
| #GFVX_INTERRUPT_GET_ALL_STATUS | Get VI interrupt status bitmask.
Parameter \a IntType is ignored.
Interpretation of associated data block \a pData:
NvU32 Interrupt status bitmask,
Logically OR'ed combination of:
#GFVX_VID0PIN_RISING_EDGE_INTR
#GFVX_VID1PIN_RISING_EDGE_INTR
#GFVX_VID2PIN_RISING_EDGE_INTR
#GFVX_VID3PIN_RISING_EDGE_INTR
#GFVX_VID4PIN_RISING_EDGE_INTR
#GFVX_VID5PIN_RISING_EDGE_INTR
#GFVX_VID6PIN_RISING_EDGE_INTR
#GFVX_VID7PIN_RISING_EDGE_INTR
#GFVX_VERTICAL_COUNTER_THRESHOLD_INTR
#GFVX_VHSYNC_RISING_INTR
#GFVX_VVSYNC_RISING_INTR
#GFVX_VIDEO_IN_FIELD_DATA_RECV_INTR
#GFVX_EARLY_VIDEO_INTR
#GFVX_Y_FIFO_THRESHOLD_INTR
|
| #GFVX_INTERRUPT_CLEAR_ON_ALL_STATUS | Clear VI interrupt assertions.
Parameter \a IntType is ignored.
Interpretation of associated data block \a pData:
NvU32 Interrupt status bitmask,
set bit = clear this interrupt assertion
unset bit = leave unchanged
Valid bits which can be logically OR'ed:
#GFVX_VID0PIN_RISING_EDGE_INTR
#GFVX_VID1PIN_RISING_EDGE_INTR
#GFVX_VID2PIN_RISING_EDGE_INTR
#GFVX_VID3PIN_RISING_EDGE_INTR
#GFVX_VID4PIN_RISING_EDGE_INTR
#GFVX_VID5PIN_RISING_EDGE_INTR
#GFVX_VID6PIN_RISING_EDGE_INTR
#GFVX_VID7PIN_RISING_EDGE_INTR
#GFVX_VERTICAL_COUNTER_THRESHOLD_INTR
#GFVX_VHSYNC_RISING_INTR
#GFVX_VVSYNC_RISING_INTR
#GFVX_VIDEO_IN_FIELD_DATA_RECV_INTR
#GFVX_EARLY_VIDEO_INTR
#GFVX_Y_FIFO_THRESHOLD_INTR
|
| \b Attribute | \b Direction | \b Synopsis |
| #GFVX_ATTR_VIDEO_BUF | get | Video input interrupt status |
- #GFVX_SET_CSC_USE_CCIR601_RANGE -- Use CCIR601 range.
This option will ignore parameter pCoef. It will use
pre-defined CSC CCIR601 coefficients values.
- #GFVX_SET_CSC_USE_FULL_RANGE -- Use color full range.
This option will ignore parameter pCoef. It will use
pre-defined CSC full range coefficients values.
- #GFVX_SET_CSC_USE_USER_DEFINED_RANGE -- Use user defined range.
This option will require parameter pCoef. It will use
CSC coefficients values provided from pCoef.
@param sbMode (#GFVXBLTMODE) StretchBlt mode, one of:
- GFVX_BLT_FULL_MODE: Host full frame stretchblt trigger
- GFVX_BLT_PARTIAL_MODE: Host partial frame stretchblt trigger
- GFVX_BLT_AUTO_VI_MODE: Auto stretchblt trigger from VI
@retval #GF_SUCCESS Success
@retval #GF_ERROR Some error occured
*/
GF_RETTYPE GFVxBltSetCSCCoeff(GFVxHandle VxHandle,
GFVXCSCCOEF *pCoef,
NvU32 option,
GFVXBLTMODE sbMode);
/** This function sets the current state VI color space converion (CSC)
coefficients that will be programmed to GPU after calling GFVxVIPUpdate
to do YUV color space conversion to RGB.
How to use this routine:
- GFVxVIPGetCSCCoeff() to get default YUV CSC coefficients, save them
- GFVxVIPSetCSCCoeff() to change to new YUV CSC coefficients
- GFVxVIPUpdate() to preview image with your new YUV CSC coefficients to RGB
- GFVxVIPSetCSCCoeff() to restore back default YUV CSC coefficients
@param VxHandle (#GFVxHandle) Handle to GFVxAPI
@param pCoef (#GFVXCSCCOEF*) Pointer to #GFVXCSCCOEF structure
@param option (NvU32) Option type, one of:
- #GFVX_SET_CSC_USE_CCIR601_RANGE -- Use CCIR601 range.
This option will ignore parameter pCoef. It will use
pre-defined CSC CCIR601 coefficients values.
- #GFVX_SET_CSC_USE_FULL_RANGE -- Use color full range.
This option will ignore parameter pCoef. It will use
pre-defined CSC full range coefficients values.
- #GFVX_SET_CSC_USE_USER_DEFINED_RANGE -- Use user defined range.
This option will require parameter pCoef. It will use
CSC coefficients values provided from pCoef.
@retval #GF_SUCCESS Success
@retval #GF_ERROR Some error occured
*/
GF_RETTYPE GFVxVIPSetCSCCoeff(GFVxHandle VxHandle, GFVXCSCCOEF *pCoef, NvU32 option);
/** This function gets the current state stretchblt color space conversion (CSC)
coefficients
@param VxHandle (#GFVxHandle) Handle to GFVxAPI
@param pCoef (#GFVXCSCCOEF*) Pointer to #GFVXCSCCOEF structure
@param sbMode (#GFVXBLTMODE) StretchBlt mode, one of:
- GFVX_BLT_FULL_MODE: Host full frame stretchblt trigger
- GFVX_BLT_PARTIAL_MODE: Host partial frame stretchblt trigger
- GFVX_BLT_AUTO_VI_MODE: Auto stretchblt trigger from VI
@retval #GF_SUCCESS Success
@retval #GF_ERROR Some error occured
*/
GF_RETTYPE GFVxBltGetCSCCoeff(GFVxHandle VxHandle, GFVXCSCCOEF *pCoef, GFVXBLTMODE sbMode);
/** This function gets the current state VI color space conversion (CSC) coefficients
@param VxHandle (#GFVxHandle) Handle to GFVxAPI
@param pCoef (#GFVXCSCCOEF*) Pointer to #GFVXCSCCOEF structure
@retval #GF_SUCCESS Success
@retval #GF_ERROR Some error occured
*/
GF_RETTYPE GFVxVIPGetCSCCoeff(GFVxHandle VxHandle, GFVXCSCCOEF *pCoef);
/** @page pageVxOverview VxAPI Overview
The GFVxAPI is an abstraction layer for both the Video Scalar (StretchBlt)
and the Video Input (VI) module. The Video Scalar provides color space
conversion (CSC) and smooth scaling of video. The VI module, which connects
to the Video Input Port (VIP), accepts data from the VIP or the host CPU
through a FIFO mechanism.
Video data, either decimated or not, can be sent from the VI to JPEG or
MPEG encoder, and at the same time can go to memory through CSC for previewing,
again either decimated or not. If a decimator is used in both the preview and
the encoder paths, it has to have same decimation factor.
Video data can also be sent to EPP. RGB565, RGB444 and RGB888 data goes directly
and YUV422 data, pre or post decimated, is first converted to YUV444 by VI
before sending to EPP.
If data coming from VIP is in Bayer format, VI first sends this data to ISP.
After processing, ISP returns YUV444 data to VI. VI converts output of ISP to
YUV422 before sending it to core for decimation or to memory or both.
There are also options to crop, mirror and/or flip video data.
The Video Scalar and the VI module accept YUV (4:2:2 or 4:2:0) and
RGB (565) data as input. YUV data can be converted to YUV planar data or
RGB data (RGB:565 for all processors, and RGB:888 or ARGB:8888 for GoForce
3D 4800). RGB data can be scaled, but cannot be converted to YUV, for all
processors up to the GoForce 3D 4800.
@section pageVxOverview1 Video Sources
The video source for the VI module can be the host CPU or a camera
connected to the VIP. The video source for the Video Scalar can be the
video memory surface or the output of the JPEG or MPEG decoder through a
circular buffer. The GFVxAPI functions that deal only with the VIP have VIP
in their function names.
@section pageVxOverview2 Video Camera Interface
Usually a video camera connected through the VIP generates YUV 422 data
(CCIR656 format) which can be encoded by the NVIDIA GPU. Some cameras
generate JPEG-encoded images directly, and the GFSDK can be configured to
accept those JPEG-encoded bit streams.
To control the JPEG input stream, VIP of newer NVIDIA GPUs supports the
following camera interface protocols for variably sized bitstream data:
- Type A interface: VHSync and VVSync length can be variable, and
VVClk should be kept running. (SC12 only)
- Type B interface: VHSync and VVSync length can be variable, and
VVClk can be stopped during the image transfer period. (SC12 only)
- Type C interface: VHSync and VVSync length are fixed, and VVClk
should be kept running. The camera can insert 0xff in the image as
padding.
@section pageVxOverview3 Video Coordinate Systems (Regular and Rotated)
A destination coordinate is always the same as a screen coordinate. The
source coordinate stays the same, even if there is rotation.
*/
/** @page pageVxAppNotes VxAPI Application Notes
@section pageVxAppNotes1 Programming Sequence
The easiest way to learn the VxAPI is by referring to the demonstration
application source code that come with the GFSDK package. A new application
can be started by creating a project at the same directory level as the
demo application source directory. This way the same directory tree
structure can be maintained. The general sequence for programming the
VxAPI is as follows:
-# Make sure that the build project or file has the right paths to the
library and header files. Use relative directory addressing if possible.
The GFSDK/Inc directory must be included.
-# Include GFVx.h in the source file. This header is all that is needed to
access the exposed API functions.
-# Call GFRmOpen() before any other GFSDK functions (including the VxAPI).
-# Use the handle returned from the Resource Manager in the previous step
to call GFRmComponentGet() with #GF_VXAPI as the ComponentType in the
#GFRMCOMPONENT structure. The returned handle is the one to use
throughout all VxAPI calls.
-# To better utilize VxAPI functions, it is a good idea to call
GFVxGetProperty() to determine the version that you are using and the
available video memory.
-# Make calls to the appropriate VxAPI functions. Always remember to pass
the same #GFVxHandle returned from GFRmComponentGet().
-# When all the VxAPI calls are completed, call GFRmComponentRelease().
-# When exiting the application, call RmClose() to release everything
associated with the GFSDK.
*/
//////////////////Raw Capture Defination //////////////////////////
/** Descriptor for raw data fetch buffers.
This structure describes a buffer and its fill status for Raw YUV transfered
from RDMA to the application.
It is used with GFVxRawCapture() and GFVxRawCaptureFetchImage()
in either polling or callback data fetch mode.
@see GFVxCapture(), GFVxRawCaptureFetchImage()
*/
typedef struct _GFVX_BUF {
NvU8 *pBuf; /**< Pointer to the buffer */
NvU32 bufSize; /**< Size of the buffer in bytes */
NvU32 nBytesCaptured; /**< Number of bytes captured,
app initializes to 0
*/
} GFVX_BUF, *PGFVX_BUF;
/** Image source/target dimensions and data source for Raw data capturing.
This structure is passed as parameter to GFVxRawCaptureStart() and describes
data source, source cropping rectangle and destination image size.
@see GFVxRawCaptureStart()
*/
typedef struct _GFVXRAWINFO
{
PGFRMSURFACE pSrcSurf;/**< Surface to encode,
NULL for camera.
*/
PGFRECT pSrcRect; /**< Source image area need to capture */
NvU32 DestWidth; /**< Final output data width */
NvU32 DestHeight; /**< Final output data height */
NvU32 uiOptions; /**< Bitmask of flags to control capturing
| #GF_CAPT_ERROR_VIDEO_MEMORY_NOT_BIG_ENOUGH | Not enough free video memory, try to release unnecessary video surfaces |
| #GF_CAPT_ERROR_WRONG_CONFIG | Wrong input parameters, for example srcRect size greater than pSrcSurf dimensions |
| #GF_CAPT_ERROR_NO_CALLBACK | No callback function available |