/* 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 */ /*@{*/ /* GFVX Property Capability */ /** VxAPI property flag: Color space conversion supported. @see GFVxGetProperty(), GFPROPERTY::Capability */ #define GFVX_CAP_CSC 0x00000001 /** VxAPI property flag: VIP functions available. @see GFVxGetProperty(), GFPROPERTY::Capability */ #define GFVX_CAP_VIP 0x00000002 /** VxAPI property flag: Enlarge source image via VIP supported. @see GFVxGetProperty(), GFPROPERTY::Capability */ #define GFVX_CAP_ENLARGE 0x00000004 /** VxAPI property flag: Shrink source image via VIP supported. @see GFVxGetProperty(), GFPROPERTY::Capability */ #define GFVX_CAP_SHRINK 0x00000008 /** VxAPI property flag: Overlay supported. The GoForce processor version supports overlay display. @see GFVxGetProperty(), GFPROPERTY::Capability */ #define GFVX_CAP_OVERLAY 0x00000020 /** VxAPI property flag: MPEG4 decoder supported. @see GFVxGetProperty(), GFPROPERTY::Capability */ #define GFVX_CAP_MPEGDEC 0x00000040 /** VxAPI property flag: MPEG4 encoder supported. @see GFVxGetProperty(), GFPROPERTY::Capability */ #define GFVX_CAP_MPEGENC 0x00000080 /** VxAPI property flag: JPEG decoder supported. @see GFVxGetProperty(), GFPROPERTY::Capability */ #define GFVX_CAP_JPEGDEC 0x00000100 /** VxAPI property flag: JPEG encoder supported. @see GFVxGetProperty(), GFPROPERTY::Capability */ #define GFVX_CAP_JPEGENC 0x00000200 /** VxAPI property flag: Alpha blending supported. @version SC12 and above only. @see GFVxGetProperty(), GFPROPERTY::Capability */ #define GFVX_CAP_ALPHA_BLEND 0x00000400 /** VxAPI property flag: Extended RGB format 32 bpp supported. @version SC12 above only. @see GFVxGetProperty(), GFPROPERTY::Capability */ #define GFVX_CAP_EXTEND_RGB 0x00000800 /** VxAPI property flag: Variable sized data camera interface (Type A/B/C) supported. See section @ref pageVxOverview2 for information on Type A/B/C camera interfaces. @version SC12 and above only. @see GFVxGetProperty(), GFPROPERTY::Capability, */ #define GFVX_CAP_ENCODE_TYPE 0x00001000 /** VxAPI property flag: Bayer type camera interface supported. @version SC15 and above only. @see GFVxGetProperty(), GFPROPERTY::Capability, */ #define GFVX_CAP_BAYER_TYPE 0x00002000 // support bayer type input /** VxAPI property flag: YUV Overlay supported. @version SC15 and above only. @see GFVxGetProperty(), GFPROPERTY::Capability */ #define GFVX_CAP_OVERLAY_YUV 0x00004000 /** VxAPI property flag: Overlay with scaling supported. @version SC15 and above only. @see GFVxGetProperty(), GFPROPERTY::Capability */ #define GFVX_CAP_OVERLAY_SCALE 0x00008000 /** VxAPI property flag: Multiple Overlay supported. @version SC15 and above only. @see GFVxGetProperty(), GFPROPERTY::Capability */ #define GFVX_CAP_OVERLAY_MULTIPLE 0x00010000 /** VxAPI property flag: Per pixel alpha supported. Used when application wants to use weight (overlay and blend) defined in pixels alpha bits. @version SC15 and above only. @see GFVxGetProperty(), GFPROPERTY::Capability */ #define GFVX_CAP_PER_PIXEL_ALPHA 0x00020000 /** VxAPI GFVXBLT::BltOption flagbit: Disable VSync wait. Disable GFVxBlt() synchronization with VSync. The default behaviour of GFVxBlt() is to wait for VSync to prevent display flicker. Note that if the display is disabled there is no VSync signal and GFVxBlt() would block. @see GFVXBLT, GFVxBlt() */ #define GFVX_BLT_DISABLE_WAIT_VSYNC 0x00000080 /** VxAPI GFVXBLT::BltOption flagbit: Source color key. GFVxBlt() compares each pixel of the source surface with the color key. If the colors match, the pixel is not copied to the destination surface. The source color key option is not very useful when scaling is used. @see GFVXBLT, GFVxBlt() */ #define GFVX_BLT_SRC_KEY 0x00000100 /** VxAPI GFVXBLT::BltOption flagbit: Auto-blit at end of VIP frame. If this flag is set, GFVxBlt() configures blit parameters for VIP auto-blit. VIP auto-blit can be used to fire stretch blit automatically at the end of the video input frame from the video input port (VIP). This requires double buffering of the input and output of stretch blit. The use of this flag is to be combined with GFVxVIPUpdate() flag #GFVX_VIP_AUTO_TRIGER_BLT. @see GFVXBLT, GFVxBlt(), #GFVX_VIP_AUTO_TRIGER_BLT */ #define GFVX_AUTO_BLT 0x00000400 /** VxAPI GFVXBLT::BltOption flagbit: Auto-blit at end of VIP frame. This flag is the same as #GFVX_AUTO_BLT @version SC15 and above only @see GFVXBLT, GFVxBlt(), #GFVX_VIP_AUTO_TRIGER_BLT, #GFVX_AUTO_BLT */ #define GFVX_BLT_AUTO_VI 0x00000400 /** VxAPI GFVXBLT::BltOption flagbit: Auto-display destination surface. The application does not need call GFVxFlip() to show the surface. With the auto-display option, the VI module triggers stretch blit which in turn sends the destination surface's buffer address to the display controller (GC). VI input data goes into double buffers which become the stretch blit source, the output of stretch blit is also double buffered. @see GFVXBLT, GFVxBlt() */ #define GFVX_AUTO_DISPLAY 0x00000800 /** VxAPI GFVXBLT::BltOption flagbit: Auto-display destination surface. This flag is the same as #GFVX_AUTO_DISPLAY @version SC15 and above only @see GFVXBLT, GFVxBlt(), #GFVX_AUTO_DISPLAY */ #define GFVX_BLT_AUTO_DISPLAY 0x00000800 /** VxAPI GFVXBLT::BltOption flagbit: Set up parameters for partial blit If this flag is set, GFVxBlt() configures blit parameters for partial blit. The partial blit works only with circular buffers and source and destination format are not YUV planar format. @see GFVXBLT, GFVxBlt() */ #define GFVX_BLT_PARTIAL 0x00001000 /** VxAPI GFVXBLT::BltOption flagbit: Trigger partial blit If this flag is set, GFVxBlt() will blit buffer specified in buffer index option of circular buffers to destination surface. The use of this flag is to be combined with GFVxBlt() flag #GFVX_BLT_PARTIAL. @see GFVXBLT, GFVxBlt(), #GFVX_BLT_PARTIAL */ #define GFVX_BLT_PARTIAL_TRIGGER 0x00002000 /** VxAPI GFVXBLT::BltOption flagbit: Blit without rotation If this flag is set, GFVxBlt() blits without rotation @see GFVXBLT, GFVxBlt() */ #define GFVX_BLT_ROTATE_0 0x00004000 /** VxAPI GFVXBLT::BltOption flagbit: Blit with 90 degree rotation If this flag is set, GFVxBlt() blits with 90 degree rotation Currently, SC15 doesn't support this feature. However, this flag can be combined with flag GFVX_BLT_H_FLIP to blit with XY swap @see GFVXBLT, GFVxBlt() */ #define GFVX_BLT_ROTATE_90 0x00008000 /** VxAPI GFVXBLT::BltOption flagbit: Blit with 180 degree rotation If this flag is set, GFVxBlt() blits with 180 degree rotation Currently, SC15 doesn't support this feature. @see GFVXBLT, GFVxBlt() */ #define GFVX_BLT_ROTATE_180 0x00010000 /** VxAPI GFVXBLT::BltOption flagbit: Blit with 270 degree rotation If this flag is set, GFVxBlt() blits with 270 degree rotation Currently, SC15 doesn't support this feature. However, this flag can be combined with flag GFVX_BLT_V_FLIP to blit with XY swap @see GFVXBLT, GFVxBlt() */ #define GFVX_BLT_ROTATE_270 0x00020000 /** VxAPI GFVXBLT::BltOption flagbit: Blit with horizontal flip If this flag is set, GFVxBlt() blits with horizontal flip Currently, SC15 doesn't support this feature. @see GFVXBLT, GFVxBlt() */ #define GFVX_BLT_H_FLIP 0x00040000 /** VxAPI GFVXBLT::BltOption flagbit: Blit with vertical flip If this flag is set, GFVxBlt() blits with vertical flip Currently, SC15 doesn't support this feature @see GFVXBLT, GFVxBlt() */ #define GFVX_BLT_V_FLIP 0x00080000 /** VxAPI GFVXBLT::BltOption flagbit: Auto-display destination surface using overlay window 2. This is exactly identical to #GFVX_AUTO_DISPLAY except that it uses overlay window 2 instead of overlay window 1 (default). @version SC15 and above only @see GFVXBLT, GFVxBlt() */ #define GFVX_AUTO_DISPLAY_OVERLAY2 0x00100000 /** VxAPI GFVXBLT::BltOption flagbit: Auto-display destination surface using overlay window 2. This flag is the same as #GFVX_AUTO_DISPLAY_OVERLAY2 @version SC15 and above only @see GFVXBLT, GFVxBlt(), #GFVX_AUTO_DISPLAY_OVERLAY2 */ #define GFVX_BLT_AUTO_DISPLAY_OVERLAY2 0x00100000 /** VxAPI GFVXBLT::BltOption flagbit: Enables full range in color spce conversion 0<= Y <=255, -128<= U <=127, -128<= V <=127 YUV-->RGB conversion formula: R = 1.000Y + 1.402V G = 1.000Y - 0.344U - 0.714V B = 1.000Y + 1.772U This option is useful for decoded video from movies. When this flag is not set, uses CCIR601 range (16-235) as follows: 16<= Y <=235, 16<= U <=240, 16<= V <=240 YUV-->RGB conversion formula: R = 1.164(Y-16) + 1.596(Cr-128) G = 1.164(Y-16) - 0.391(Cb-128) - 0.813(Cr-128) B= 1.164(Y-16) + 2.018(Cb-128) This option is useful for video from camera. @version SC15 and above only @see GFVXBLT, GFVxBlt() */ #define GFVX_BLT_CSC_FULL_RANGE 0x00200000 /** VxAPI GFVXBLT::BltOption flagbit: Enable camera VSync wait. Enable GFVxBlt() synchronization with camera VSync. Note that if the camera is disabled there is no VSync signal and GFVxBlt() would block. @see GFVXBLT, GFVxBlt() */ #define GFVX_BLT_ENABLE_WAIT_CAMERA_VSYNC 0x00400000 /** VxAPI GFVXBLT::BltOption flagbit: Disable vertical and horizontal filters By default, the vertical and horizontal filters are enabled. If this flag is set, GFVxBlt() blits with filters disabled @see GFVXBLT, GFVxBlt() */ #define GFVX_BLT_DISABLE_FILTERS 0x00800000 /** VxAPI option parameter of routines GFVxBltSetCSCCoefff() and GFVxVIPSetCSCCoeff() to use CCIR601 range CSC_USE_CCIR601_RANGE (16-235) as follows: 16<= Y <=235, 16<= U <=240, 16<= V <=240 YUV-->RGB conversion formula: 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) The CSC 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 This option is useful for video from camera. @see GFVxBltSetCSCCoeff(), GFVxVIPSetCSCCoeff() */ #define GFVX_SET_CSC_USE_CCIR601_RANGE 0x00800000 /** VxAPI option parameter of routines GFVxBltSetCSCCoefff() and GFVxVIPSetCSCCoeff() to use full range in color space conversion CSC_USE_FULL_RANGE 0<= Y <=255, -128<= U <=127, -128<= V <=127 YUV-->RGB conversion formula: 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) The CSC coefficients are: KYRGB, KUR, KVR 1.0000 0.0000 1.4020 KYRGB, KUG, KVG = 1.0000 -0.3440 -0.7140 KYRGB, KUB, KVB 1.0000 1.7720 0.0000 and YOF = 0.0000 This option is useful for decoded video from movies. @see GFVxBltSetCSCCoeff(), GFVxVIPSetCSCCoeff() */ #define GFVX_SET_CSC_USE_FULL_RANGE 0x01000000 /** VxAPI option parameter of routines GFVxBltSetCSCCoefff() and GFVxVIPSetCSCCoeff() to use user defined range provided in option parameter pCoeff pointer to GFVXCSCCOEF struct @see GFVxBltSetCSCCoeff(), GFVxVIPSetCSCCoeff() */ #define GFVX_SET_CSC_USE_USER_DEFINED_RANGE 0x02000000 /** Structure to control GFVxBlt() behaviour. @see GFVxBlt() */ typedef struct _GFVXBLT { PGFRMSURFACE *ppDestSurf; /**< Pointer to an array of destination surfaces of identical dimensions. For passing scaled YUV output data to the planar block as input to the JPEG/MPEG encoder, pass an array containing one NULL pointer. Destination surface dimensions limitations:
Minimum stride0 bytes
Minimum width 1
Minimum height1
Maximum stride4095 bytes
Maximum width 4064 (YUV) (YUV data restricted by JPEG encoder),
32767 (RGB) (RGB data restricted by stride)
Maximum height32766, or unlimited if \a pDestRect is specified
If the destination color format is YUV (pass to JPEG/MPEG EPP, and \a pDestRect is not specified, the surface width must be a multiple of 2. */ PGFRMSURFACE *ppSrcSurf; /**< Pointer to an array of source surfaces of identical dimensions. Source surface dimensions limitations:
Minimum stride0 bytes
Minimum width 1
Minimum height1
Maximum stride4095 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 height32766, or unlimited if \a pDestRect is specified
*/ PGFRECT pDestRect; /**< Destination rectangle, or NULL to blit scaled to the size of the entire target surface (size of first surface in \a ppDestSurf is used). Destination cropping rectangle limitations:
Minimum width 1
Minimum height1
Maximum width 4064 (YUV), 32767 (RGB)
Maximum height32766
If the destination color format is YUV (pass to JPEG/MPEG EPP), the destination cropping rectangle's width must be a multiple of 2. */ PGFRECT pSrcRect; /**< Source cropping rectangle, or NULL for no cropping and blit the entire source surface (size of first surface in \a ppSrcSurf is used). Source cropping rectangle limitations:
Minimum width 1
Minimum height1
Maximum width 16383 (SC15), 2032 (SC12), 496 (SC5, RGB or YUV422), 512 (SC5), 496 (SC10, SC4), 312 (SC3 and below)
Maximum height32766
*/ NvU32 numofDestSurf;/**< Number of destination surfaces in array \a ppDestSurf, used only if #GFVX_AUTO_BLT flag set */ NvU32 numofSrcSurf; /**< Number of source surfaces in array \a ppSrcSurf, used only if #GFVX_AUTO_BLT flag or #GFVX_BLT_PARTIAL flag set */ NvU32 colorKey; /**< Color key value in RGB888 format */ NvU32 BltOption; /**< Flag bitmask:
#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
*/ // Fill The following fields if GFVX_BLT_PARTIAL_TRIGGER is set in BltOption NvU32 FrameStart; /* @Notify start of frame. Used only if #GFVX_BLT_PARTIAL_TRIGGER is set in \a BltOption. */ NvU32 FrameEnd; /* @Notify end of frame. Used only if #GFVX_BLT_PARTIAL_TRIGGER is set in \a BltOption. */ NvU32 BufferIndex; /* @Specify which buffer of circular buffers is blitted. Used only if #GFVX_BLT_PARTIAL_TRIGGER is set in \a BltOption. */ } GFVXBLT, *PGFVXBLT; /** VxAPI GFVXFLIP::FlipOption flagbit: Flip uses second overlay window. By default, VxFlip associates foreground and background surfaces to first overlay window and flips them. However, the application can override the default behavior and use second overlay window by using this flag in FlipOption. This option should be used only if second overlay surface has been previously set using UpdateOverlay(). . @version SC15 and above only @see GFVXFLIP, GFVxFlip() */ #define GFVX_FLIP_OVERLAY2 0x00000001 /** Structure to control GFVxFlip() behaviour. @see GFVxFlip() */ typedef struct _GFVXFLIP { PGFRMSURFACE pBackGroundSurf; /**< Pointer to the surface to be flipped to the background. This surface will not be seen anymore after the GFVxFlip() call. */ PGFRMSURFACE pForeGroundSurf; /**< Pointer to the surface to be flipped to the foreground. This surface will be seen after the GFVxFlip() call. */ NvU32 FlipOption; /**< Flagbit mask controlling flip:
0 Default. Flip uses first overlay window
GFVX_FLIP_SECOND_OVERLAY Flip uses second overlay window
*/ } GFVXFLIP, *PGFVXFLIP; /** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Overlay without rotation. @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay() */ #define GFVX_UO_ROTATE_0 GF_SURFACE_ROTATE_0 /** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Overlay with 180 degree rotation. @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay() */ #define GFVX_UO_ROTATE_180 GF_SURFACE_ROTATE_180 /** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Overlay with horizontal flip. @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay() */ #define GFVX_UO_H_FLIP 0x00000010 /** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Overlay with vertical flip. @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay() */ #define GFVX_UO_V_FLIP 0x00000020 /** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Source color keying. A pixel from the source (overlay) surface is displayed only if pixel color from the source surface matches the color key in GFVXUPDATEOVERLAY::ColorKey. Source color keying is not useful for video overlay, because changing video is the source. @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay(), GFVX_UO_DEST_COLOR_KEY */ #define GFVX_UO_SRC_COLOR_KEY 0x00010000 /** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Destination color keying. A pixel from the source (overlay) surface is displayed only if pixel color from the destination surface matches the color key in GFVXUPDATEOVERLAY::ColorKey. @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay(), GFVX_UO_SRC_COLOR_KEY */ #define GFVX_UO_DEST_COLOR_KEY 0x00020000 /** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Alpha blending. Enable alpha blending. Alpha value is used from GFVXUPDATEOVERLAY::AlphaValue. As AlphaVal increases, the weight of source (overlay) window increases until the window reaches its maximum weight of 0xFF. Even though AlphaVal is a 32 bit number, alpha value can only be a 8 bit value. Application should specify the same value in byte 1 (LSB), 2 and 3 else the API will fail. @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay() */ #define GFVX_UO_ALPHA_BLENDING 0x00040000 /** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Overlay based on destination alpha only. If destination is in 1-bit alpha format (eg ARGB1555), GFVXUPDATEOVERLAY::ColorKey bit[24] contains the alpha value. GFVxUpdateOverlay() compares this value with the target surface's alpha and ignores the RGB value. Overlay (source) surface shows up in portions of the screen where the two match. @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay() */ #define GFVX_UO_COLOR_KEY_ALPHA_ONLY 0x00080000 /** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Overlay based on destination alpha and color If destination is in 1-bit alpha format (eg ARGB1555), GFVXUPDATEOVERLAY::ColorKey bit [24] contains alpha and GFVXUPDATEOVERLAY::ColorKey bit [23:0] contains RGB color values. GFVxUpdateOverlay() compares the key's alpha value and color values with destination surface pixels. Overlay (source) surface shows up in portions of the screen where both alpha and color values match. If neither #GFVX_UO_COLOR_KEY_ALPHA_ONLY nor #GFVX_UO_COLOR_KEY_ALPHA_COLOR are set, GFVxUpdateOverlay() assumes the RGB values in GFVXUPDATEOVERLAY::ColorKey to be valid and compares the RGB value with surface's RGB value. Depending upon whether #GFVX_UO_SRC_COLOR_KEY or #GFVX_UO_DEST_COLOR_KEY is defined, RGB value is compared with source or destination pixels. If neither #GFVX_UO_SRC_COLOR_KEY nor #GFVX_UO_DEST_COLOR_KEY is defined, overlay(source) surface is overlayed on top of destination surface without any match. #GFVX_UO_COLOR_KEY_ALPHA_ONLY nor #GFVX_UO_COLOR_KEY_ALPHA_COLOR if defined, are ignored. @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay() */ #define GFVX_UO_COLOR_KEY_ALPHA_COLOR 0x00100000 /** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Alpha blending based on destination alpha. If destination is in 1-bit alpha format (eg ARGB1555), GFVXUPDATEOVERLAY::BlendingColorKey bit [24] contains an alpha value. GFVxUpdateOverlay() compares this value with the destination surface's alpha only and ignores the RGB value. If the two match, GFVXUPDATEOVERLAY::AlphaValue determines the weight of source surface. @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay() */ #define GFVX_UO_BLD_COLOR_KEY_ALPHA_ONLY 0x00200000 /** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Alpha blending based on destination alpha and color If destination is in 1-bit alpha format (eg ARGB1555), GFVXUPDATEOVERLAY::BlendingColorKey bit [24] contains an alpha value and GFVXUPDATEOVERLAY::BlendingColorKey bit [23:0] contains RGB values. GFVxUpdateOverlay() compares alpha value and color value with the destination surface's alpha and color value. Source and destination pixels appear blended in portions of the screen where both alpha and color values match. GFVXUPDATEOVERLAY::AlphaValue determines the weight of source surface. If neither #GFVX_UO_BLD_COLOR_KEY_ALPHA_ONLY nor #GFVX_UO_BLD_COLOR_KEY_ALPHA_COLOR are set, GFVxUpdateOverlay() assumes the RGB portion in the key to be valid and compares the RGB value with the surface's RGB value. @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay() */ #define GFVX_UO_BLD_COLOR_KEY_ALPHA_COLOR 0x00400000 /** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Enable Second overlay window SC15 supports two overlay windows. This flag is used to enable the second overlay window. @version SC15 and above only @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay() */ #define GFVX_UO_OVERLAY2 0x00800000 /** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Show this overlay window on top When more than one overlay windows are enabled and their destination rectangles overlap, this flag can be defined to indicate which overlay window should appear on top. By default, first overlay window will appear on top if destination rectangles for the two windows overlap. However, application can override the default behavior by specifying #GFVX_UO_ACTIVETOP flag in relevant windows's UpdateOption. @version SC15 and above only @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay() */ #define GFVX_UO_ACTIVETOP 0x01000000 /** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Overlay and Blend weight comes from per-pixel alpha channel. @version SC15 and above only @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay() */ #define GFVX_UO_COLOR_KEY_PER_PIXEL_ALPHA 0x02000000 /** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Enable digital vibrance for overlay. If this bit is set in UpdateOption, then dvRed, dvGreen and dvBlue must be set in UpdateOverlay structure for overlay window. If this bit is set in UpdateOption2, then dvRed2, dvGreen2 and dvBlue2 must be set in UpdateOverlay structure for overlay2 window. @version SC15 and above only @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay() */ #define GFVX_UO_DIGITAL_VIBRANCE 0x04000000 /** VxAPI GFVXUPDATEOVERLAY::UpdateOption2 flagbit: Enable AlphaValue2 If this bit is set in UpdateOption2, then the alpha value is used from GFVXUPDATEOVERLAY::AlphaValue2 @version SC15 and above only @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay() */ #define GFVX_UO_USE_ALPHAVALUE2 0x08000000 /** Structure for controlling GFVxUpdateOverlay() behaviour. @see GFVxUpdateOverlay() */ typedef struct _GFVXUPDATEOVERLAY { PGFRMSURFACE pDestSurf; /**< Destination surface pointer */ PGFRMSURFACE pSrcSurf; /**< Source surface pointer, if this pointer is NULL, disable overlay. */ PGFRECT pDestRect; /**< Destination rectangle */ PGFRECT pSrcRect; /**< Source rectangle */ NvU32 ColorKey; /**< Color key value in ARGB32 format. Color keying takes effect only when #GFVX_UO_SRC_COLOR_KEY or #GFVX_UO_DEST_COLOR_KEY is set. */ NvU32 UpdateOption; /**< Flagbit mask controlling rotation, color keying:
#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
*/ NvU32 BlendingColorKey; /**< Blending color key value in ARGB32 format. Value takes effect only when #GFVX_UO_ALPHA_BLENDING and (#GFVX_UO_SRC_COLOR_KEY or #GFVX_UO_DEST_COLOR_KEY) are set. */ NvU32 AlphaValue; /**< Alpha value for blending overlay. Alpha value is used to do blending when blending color key matches. Even though AlphaVal is a 32 bit number, alpha value can only be a 8 bit value. Application should specify the same value in byte 1 (LSB), 2 and 3 else the API will fail. */ PGFRMSURFACE pDestSurf2; /**< Destination surface pointer for second overlay */ PGFRMSURFACE pSrcSurf2; /**< Source surface pointer for second overlay, if this pointer is NULL, disable second overlay. */ PGFRECT pDestRect2; /**< Destination rectangle for second overlay */ PGFRECT pSrcRect2; /**< Source rectangle for second overlay */ NvU32 UpdateOption2; /**< Flagbit mask controlling rotation, color keying for second overlay:
#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
*/ NvU8 dvRed; /**< Digital vibrance amplification factor for R overlay. It is configured via GFVxUpdateOverlay(), GFVXUPDATEOVERLAY::dvRed's valid value range is 1 to 100. */ NvU8 dvGreen; /**< Digital vibrance amplification factor for G overlay. It is configured via GFVxUpdateOverlay(), GFVXUPDATEOVERLAY::dvGreen's valid value range is 1 to 100. */ NvU8 dvBlue; /**< Digital vibrance amplification factor for B overlay. It is configured via GFVxUpdateOverlay(), GFVXUPDATEOVERLAY::dvBlue's valid value range is 1 to 100. */ NvU8 dvRed2; /**< Digital vibrance amplification factor for R overlay2. It is configured via GFVxUpdateOverlay(), GFVXUPDATEOVERLAY::dvRed2's valid value range is 1 to 100. */ NvU8 dvGreen2; /**< Digital vibrance amplification factor for G overlay2. It is configured via GFVxUpdateOverlay(), GFVXUPDATEOVERLAY::dvGreen2's valid value range is 1 to 100. */ NvU8 dvBlue2; /**< Digital vibrance amplification factor for B overlay2. It is configured via GFVxUpdateOverlay(), GFVXUPDATEOVERLAY::dvBlue2's valid value range is 1 to 100. */ NvU32 AlphaValue2; /**< Alpha value for blending Window C overlay. Same restriction as for GFVXUPDATEOVERLAY::AlphaValue apply. */ } GFVXUPDATEOVERLAY, *PGFVXUPDATEOVERLAY; /** Parameter structure for GFVxVIPFeedImage(). This structure describes the image data that is to be fed to the VIP via the CPU host. @see GFVxVIPFeedImage() */ typedef struct _GFVXVIPFEEDIMAGE { PGFRMSURFACE pSurf; /**< Surface to feed data from, must be in a YUV format and accessible by the host CPU */ PGFRECT pSrcRect; /**< Source clipping rectangle for data feeding, or NULL for no clipping */ } GFVXVIPFEEDIMAGE, *PGFVXVIPFEEDIMAGE; /** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP supports image shrinking. @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP() */ #define GFVX_VIP_CAP_SHRINK 0x00000001 /** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP supports image enlarging. @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP() */ #define GFVX_VIP_CAP_ENLARGE 0x00000002 /** VxAPI GFVXVIPPROPERTY::Flag flagbit: Parallel video input supported. @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP() */ #define GFVX_VIP_CAP_PARALLEL 0x00000004 /** VxAPI GFVXVIPPROPERTY::Flag flagbit: Serial video input supported. @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP() */ #define GFVX_VIP_CAP_SERIAL 0x00000008 /** VxAPI GFVXVIPPROPERTY::Flag flagbit: Vertical and horizontal flip supported for VIP output RGB image. @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP() */ #define GFVX_VIP_CAP_RGB_VH_FLIP 0x00000010 /** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP can supply VClock and VHSync signals to the camera chip. @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP() */ #define GFVX_VIP_CAP_OUTPUT_VCLOCK_VHSYNC 0x00000020 /** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP can supply a master clock to the camera chip. @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP() */ #define GFVX_VIP_CAP_OUTPUT_MASTER_CLOCK 0x00000040 /** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP can accept a JPEG bitstream from a camera with type A interface. See section @ref pageVxOverview2 for description of type A, B, and C interfaces. @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP() */ #define GFVX_VIP_CAP_TYPE_A 0x00000080 /** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP can accept a JPEG bitstream from a camera with type B interface. See section @ref pageVxOverview2 for description of type A, B, and C interfaces. @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP() */ #define GFVX_VIP_CAP_TYPE_B 0x00000100 /** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP can accept a JPEG bitstream from a camera with type C interface. See section @ref pageVxOverview2 for description of type A, B, and C interfaces. @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP() */ #define GFVX_VIP_CAP_TYPE_C 0x00000200 /** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP can accept Bayer format input. @version SC15 and above @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP() */ #define GFVX_VIP_CAP_BAYER 0x00000400 /** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP can accept RGB565 format input. @version SC15 and above @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP() */ #define GFVX_VIP_CAP_RGB565 0x00000800 /** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP can accept RGB888 format input. @version SC15 and above @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP() */ #define GFVX_VIP_CAP_RGB888 0x00001000 /** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP can accept RGB444 format input. @version SC15 and above @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP() */ #define GFVX_VIP_CAP_RGB444 0x00002000 /** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP can accept YUV420NP format input. @version SC15 and above @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP() */ #define GFVX_VIP_CAP_YUV420NP 0x00004000 /** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP can accept JPEG image from camera through type C_RAW interface. See section @ref pageVxOverview2. @version SC15 and above @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP() */ #define GFVX_VIP_CAP_TYPE_C_RAW 0x00008000 /** Structure used by GFVxVIPGetProperty() to describe VIP capabilities. @see GFVxVIPGetProperty() */ typedef struct _GFVXVIPPROPERTY { NvU32 Flag; /**< Flag bitmask describing VIP capabilities:
#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
*/ NvU32 DestFormat;/**< Supported color formats at VIP output, the returned value is a logically OR'ed combination of the following surface identifiers:
#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
To check if a specific colour format is supported, logically AND \a DestFormat against the format identifier and compare it as below:
    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; /** convert to data type*/ // PIXEL_STREAM_PPA_COMMAND: NvU32 StartMarkerFrameMin; //CSI_PPA_START_MARKER_FRAME_MIN; /** comment */ NvU32 StartMarkerFrameMax; //CSI_PPA_START_MARKER_FRAME_MAX; /** comment */ // PIXEL_STREAM_A_CONTROL0: NvU32 VirtualChannelID; //CSI_PPA_VIRTUAL_CHANNEL_ID; /** stream virtual ID number */ NvU32 OutputFormatOpt; //CSI_PPA_OUTPUT_FORMAT_OPTIONS; /** output format */ // PIXEL_STREAM_A_CONTROL1: NvU32 TopFieldFrame; //CSI_PPA_TOP_FIELD_FRAME; /** camera spec */ NvU32 TopFieldFrameMask; //CSI_PPA_TOP_FIELD_FRAME_MASK; /** camera sepc */ // PIXEL_STREAM_A_GAP: NvU32 LineMinGap; //PPA_LINE_MIN_GAP; /** gap between lines */ NvU32 FrameMinGap; //PPA_FRAME_MIN_GAP; /** gat between frames */ // PIXEL_STREAM_A_EXPECTED_FRAME: NvU32 LineTimeOutMaxClock; //PPA_MAX_CLOCKS; /** line time out value */ } GFVXCSISET, *PGFVXCSISET; /* CSI data types *` Set by camera script to match * stream supplied by camera */ #define GFVX_CSI_DATA_YUV420_8 (24UL) #define GFVX_CSI_DATA_YUV420_10 (25UL) #define GFVX_CSI_DATA_LEG_YUV420_8 (26UL) #define GFVX_CSI_DATA_YUV420CSPS_8 (28UL) #define GFVX_CSI_DATA_YUV420CSPS_10 (29UL) #define GFVX_CSI_DATA_YUV422_8 (30UL) #define GFVX_CSI_DATA_YUV422_10 (31UL) #define GFVX_CSI_DATA_RGB444 (32UL) #define GFVX_CSI_DATA_RGB555 (33UL) #define GFVX_CSI_DATA_RGB565 (34UL) #define GFVX_CSI_DATA_RGB666 (35UL) #define GFVX_CSI_DATA_RGB888 (36UL) #define GFVX_CSI_DATA_RAW6 (40UL) #define GFVX_CSI_DATA_RAW7 (41UL) #define GFVX_CSI_DATA_RAW8 (42UL) #define GFVX_CSI_DATA_RAW10 (43UL) #define GFVX_CSI_DATA_RAW12 (44UL) #define GFVX_CSI_DATA_RAW14 (45UL) #define GFVX_CSI_DATA_ARB_DT1 (48UL) #define GFVX_CSI_DATA_ARB_DT2 (49UL) #define GFVX_CSI_DATA_ARB_DT3 (50UL) #define GFVX_CSI_DATA_ARB_DT4 (51UL) /** OutputFormatOpt */ #define GFVX_CSI_OUTPUT_FORMAT_OPTIONS_ARBITRARY (0UL) #define GFVX_CSI_OUTPUT_FORMAT_OPTIONS_PIXEL (1UL) #define GFVX_CSI_OUTPUT_FORMAT_OPTIONS_PIXEL_REP (2UL) #define GFVX_CSI_OUTPUT_FORMAT_OPTIONS_STORE (3UL) #define GFVX_INTERNAL_DEBUG 0x10000000 // Below defines are used only when input source is HOST and input format is Bayer // Since this is not a valid customer use case, we will not add Doxygen comments to these defines // Minimum padding requirement for ISP #define MIN_SCANSIZE_WIDTH_DIFF 20 #define MIN_SCANSIZE_HEIGHT_DIFF 10 // The actual minimum padding has not been determined; // however, 30 padding on all sides is not enough for // Demosaic mode 4 (5X5BPNR) with M3 statistics gathering. // 35 on right + 15 on top/left/bottom seems to // work fine. #define MIN_ACTIVE_AREA_LEFT_PADDING 15 #define MIN_ACTIVE_AREA_RIGHT_PADDING 35 #define MIN_ACTIVE_AREA_TOP_PADDING 15 #define MIN_ACTIVE_AREA_BOTTOM_PADDING 15 // Active Rect must be a few pixels larger than Output Rect to avoid // a halo effect where the outer pixels are wrong. #define MIN_OUTPUT_AREA_PADDING_3X3 2 #define MIN_OUTPUT_AREA_PADDING_5X5 3 /** Parameter structure passed to GFVxVIPSetVIP(). @see GFVxVIPSetVIP() */ typedef struct _GFVXVIPINFO { NvU32 Flag; /**< Flag bitmask, OR'ed combination of:
#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
*/ 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; /**< VIP input color format identifier, see GFRMSURFACE::ColorFormat. */ NvU32 SerialDelay; /**< VIP serial input delay, reserved for future use. */ NvU32 NewTiming; /**< Flag bitmask configuring VIP input timing, used only if flag #GFVX_VIP_CHANGE_DEFAULT_TIMING set, OR'ed combination of:
#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)
*/ NvU32 HNumerator; /**< VI decimation horizontal numerator, number of pixels to keep from a group of incoming pixels. */ NvU32 HDenominator;/**< VI decimation horizontal denominator, group size. */ NvU32 VNumerator; /**< VI decimation vertical numerator, number of lines to keep from a group of incoming lines. */ NvU32 VDenominator;/**< VI decimation vertical numerator, group size. */ NvU32 MClockFreq; /**< Master clock frequency supplied to camera from GoForce chip, used only if #GFVX_VIP_ASK_FOR_MCLOCK set. */ NvU32 VClockFreq; /**< Clock frequency required for VIP input signal. */ // Fill The following fields if GFVX_VIP_INTERNAL_VHSYNC is set in Flag NvU32 VHPulseWidth; /**< VHSYNC pulse width in number of VCLK cycles, valid range is 1 to 8. Used only if #GFVX_VIP_INTERNAL_VHSYNC is set. */ NvU32 VHPulsePeriod;/**< VHSYNC pulse period in number of VCLK cycles, valid range 32 to 2048. Used only if #GFVX_VIP_INTERNAL_VHSYNC is set. */ NvU32 VVPulseWidth; /**< VVSYNC pulse width in number of VCLK cycles valid range is 1 to 8. Used only if #GFVX_VIP_INTERNAL_VHSYNC is set. */ NvU32 VVPulsePeriod;/**< VVSYNC pulse period in number of VCLK valid range 32 to 1024. Used only if #GFVX_VIP_INTERNAL_VHSYNC is set. */ NvU32 VVDelay; /**< Number of VCLK cycles from the leading edge of VHSYNC to the leading edge of VVSYNC, valid range is -2 to 13. Used only if #GFVX_VIP_INTERNAL_VHSYNC is set. */ PGFVXBAYERINFO pBayerInfo; /**< 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. */ PGFVXCSISET pCSIInfo; /** Structure used to describe CSI stream info. Only used when input source is CSI stream */ } GFVXVIPINFO, *PGFVXVIPINFO; /** VxAPI GFVXVIPUPDATE::UpdateOption action: Start VIP data feeding. @see GFVXVIPUPDATE, GFVxVIPUpdate() */ #define GFVX_VIP_START 0x00000001 /** VxAPI GFVXVIPUPDATE::UpdateOption action: Stop VIP data feeding. @see GFVXVIPUPDATE, GFVxVIPUpdate() */ #define GFVX_VIP_STOP 0x00000002 /** VxAPI GFVXVIPUPDATE::UpdateOption action: Start VIP data feeding with synchronized auto-display surface after a frame is captured from VIP. If no output surface is set (GFVXVIPUPDATE::ppSurf is NULL), this action behaves in the same way as #GFVX_VIP_START. @see GFVXVIPUPDATE, GFVxVIPUpdate() */ #define GFVX_VIP_AUTO_FLIP (0x00000004 | GFVX_VIP_START) /** VxAPI GFVXVIPUPDATE::UpdateOption action: Start VIP data feeding with synchronized auto-blit from VIP output surface to another surface. Parameters for the blit have to be set up separately via GFVxBlt() with flag #GFVX_AUTO_BLT. Auto-blit is triggered after a complete frame has been captured from VIP. If no output surface is set (GFVXVIPUPDATE::ppSurf is NULL), this action behaves in the same way as #GFVX_VIP_START. Once auto-blit has been enabled it can be disabled with GFVxVIPUpdate() action identifier #GFVX_VIP_AUTO_TRIGER_BLT_OFF. @see GFVXVIPUPDATE, GFVxVIPUpdate(), #GFVX_VIP_AUTO_TRIGER_BLT_OFF, #GFVX_AUTO_BLT */ #define GFVX_VIP_AUTO_TRIGER_BLT (0x00000008 | GFVX_VIP_START) /** VxAPI GFVXVIPUPDATE::UpdateOption action: Stop auto-blit that has been enabled earlier via #GFVX_VIP_AUTO_TRIGER_BLT. Note that this action only disables auto-blit. It does not disable the VIP data feed. If also VIP is to be disabled, GFVxVIPUpdate() has to be called again with action #GFVX_VIP_STOP. @see GFVXVIPUPDATE, GFVxVIPUpdate() */ #define GFVX_VIP_AUTO_TRIGER_BLT_OFF 0x00000010 /** VxAPI GFVXVIPUPDATE::UpdateOption action: Start VIP data feeding with synchronized auto-display surface after a frame is captured from VIP. Second Overlay Window is used instead of first. If no output surface is set (GFVXVIPUPDATE::ppSurf is NULL), this action behaves in the same way as #GFVX_VIP_START. @version SC15 and above only @see GFVXVIPUPDATE, GFVxVIPUpdate() */ #define GFVX_VIP_AUTO_FLIP_OVERLAY2 (0x00000020 | GFVX_VIP_START) /** VxAPI GFVXVIPUPDATE::UpdateOption action: Capture one frame in VIP buffer if it is combined with flag #GFVX_VIP_START @version SC15 and above only @see GFVXVIPUPDATE, GFVxVIPUpdate() */ #define GFVX_VIP_CAPTURE_ONE_FRAME 0x00000040 /** VxAPI GFVXVIPUPDATE::UpdateOption action: Restart VIP without changes VI state after stop VI @version SC15 and above only @see GFVXVIPUPDATE, GFVxVIPUpdate() */ #define GFVX_VIP_RESTART 0x00000080 /** Parameter structure for GFVxVIPUpdate(). @see GFVxVIPUpdate() */ typedef struct _GFVXVIPUPDATE { PGFRMSURFACE *ppSurf; /**< Pointer to an array of VIP output surfaces pointers, or NULL to feed to MPEG/JPEG without display. */ NvU32 numofSurf; /**< Number of surface pointers in \a ppSurf, valid range is 1 to 2. */ NvU16 XStart; /**< Destination surface X position for the output from VIP */ NvU16 YStart; /**< Destination surface Y position for the output from VIP */ NvU32 UpdateOption; /**< Action identifier, one of:
#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
*/ } GFVXVIPUPDATE, *PGFVXVIPUPDATE; /** VxAPI VxBlt operation modes. Constants to specify SB mode for a call to GFVxBltSetCSCCoeff(). @see GFVxBltSetCSCCoeff(), GFVxBltGetCSCCoeff() */ typedef enum { /** Host full frame stretchblt trigger */ GFVX_BLT_FULL_MODE, /** Host partial frame stretchblt trigger */ GFVX_BLT_PARTIAL_MODE, /** Auto stretchblt trigger from VI */ GFVX_BLT_AUTO_VI_MODE } GFVXBLTMODE; /** VxAPI component level interrupt operation types. Constants to specify operation for a call to GFVxInterruptControl(). @see GFVX_INTERRUPT_TYPE, GFVxInterruptControl() */ typedef enum { /** Enable interrupt/status assertion for an interrupt type. */ GFVX_INTERRUPT_ENABLE, /** Disable interrupt/status assertion for an interrupt type. */ GFVX_INTERRUPT_DISABLE, /** Clear interrupt/status assertion for an interrupt type. */ GFVX_INTERRUPT_CLEAR, /** Query for interrupt/status assertion for an interrupt type. */ GFVX_INTERRUPT_QUERY_STATUS, /** Set Y-FIFO threshold. */ GFVX_INTERRUPT_SET_Y_FIFO_THRESHOLD, /** Get Y-FIFO threshold. */ GFVX_INTERRUPT_GET_Y_FIFO_THRESHOLD, /** Set V-counter threshold. */ GFVX_INTERRUPT_SET_V_COUNTER_THRESHOLD, /** Get V-counter threshold. */ GFVX_INTERRUPT_GET_V_COUNTER_THRESHOLD, /** Get all bits of VI interrupt status register. */ GFVX_INTERRUPT_GET_ALL_STATUS, /** Clear all VI interrupt status bits. */ GFVX_INTERRUPT_CLEAR_ON_ALL_STATUS } GFVX_INTERRUPT_OPERATION_TYPE; /** VxAPI interrupt types. @see GFVX_INTERRUPT_OPERATION_TYPE, GFVxInterruptControl() */ typedef enum { /** VID[8] pin rising edge interrupt. */ GFVX_VD8PIN_RISING_EDGE_INTR = 0x0100001, /** VID[9] pin rising edge interrupt. */ GFVX_VD9PIN_RISING_EDGE_INTR = 0x0100002, /** VID[10] pin rising edge interrupt. */ GFVX_VD10PIN_RISING_EDGE_INTR = 0x0100004, /** VID[11] pin rising edge interrupt. */ GFVX_VD11PIN_RISING_EDGE_INTR = 0x0100008, /** VGP[4] pin rising edge interrupt. */ GFVX_VGP4PIN_RISING_EDGE_INTR = 0x0100010, /** VGP[5] pin rising edge interrupt. */ GFVX_VGP5PIN_RISING_EDGE_INTR = 0x0100020, /** VGP[6] pin rising edge interrupt. */ GFVX_VGP6PIN_RISING_EDGE_INTR = 0x0100040, /** VHSYNC pin rising edge interrupt. */ GFVX_VHSYNC_RISING_EDGE_INTR = 0x0100080, /** VVSYNC pin rising edge interrupt. */ GFVX_VVSYNC_RISING_EDGE_INTR = 0x0100100, /** Vertical counter threshold interrupt. */ GFVX_VERTICAL_COUNTER_THRESHOLD_INTR = 0x0000200, /** Y-FIFO threshold int. */ GFVX_Y_FIFO_THRESHOLD_INTR = 0x0000400, /** Buffer done first output interrupt. */ GFVX_BUFFER_FIRST_OUTPUT_INTR = 0x0000800, /** Frame done first output interr upt. */ GFVX_FRAME_FIRST_OUTPUT_INTR = 0x0001000, /** Buffer done second output interrupt. */ GFVX_BUFFER_SECOND_OUTPUT_INTR = 0x0002000, /** Frame done second output interrupt. */ GFVX_FRAME_SECOND_OUTPUT_INTR = 0x0004000, /** VI to EPP error interrupt. */ GFVX_EPP_ERROR_INTR = 0x0008000, /** YUV420PA error interrupt. */ GFVX_YUV420PA_ERROR_INTR = 0x0010000, /** First output peer stall interrupt. */ GFVX_FIRST_OUTPUT_PEER_STALL_INTR = 0x0020000, /** Second output peer stall interrupt. */ GFVX_SECOND_OUTPUT_PEER_STALL_INTR = 0x0040000, /** DMA stall interrupt. */ GFVX_DMA_STALL_INTR = 0x0080000, /** VD[8] pin falling edge interrupt. */ GFVX_VD8PIN_FALLING_EDGE_INTR = 0x0000001, /** VD[9] pin falling edge interrupt. */ GFVX_VD9PIN_FALLING_EDGE_INTR = 0x0000002, /** VD[10] pin falling edge interrupt. */ GFVX_VD10PIN_FALLING_EDGE_INTR = 0x0000004, /** VD[11] pin falling edge interrupt. */ GFVX_VD11PIN_FALLING_EDGE_INTR = 0x0000008, /** VGP[4] pin falling edge interrupt. */ GFVX_VGP4PIN_FALLING_EDGE_INTR = 0x0000010, /** VGP[5] pin falling edge interrupt. */ GFVX_VGP5PIN_FALLING_EDGE_INTR = 0x0000020, /** VGP[6] pin falling edge interrupt. */ GFVX_VGP6PIN_FALLING_EDGE_INTR = 0x0000040, /** VHSYNC pin falling edge interrupt. */ GFVX_VHSYNC_FALLING_EDGE_INTR = 0x0000080, /** VVSYNC pin falling edge interrupt. */ GFVX_VVSYNC_FALLING_EDGE_INTR = 0x0000100, /** VD[8] pin rising edge interrupt. */ GFVX_VD8PIN_RISING_LEVEL_INTR = 0x1100001, /** VD[9] pin rising edge interrupt. */ GFVX_VD9PIN_RISING_LEVEL_INTR = 0x1100002, /** VD[10] pin rising edge interrupt. */ GFVX_VD10PIN_RISING_LEVEL_INTR = 0x1100004, /** VD[11] pin rising edge interrupt. */ GFVX_VD11PIN_RISING_LEVEL_INTR = 0x1100008, /** VGP[4] pin rising edge interrupt. */ GFVX_VGP4PIN_RISING_LEVEL_INTR = 0x1100010, /** VGP[5] pin rising edge interrupt. */ GFVX_VGP5PIN_RISING_LEVEL_INTR = 0x1100020, /** VGP[6] pin rising edge interrupt. */ GFVX_VGP6PIN_RISING_LEVEL_INTR = 0x1100040, /** VHSYNC pin rising edge interrupt. */ GFVX_VHSYNC_RISING_LEVEL_INTR = 0x1100080, /** VVSYNC pin rising edge interrupt. */ GFVX_VVSYNC_RISING_LEVEL_INTR = 0x1100100, /** VD[8] pin falling level interrupt. */ GFVX_VD8PIN_FALLING_LEVEL_INTR = 0x1000001, /** VD[9] pin falling level interrupt. */ GFVX_VD9PIN_FALLING_LEVEL_INTR = 0x1000002, /** VD[10] pin falling level interrupt. */ GFVX_VD10PIN_FALLING_LEVEL_INTR = 0x1000004, /** VD[11] pin falling level interrupt. */ GFVX_VD11PIN_FALLING_LEVEL_INTR = 0x1000008, /** VGP[4] pin falling level interrupt. */ GFVX_VGP4PIN_FALLING_LEVEL_INTR = 0x1000010, /** VGP[5] pin falling level interrupt. */ GFVX_VGP5PIN_FALLING_LEVEL_INTR = 0x1000020, /** VGP[6] pin falling level interrupt. */ GFVX_VGP6PIN_FALLING_LEVEL_INTR = 0x1000040, /** VHSYNC pin falling level interrupt. */ GFVX_VHSYNC_FALLING_LEVEL_INTR = 0x1000080, /** VVSYNC pin falling level interrupt. */ GFVX_VVSYNC_FALLING_LEVEL_INTR = 0x1000100 } GFVX_INTERRUPT_TYPE; /** VxAPI related attributes. @see GFVxGetAttribute() */ typedef enum _GFVXATTRIBUTES { /** VxAPI attribute: Video input interrupt status. Use this attribute with GFVxGetAttribute() to read the current video input interrupt status. Interpretation of associated attribute value:
        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_CSCColor space conversion supported
#GFVX_CAP_VIPVIP functions available
#GFVX_CAP_ENLARGEEnlarge source image supported
#GFVX_CAP_SHRINKShrink source image supported
#GFVX_CAP_COLOR_CONTROLColor control supported
#GFVX_CAP_OVERLAYOverlay supported
#GFVX_CAP_MPEGDECMPEG4 decoder supported
#GFVX_CAP_MPEGENCMPEG4 encoder supported
#GFVX_CAP_JPEGDECJPEG decoder supported
#GFVX_CAP_JPEGENCJPEG encoder supported
#GFVX_CAP_ALPHA_BLENDAlpha blending supported
#GFVX_CAP_EXTEND_RGB Extended RGB format 32 bpp supported
#GFVX_CAP_OVERLAY_YUVYUV overlay supported
#GFVX_CAP_OVERLAY_SCALEOverlay with scaling supported
#GFVX_CAP_OVERLAY_MULTIPLEMultiple overlay supported
#GFVX_CAP_ENCODE_TYPE Variable sized data camera interface (Type A/B/C) supported
It is a good practice to call this function to query for the API version and its capabilities before using the rest of the JxDecAPI functions. @see GFPROPERTY */ GF_RETTYPE GFVxGetProperty(GFVxHandle VxHandle, PGFPROPERTY pVvProp); /** Stretch-blit rectangular area from source to destination surface. @param VxHandle (#GFVxHandle) Handle to VxAPI @param pBlt (#PGFVXBLT) Pointer to #GFVXBLT structure @retval #GF_SUCCESS Success @retval #GF_ERROR Some error occured This function copies a rectangular area from a source surface to a rectangle in the destination surface. If source and destination rectangles differ in size, the GPU's stretch blit (SB) unit scales the source data to fit the destination rectangle. If the source and destination surfaces have different color formats, GFVxBlt() provides limited color format conversions. Source and Destination surfaces have to be in GPU memory. Source surfaces can be in YUV420, YUV422, or RGB565 format. Destination surfaces can be in RGB565, RGB888 (SC12), or ARGB8888 (SC12 SC15) format. YUV output can also be routed to EPP for encoding. Color format conversions from a YUV420 or YUV422 source are supported for these destination formats: - RGB565 - ARGB8888 (SC12 SC15) - RGB888 (SC12) A #GFVXBLT control structure is passed with parameter \a pBlt. GFVXBLT::ppDestSurf points to an array of destination surface pointers, with the number of pointers in this array specified by GFVXBLT::numofDestSurf. GFVXBLT::ppSrcSurf points to an array of source surface pointers, with the size of this array specified by GFVXBLT::numofSrcSurf. When the destination surface pointer is NULL, output of SB goes to EPP for encoding. See #GFVXBLT for minimum and maximum specifications of source and destination rectangle sizes. Instant Blit Mode In this mode of operation, the blit is executed immediately via the command FIFO. It is always performed from the first surface in GFVXBLT::ppSrcSurf to the first surface in GFVXBLT::ppDestSurf. Other pointers in these arrays are ignored. Auto Blit Mode VxBlt() can be used to enable auto-blit mode (flag #GFVX_AUTO_BLT in GFVXBLT::BltOption). Whenever the end of a frame coming from VIP is reached, SB will be fired automatically with the parameters set in GFVXBLT. Auto-blit mode remains set until it is reset by another auto-blit command. During auto-blit mode, manual SB commands should save and restore SB registers (SC12 and below). This is not required for SC15 and above because they have three hardware contexts: one for auto-blit, one for host trigger (manual SB commands) and one for host partial trigger. The first time auto-blit is fired, the first surface in GFVXBLT::ppSrcSurf is copied to the first surface in GFVXBLT::ppDestSurf. In subsequent blits, the source and destination arrays are walked through subsequently. If there is only one surface in the GFVXBLT::ppSrcSurf or GFVXBLT::ppDestSurf arrays, only this one is used. Note that VxBlt() only sets auto-blit parameters. It is actually enabled by GFVxVIPUpdate() using action #GFVX_VIP_AUTO_TRIGER_BLT, or GFMxDecSetMBs(). Auto Display If auto-display (#GFVX_AUTO_DISPLAY or #GFVX_AUTO_DISPLAY_OVERLAY2) is on, GFVxBlt() automatically shows the destination surface on the screen. The application does not need to call GFVxFlip() to show the surface. Auto-display can be combined with both auto-blit and instant-blit modes. Color Keying If source color keying (#GFVX_BLT_SRC_KEY) is set, all pixels from the source surface matching GFVXBLT::colorKey are transparent (not copied). VSync Synchronisation By default all blits are synchronized to display VSync. Note that blits may block, if the display is disabled. Flag #GFVX_BLT_DISABLE_WAIT_VSYNC can be used to disable VSync synchronisation. @see GFVXBLT */ GF_RETTYPE GFVxBlt(GFVxHandle VxHandle, PGFVXBLT pBlt); /** Activate surface for display. @param VxHandle (#GFVxHandle) Handle to VxAPI @param pFlip (#PGFVXFLIP) Pointer to #GFVXFLIP structure @retval #GF_SUCCESS Success @retval GFVX_ERROR_COLORFORMAT_NOT_SUPPORTED If ColorFormat is unsupported This function changes the display buffer address from one surface to another. This function displays #GFVXFLIP::pForeGroundSurf. If GFVXFLIP::pForeGroundSurf is an overlay surface, this function displays that surface to the destination rectangle that has been set by GFVxUpdateOverlay(). If GFVXFLIP::pForeGroundSurf is not an overlay surface, this function displays the entire surface. In this case GFVxFlip() can show either the primary surface or an offscreen surface on the display screen. If there is only one surface for primary or overlay, GFVxFlip() should not be called. @see GFVXFLIP */ GF_RETTYPE GFVxFlip(GFVxHandle VxHandle, PGFVXFLIP pFlip); /** Configure properties of overlay (WinB) display. @param VxHandle (#GFVxHandle) Handle to VxAPI @param pOverlay (#PGFVXUPDATEOVERLAY) Pointer to #GFVXUPDATEOVERLAY structure @retval #GF_SUCCESS Success @retval GFVX_ERROR_SURFACETYPE_NOT_SUPPORTED If Source SurfaceType is unsupported @retval GFVX_ERROR_COLORFORMAT_NOT_SUPPORTED If Source ColorFormat is unsupported @retval GFVX_ERROR_ILLEGAL_ALPHA_VALUE If Alpha Value is incorrect This function controls overlay (WinB) display, setting the following features: - Destination and source rectangle areas - Rotation for overlay surface - Color keying - Alphablending Color Key (GoForce 4800 and above) - Foreground and Background alpha values. (GoForce 4800 and above) - Destination surface color format (RGB888, ARGB8888 for GoForce 4800 and above) SC15 supports the following overlay surface orientations - 0 degree rotated, 180 degree rotated, horizont flip, vertical flip. Overlay surface orientation is always relative to the orientaton of primary surface. For eg. if primary surface is 180 degree rotated and requested overlay surface orientation is 0 degree rotated, then overlay surface will be 180 degree rotated. This function supports the following source surface type - GF_SURFACE_OVERLAY. It supports the following source surface colorformats - RGB565, ARGB8888, ARGB1555, ARGB4444. In order to work around a hardware bug in SC12, in which the GC displays pixels at the end of the line that are 64 pixels back from the end of the line, the overlay window width will be aligned to 4-pixels. If GFVXUPDATEOVERLAY::pSrcSurf is NULL then overlay display is disabled. This function will have no effect, if the GoForce media processor version does not support overlays. This can be checked via the #GFVX_CAP_OVERLAY attribute with GFVxGetProperty(). Color Keying With color keying pixels from the overlay surface can be masked (made transparent). It can be enabled in different modes of operation by setting one of the following flags in GFVXUPDATEOVERLAY::UpdateOption: - #GFVX_UO_SRC_COLOR_KEY - #GFVX_UO_DEST_COLOR_KEY The color key is passed in GFVXUPDATEOVERLAY::ColorKey. Refer to the flags' documentation for details on modes of operation. An exotic color which does not conflict with other colors of a use-case should be selected as the color key. Color keying for overlay display is processed on the fly, no pixels in the surfaces are overwritten. If destination is in 1-bit alpha format (eg ARGB1555), application can use two additional flags - #GFVX_UO_COLOR_KEY_ALPHA_ONLY and #GFVX_UO_COLOR_KEY_ALPHA_COLOR. Refer to the flags' documentation for details on modes of operation. Alpha Blending Overlay display with alpha blending can be enabled by setting flag #GFVX_UO_ALPHA_BLENDING. Setting flag #GFVX_UO_ALPHA_BLENDING lets the overlay surface to appear blended with the destination surface using the alpha value passed in GFVXUPDATEOVERLAY::AlphaValue. Refer to the flags' documentation for details on how to define AlphaVal. If destination is in 1-bit alpha format (eg ARGB1555), application can use two additional flags - #GFVX_UO_BLD_COLOR_KEY_ALPHA_ONLY and #GFVX_UO_BLD_COLOR_KEY_ALPHA_COLOR. Refer to the flags' documentation for details on modes of operation. Just like overlay colorkey, an exotic color which does not conflict with other colors of a use-case should be selected as the blending color key. Blending is processed on the fly, no pixels in the surfaces are overwritten. If #GFVX_UO_DEST_COLOR_KEY is set, alpha blending enabled, and the destination pixel color matches BlendingColorKey, the following equation is used to generate the final pixel:
    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.
This function returns GFVX_ERROR_COLORFORMAT_NOT_SUPPORTED error if destination surface color format is not supported. Supported destination color formats are - RGB565, ARGB8888, YUV422, YUV422P, YUV420P and YUV420PA. @see GFVXVIPUPDATE, GFVxVIPSetVIP() */ GF_RETTYPE GFVxVIPUpdate(GFVxHandle VxHandle, PGFVXVIPUPDATE pUpdate); /** Manipulate GPIO signals on VIP. @param VxHandle (#GFVxHandle) Handle to VxAPI @param gpio (#GFVX_VIP_GPIO_TYPE) Signal (pin) to manipulate @param operation (NvU32) Operation type, one of: Get output data.
#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
@param pGPIOStatus (#PGFGPIOSTATUS) Pointer to #GFGPIOSTATUS structure returning pin status @retval #GF_SUCCESS Success @retval #GF_ERROR Some error occured This function manipulates the GPIO signals on the video input port (VIP). The supported operations are clearing to 0, setting to 1, and getting the status of the input enable, output enable, and data bits. @see GFGPIOSTATUS, GFVX_VIP_GPIO_TYPE */ GF_RETTYPE GFVxVIPGPIO(GFVxHandle VxHandle, GFGPIOPin gpio, NvU32 operation, PGFGPIOSTATUS pGPIOStatus); /** VxAPI component-level interrupt control. @param VxHandle (#GFVxHandle) Handle to VxAPI @param IntType (#GFVX_INTERRUPT_TYPE) VxAPI interrupt type @param op (#GFVX_INTERRUPT_OPERATION_TYPE) VxAPI interrupt operation @param pData (void*) Pointer to input or output data block, depending on interrupt type and operation @retval #GF_SUCCESS Success @retval #GF_ERROR Some error occured @retval #GFVX_ERROR_NO_SUPPORT Operation not supported Interpretation of the datablock passed with \a pData depends on the interrupt operation. The following operations (parameter op) are defined for this call,
#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
        
@see GFVX_INTERRUPT_TYPE, GFVX_INTERRUPT_OPERATION_TYPE, GFVxInterruptHandler() */ GF_RETTYPE GFVxInterruptControl(GFVxHandle VxHandle, GFVX_INTERRUPT_TYPE IntType, GFVX_INTERRUPT_OPERATION_TYPE op, void * pData); /** Get information about a feature of the VxAPI. @param VxHandle (#GFVxHandle) Handle to VxAPI @param aid (NvU32) Attribute type identifier, see table. @param pAttr (NvU32*) Returns 32 bit attribute value, see attribute type documentation for interpretation @retval #GF_SUCCESS Success @retval #GF_ERROR Some error occured
\b Attribute \b Direction \b Synopsis
#GFVX_ATTR_VIDEO_BUF get Video input interrupt status
@see GFVxSetAttribute() */ GF_RETTYPE GFVxGetAttribute(GFVxHandle VxHandle, NvU32 aid, NvU32 *attr); /** Reset VI to a reset state. @param VxHandle (#GFVxHandle) Handle to VxAPI @retval #GF_SUCCESS Success @retval #GF_ERROR Some error occured */ GF_RETTYPE GFVxReset(GFVxHandle); /** This function waits until the next camera vsync has occurred. It is implemented with interrupt mode. Therefore, it assumes that interrupt platform has already supported or taken care, otherwise it will wait forever for interrupt event @param VxHandle (#GFVxHandle) Handle to VxAPI @retval #GF_SUCCESS Success @retval #GF_ERROR Some error occured */ GF_RETTYPE GFVxWaitCameraVSync(GFVxHandle); /** This function ensures synchronization between StretchBlt operations and others modules operations. @param VxHandle (#GFVxHandle) Handle to GFVxAPI @retval #GF_SUCCESS Success @retval #GF_ERROR Some error occured When several modules share the same channel (like SB,JxDec,MxDec), it may be necessary to synchronize the command flow with the StretchBlt (SB) module execution. Putting a GFVxBltNotBusy() call after a SB operation ensures that commands which follow the SB command are executed after full completion of the SB command. As opposed to GFVxBltWaitNotBusy(), this function doesn't block the CPU thread. stretchblt engine may not be idle when returning from the function. Control returns to the CPU right after a wait command is placed in the stretchblt engine command FIFO. The GoForce hardware begins executing the commands following the StretchBlt engine idle command only after the stretchblt engine becomes idle. @see GFVxBltWaitNotBusy() */ GF_RETTYPE GFVxBltNotBusy(GFVxHandle VxHandle); /** This function checks whether the stretchblt engine is busy or idle. @param VxHandle (#GFVxHandle) Handle to GFVxAPI @retval #GF_SUCCESS Success @retval #GF_ERROR Some error occured The function will wait until the stretchblt engine is idle. For example, if you want to stretchblt to the frame buffer but the stretchblt engine is busy the function can be used to wait until it is idle. As opposed to GFVxBltNotBusy(), this function blocks the CPU thread while waiting for the stretchblt engine to become idle. @see GFVxBltNotBusy() */ GF_RETTYPE GFVxBltWaitNotBusy(GFVxHandle VxHandle); /** This function sets the current state stretchblt color space converion (CSC) coefficients that will be programmed to GPU after calling GFVxBlt to do YUV color space conversion to RGB. How to use this routine: - GFVxBltGetCSCCoeff() to get default YUV CSC coefficients, save them - GFVxBltSetCSCCoeff() to change to new YUV CSC coefficients - GFVxBlt() to stretchblt image with your new YUV CSC coefficients to RGB, then done whatever - GFVxBltSetCSCCoeff() 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.
                
@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
*/ NvU32 Error; /**< Returns detailed error code on GFVxRawCaptureStart() failure
#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
*/ NvU32 colorFormat; } GFVXRAWINFO, *PGFVXRAWINFO; /** GFVXRAWINFO uiOptions: */ #define RAWCAPTURE_ATTR_RAW_DATA 0x00000010 #define RAWCAPTURE_ATTR_RAW_JPEG_CAPTURE 0x00000020 #define RAWCAPTURE_ATTR_RAW_DATA_STREAM 0x00000030 /** Raw data capture APIs */ GF_RETTYPE GFVxRawCaptureStart( GFVxHandle VxHandle, PGFVXRAWINFO pStart); GF_RETTYPE GFVxRawCaptureSetupInterrupt(GFVxHandle VxHandle, void (*Inter)(void *), void *IPara); GF_RETTYPE GFVxRawCapture (GFVxHandle VxHandle, PGFVX_BUF aBuf, NvU32 nBuf, NvU32 *pStatus ); GF_RETTYPE GFVxRawCaptureFetchImage (GFVxHandle pVx, PGFVX_BUF aBuf, NvU32 nBuf, NvU32 *pStatus ); GF_RETTYPE GFVxRawCaptureEnd( GFVxHandle pVx ); //uiFrameStatus; /** Raw Capture data fetch status code: All data of the current frame was fetched. @see GFVxRawCaptureFetchImage(), GFVxRawCapture() */ #define RAWCAPTURE_DATA_COMPLETE 0x1 /** Raw Capture data fetch status code: Data was fetched only partially. The application should make more calls to GFVxRawCaptureFetchImage() to fetch the rest. @see GFVxRawCaptureFetchImage(), GFVxRawCapture() */ #define RAWCAPTURE_MORE_FETCH 0x2 /** Raw Capture data fetch status code: New frame was captured and is ready to fetch. @see GFVxRawCaptureFetchImage(), GFVxRawCapture() */ #define RAWCAPTURE_NEW_FRAME 0x8 /** Raw Capture data fetch status code: Time out error occured while output data is fetching. fetch. @see GFVxRawCaptureFetchImage(), GFVxRawCapture() */ #define RAWCAPTURE_TIME_OUT 0x10 #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* __GFVX_H__ */