video_common: Video_common_v4_3

| video_common Xilinx SDK Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
Video_common_v4_3

## Data Structures
struct | XVidC_VideoTiming
| Video timing structure. More...
struct | XVidC_3DSamplingInfo
| 3D Sampling info structure. More...
struct | XVidC_3DInfo
| 3D info structure. More...
struct | XVidC_VideoStream
| Video stream structure. More...
struct | XVidC_VideoWindow
| Video window structure. More...
struct | XVidC_VideoTimingMode
| Video timing mode from the video timing table. More...

## Macros
#define | XVidC_IsStream3D(VidStreamPtr) ((VidStreamPtr)->Is3D)
| This macro check if video stream is 3D or 2D. More...

## Typedefs
typedef void(* | XVidC_DelayHandler )(void *TimerPtr, u32 Delay)
| Callback type which represents a custom timer wait handler. More...

## Enumerations
enum | XVidC_VideoMode
| This typedef enumerates the list of available standard display monitor timings as specified in the xvidc_timings_table.c file. More...
enum | XVidC_VideoFormat
| Progressive/interlaced video format. More...
enum | XVidC_FrameRate
| Frame rate. More...
enum | XVidC_ColorDepth
| Color depth - bits per color component. More...
enum | XVidC_PixelsPerClock
| Pixels per clock. More...
enum | XVidC_ColorFormat
| Color space format. More...
enum | XVidC_AspectRatio
| Image Aspect Ratio. More...
enum | XVidC_ColorStd
| Color space conversion standard. More...
enum | XVidC_ColorRange
| Color conversion output range. More...
enum | XVidC_3DFormat { XVIDC_3D_FRAME_PACKING = 0, XVIDC_3D_FIELD_ALTERNATIVE, XVIDC_3D_LINE_ALTERNATIVE, XVIDC_3D_SIDE_BY_SIDE_FULL, XVIDC_3D_TOP_AND_BOTTOM_HALF, XVIDC_3D_SIDE_BY_SIDE_HALF }
| 3D formats. More...
enum | XVidC_3DSamplingMethod { XVIDC_3D_SAMPLING_HORIZONTAL = 0, XVIDC_3D_SAMPLING_QUINCUNX }
| 3D Sub-sampling methods. More...
enum | XVidC_3DSamplingPosition { XVIDC_3D_SAMPPOS_OLOR = 0, XVIDC_3D_SAMPPOS_OLER, XVIDC_3D_SAMPPOS_ELOR, XVIDC_3D_SAMPPOS_ELER }
| 3D Sub-sampling positions. More...

## Functions
u32 | XVidC_RegisterCustomTimingModes (const XVidC_VideoTimingMode *CustomTable, u16 NumElems)
| This function registers a user-defined custom video mode timing table with video_common. More...
void | XVidC_UnregisterCustomTimingModes (void)
| This function unregisters the user-defined custom video mode timing table previously registered by XVidC_RegisterCustomTimingModes(). More...
u64 | XVidC_GetPixelClockHzByHVFr (u32 HTotal, u32 VTotal, u8 FrameRate)
| This function calculates pixel clock based on the inputs. More...
u64 | XVidC_GetPixelClockHzByVmId (XVidC_VideoMode VmId)
| This function calculates pixel clock from video mode. More...
XVidC_VideoFormat | XVidC_GetVideoFormat (XVidC_VideoMode VmId)
| This function checks if the input video mode is interlaced/progressive based on its ID from the video timings table. More...
u8 | XVidC_IsInterlaced (XVidC_VideoMode VmId)
| This function checks if the input video mode is interlaced based on its ID from the video timings table. More...
XVidC_VideoMode | XVidC_GetVideoModeIdWBlanking (const XVidC_VideoTiming *Timing, u32 FrameRate, u8 IsInterlaced)
| This function returns the Video Mode ID that matches the detected input timing, frame rate and I/P flag. More...
XVidC_VideoMode | XVidC_GetVideoModeId (u32 Width, u32 Height, u32 FrameRate, u8 IsInterlaced)
| This function returns the Video Mode ID that matches the detected input width, height, frame rate and I/P flag. More...
XVidC_VideoMode | XVidC_GetVideoModeIdExtensive (XVidC_VideoTiming *Timing, u32 FrameRate, u8 IsInterlaced, u8 IsExtensive)
| This function returns the Video Mode ID that matches the detected input timing, frame rate and I/P flag. More...
XVidC_VideoMode | XVidC_GetVideoModeIdRb (u32 Width, u32 Height, u32 FrameRate, u8 IsInterlaced, u8 RbN)
| This function returns the video mode ID that matches the detected input width, height, frame rate, interlaced or progressive, and reduced blanking. More...
const XVidC_VideoTimingMode * | XVidC_GetVideoModeData (XVidC_VideoMode VmId)
| This function returns the pointer to video mode data at index provided. More...
const char * | XVidC_GetVideoModeStr (XVidC_VideoMode VmId)
| This function returns the resolution name for index specified. More...
const char * | XVidC_GetFrameRateStr (XVidC_VideoMode VmId)
| This function returns the frame rate name for index specified. More...
const char * | XVidC_Get3DFormatStr (XVidC_3DFormat Format)
| This function returns a string representation of the enumerated type, XVidC_3DFormat. More...
const char * | XVidC_GetColorFormatStr (XVidC_ColorFormat ColorFormatId)
| This function returns the color format name for index specified. More...
XVidC_FrameRate | XVidC_GetFrameRate (XVidC_VideoMode VmId)
| This function returns the frame rate for index specified. More...
const XVidC_VideoTiming * | XVidC_GetTimingInfo (XVidC_VideoMode VmId)
| This function returns the timing parameters for specified resolution. More...
u32 | XVidC_SetVideoStream (XVidC_VideoStream *VidStrmPtr, XVidC_VideoMode VmId, XVidC_ColorFormat ColorFormat, XVidC_ColorDepth Bpc, XVidC_PixelsPerClock Ppc)
| This function sets the VideoStream structure for the specified video format. More...
u32 | XVidC_Set3DVideoStream (XVidC_VideoStream *VidStrmPtr, XVidC_VideoMode VmId, XVidC_ColorFormat ColorFormat, XVidC_ColorDepth Bpc, XVidC_PixelsPerClock Ppc, XVidC_3DInfo *Info3DPtr)
| This function sets the VideoStream structure for the specified 3D video format. More...
void | XVidC_ReportStreamInfo (const XVidC_VideoStream *Stream)
| This function prints the stream information on STDIO/UART console. More...
void | XVidC_ReportTiming (const XVidC_VideoTiming *Timing, u8 IsInterlaced)
| This function prints timing information on STDIO/Uart console. More...

## Variables
const XVidC_VideoTimingMode | XVidC_VideoTimingModes [XVIDC_VM_NUM_SUPPORTED]
| This table contains the main stream attributes for various standard resolutions. More...

## Macro Definition Documentation

#define XVidC_IsStream3D | ( |  | VidStreamPtr | ) | ((VidStreamPtr)->Is3D)

This macro check if video stream is 3D or 2D.

Parameters

  VidStreamPtr | is a pointer to the XVidC_VideoStream structure.

Returns
  3D(1)/2D(0)

Note
  C-style signature: u8 XDp_IsStream3D(XVidC_VideoStream *VidStreamPtr)

## Typedef Documentation

typedef void(* XVidC_DelayHandler)(void *TimerPtr, u32 Delay)

Callback type which represents a custom timer wait handler.

This is only used for Microblaze since it doesn't have a native sleep function. To avoid dependency on a hardware timer, the default wait functionality is implemented using loop iterations; this isn't too accurate. Therefore a custom timer handler is used, the user may implement their own wait implementation.

Parameters

  TimerPtr | is a pointer to the timer instance.
  Delay | is the duration (msec/usec) to be passed to the timer function.

## Enumeration Type Documentation

enum XVidC_3DFormat

3D formats.

Enumerator
XVIDC_3D_FRAME_PACKING | Frame packing.
XVIDC_3D_FIELD_ALTERNATIVE | Field alternative.
XVIDC_3D_LINE_ALTERNATIVE | Line alternative.
XVIDC_3D_SIDE_BY_SIDE_FULL | Side-by-side (full).
XVIDC_3D_TOP_AND_BOTTOM_HALF | Top-and-bottom (half).
XVIDC_3D_SIDE_BY_SIDE_HALF | Side-by-side (half).

enum XVidC_3DSamplingMethod

3D Sub-sampling methods.

Enumerator
XVIDC_3D_SAMPLING_HORIZONTAL | Horizontal sub-sampling.
XVIDC_3D_SAMPLING_QUINCUNX | Quincunx matrix.

enum XVidC_3DSamplingPosition

3D Sub-sampling positions.

Enumerator
XVIDC_3D_SAMPPOS_OLOR | Odd/Left, Odd/Right.
XVIDC_3D_SAMPPOS_OLER | Odd/Left, Even/Right.
XVIDC_3D_SAMPPOS_ELOR | Even/Left, Odd/Right.
XVIDC_3D_SAMPPOS_ELER | Even/Left, Even/Right.

enum XVidC_AspectRatio

Image Aspect Ratio.

enum XVidC_ColorDepth

Color depth - bits per color component.

enum XVidC_ColorFormat

Color space format.

enum XVidC_ColorRange

Color conversion output range.

enum XVidC_ColorStd

Color space conversion standard.

enum XVidC_FrameRate

Frame rate.

enum XVidC_PixelsPerClock

Pixels per clock.

enum XVidC_VideoFormat

Progressive/interlaced video format.

enum XVidC_VideoMode

This typedef enumerates the list of available standard display monitor timings as specified in the xvidc_timings_table.c file.

The naming format is:

XVIDC_VM_<RESOLUTION>_<REFRESH RATE (HZ)>_<P|I>(_RB)

Where RB stands for reduced blanking.

## Function Documentation

const char * XVidC_Get3DFormatStr | ( | XVidC_3DFormat | Format | ) |

This function returns a string representation of the enumerated type, XVidC_3DFormat.

Parameters

  Format | specifies the value to convert.

Returns
  Pointer to the converted string.

Note
  None.

References XVIDC_3D_FIELD_ALTERNATIVE, XVIDC_3D_FRAME_PACKING, XVIDC_3D_LINE_ALTERNATIVE, XVIDC_3D_SIDE_BY_SIDE_FULL, XVIDC_3D_SIDE_BY_SIDE_HALF, and XVIDC_3D_TOP_AND_BOTTOM_HALF.

Referenced by XVidC_ReportStreamInfo().

const char * XVidC_GetColorFormatStr | ( | XVidC_ColorFormat | ColorFormatId | ) |

This function returns the color format name for index specified.

Parameters

  ColorFormatId | specifies the index of color format space.

Returns
  Pointer to a color space name string.

Note
  None.

Referenced by XVidC_ReportStreamInfo().

XVidC_FrameRate XVidC_GetFrameRate | ( | XVidC_VideoMode | VmId | ) |

This function returns the frame rate for index specified.

Parameters

  VmId | specifies the resolution id.

Returns
  Frame rate in Hz.

Note
  None.

References XVidC_GetVideoModeData().

Referenced by XVidC_SetVideoStream().

const char * XVidC_GetFrameRateStr | ( | XVidC_VideoMode | VmId | ) |

This function returns the frame rate name for index specified.

Parameters

  VmId | specifies the resolution id.

Returns
  Pointer to a frame rate name string.

Note
  None.

References XVidC_GetVideoModeData().

Referenced by XVidC_ReportStreamInfo().

u64 XVidC_GetPixelClockHzByHVFr | ( | u32 | HTotal,
|  | u32 | VTotal,
|  | u8 | FrameRate
| ) |  |

This function calculates pixel clock based on the inputs.

Parameters

  HTotal | specifies horizontal total.
  VTotal | specifies vertical total.
  FrameRate | specifies rate at which frames are generated.

Returns
  Pixel clock in Hz.

Note
  None.

Referenced by XVidC_ReportStreamInfo().

u64 XVidC_GetPixelClockHzByVmId | ( | XVidC_VideoMode | VmId | ) |

This function calculates pixel clock from video mode.

Parameters

  VmId | specifies the resolution id.

Returns
  Pixel clock in Hz.

Note
  None.

References XVidC_GetVideoModeData(), and XVidC_IsInterlaced().

Referenced by XVidC_ReportStreamInfo().

const XVidC_VideoTiming * XVidC_GetTimingInfo | ( | XVidC_VideoMode | VmId | ) |

This function returns the timing parameters for specified resolution.

Parameters

  VmId | specifies the resolution id.

Returns
  Pointer to a XVidC_VideoTiming structure.

Note
  None.

References XVidC_GetVideoModeData().

Referenced by XVidC_GetVideoModeIdWBlanking(), and XVidC_SetVideoStream().

XVidC_VideoFormat XVidC_GetVideoFormat | ( | XVidC_VideoMode | VmId | ) |

This function checks if the input video mode is interlaced/progressive based on its ID from the video timings table.

Parameters

  VmId | specifies the resolution ID from the video timings table.

Returns
  Video format.
  - XVIDC_VF_PROGRESSIVE
  - XVIDC_VF_INTERLACED

Note
  None.

References XVidC_GetVideoModeData().

Referenced by XVidC_IsInterlaced().

const XVidC_VideoTimingMode * XVidC_GetVideoModeData | ( | XVidC_VideoMode | VmId | ) |

This function returns the pointer to video mode data at index provided.

Parameters

  VmId | specifies the resolution id.

Returns
  Pointer to XVidC_VideoTimingMode structure based on the given video mode.

Note
  None.

Referenced by XVidC_GetFrameRate(), XVidC_GetFrameRateStr(), XVidC_GetPixelClockHzByVmId(), XVidC_GetTimingInfo(), XVidC_GetVideoFormat(), XVidC_GetVideoModeIdRb(), XVidC_GetVideoModeStr(), and XVidC_ReportStreamInfo().

XVidC_VideoMode XVidC_GetVideoModeId | ( | u32 | Width,
|  | u32 | Height,
|  | u32 | FrameRate,
|  | u8 | IsInterlaced
| ) |  |

This function returns the Video Mode ID that matches the detected input width, height, frame rate and I/P flag.

Parameters

  Width | specifies the number pixels per scanline.
  Height | specifies the number of scanline's.
  FrameRate | specifies refresh rate in HZ
  IsInterlaced | is flag. 0 = Progressive 1 = Interlaced.

Returns
  Id of a supported video mode.

Note
  None.

Referenced by XVidC_GetVideoModeIdRb(), and XVidC_GetVideoModeIdWBlanking().

XVidC_VideoMode XVidC_GetVideoModeIdExtensive | ( | XVidC_VideoTiming * | Timing,
|  | u32 | FrameRate,
|  | u8 | IsInterlaced,
|  | u8 | IsExtensive
| ) |  |

This function returns the Video Mode ID that matches the detected input timing, frame rate and I/P flag.

Parameters

  Timing | is the pointer to timing parameters to match
  FrameRate | specifies refresh rate in HZ
  IsInterlaced | is flag. 0 = Progressive 1 = Interlaced.
  IsExtensive | is flag. 0 = Basic matching of timing parameters 1 = Extensive matching of timing parameters

Returns
  Id of a supported video mode.

Note
  This function attempts to search for reduced blanking entries, if any.

XVidC_VideoMode XVidC_GetVideoModeIdRb | ( | u32 | Width,
|  | u32 | Height,
|  | u32 | FrameRate,
|  | u8 | IsInterlaced,
|  | u8 | RbN
| ) |  |

This function returns the video mode ID that matches the detected input width, height, frame rate, interlaced or progressive, and reduced blanking.

Parameters

  Width | specifies the number pixels per scanline.
  Height | specifies the number of scanline's.
  FrameRate | specifies refresh rate in HZ
  IsInterlaced | specifies interlaced or progressive mode: 0 = Progressive 1 = Interlaced.
  RbN | specifies the type of reduced blanking: 0 = No reduced blanking 1 = RB 2 = RB2

Returns
  ID of a supported video mode.

Note
  None.

References XVidC_GetVideoModeData(), XVidC_GetVideoModeId(), XVidC_GetVideoModeStr(), and XVidC_IsInterlaced().

XVidC_VideoMode XVidC_GetVideoModeIdWBlanking | ( | const XVidC_VideoTiming * | Timing,
|  | u32 | FrameRate,
|  | u8 | IsInterlaced
| ) |  |

This function returns the Video Mode ID that matches the detected input timing, frame rate and I/P flag.

Parameters

  Timing | is the pointer to timing parameters to match
  FrameRate | specifies refresh rate in HZ
  IsInterlaced | is flag. 0 = Progressive 1 = Interlaced.

Returns
  Id of a supported video mode.

Note
  This is an extension of XVidC_GetVideoModeId API to include blanking information in match process. No attempt is made to search for reduced blanking entries, if any.

References XVidC_GetTimingInfo(), and XVidC_GetVideoModeId().

const char * XVidC_GetVideoModeStr | ( | XVidC_VideoMode | VmId | ) |

This function returns the resolution name for index specified.

Parameters

  VmId | specifies the resolution id.

Returns
  Pointer to a resolution name string.

Note
  None.

References XVidC_GetVideoModeData().

Referenced by XVidC_GetVideoModeIdRb(), and XVidC_ReportStreamInfo().

u8 XVidC_IsInterlaced | ( | XVidC_VideoMode | VmId | ) |

This function checks if the input video mode is interlaced based on its ID from the video timings table.

Parameters

  VmId | specifies the resolution ID from the video timings table.

Returns
  - 1 if the video timing with the supplied table ID is interlaced.
  - 0 if the video timing is progressive.

Note
  None.

References XVidC_GetVideoFormat().

Referenced by XVidC_GetPixelClockHzByVmId(), XVidC_GetVideoModeIdRb(), and XVidC_SetVideoStream().

u32 XVidC_RegisterCustomTimingModes | ( | const XVidC_VideoTimingMode * | CustomTable,
|  | u16 | NumElems
| ) |  |

This function registers a user-defined custom video mode timing table with video_common.

Functions which search the available video modes, or take VmId as an input, will operate on or check the custom video mode timing table in addition to the pre-defined video mode timing table (XVidC_VideoTimingModes).

Parameters

  CustomTable | is a pointer to the user-defined custom vide mode timing table to register.
  NumElems | is the number of video modes supported by CustomTable.

Returns
  - XST_SUCCESS if the custom table was successfully registered.
  - XST_FAILURE if an existing custom table is already present.

Note
  IDs in the custom table may not conflict with IDs reserved by the XVidC_VideoMode enum.

void XVidC_ReportStreamInfo | ( | const XVidC_VideoStream * | Stream | ) |

This function prints the stream information on STDIO/UART console.

Parameters

  Stream | is a pointer to video stream.

Returns
  None.

Note
  None.

References XVidC_Get3DFormatStr(), XVidC_GetColorFormatStr(), XVidC_GetFrameRateStr(), XVidC_GetPixelClockHzByHVFr(), XVidC_GetPixelClockHzByVmId(), XVidC_GetVideoModeData(), and XVidC_GetVideoModeStr().

void XVidC_ReportTiming | ( | const XVidC_VideoTiming * | Timing,
|  | u8 | IsInterlaced
| ) |  |

This function prints timing information on STDIO/Uart console.

Parameters

  Timing | is a pointer to Video Timing structure of the stream.
  IsInterlaced | is a TRUE/FALSE flag that denotes the timing parameter is for interlaced/progressive stream.

Returns
  None.

Note
  None.

u32 XVidC_Set3DVideoStream | ( | XVidC_VideoStream * | VidStrmPtr,
|  | XVidC_VideoMode | VmId,
|  | XVidC_ColorFormat | ColorFormat,
|  | XVidC_ColorDepth | Bpc,
|  | XVidC_PixelsPerClock | Ppc,
|  | XVidC_3DInfo * | Info3DPtr
| ) |  |

This function sets the VideoStream structure for the specified 3D video format.

Parameters

  VidStrmPtr | is a pointer to the XVidC_VideoStream structure to be set.
  VmId | specifies the resolution ID.
  ColorFormat | specifies the color format type.
  Bpc | specifies the color depth/bits per color component.
  Ppc | specifies the pixels per clock.
  Info3DPtr | is a pointer to a XVidC_3DInfo structure.

Returns
  - XST_SUCCESS if the timing for the supplied ID was found.
  - XST_FAILURE, otherwise.
  - XST_SUCCESS
  - XST_FAILURE

Note
  None.

References XVIDC_3D_FRAME_PACKING, and XVidC_SetVideoStream().

u32 XVidC_SetVideoStream | ( | XVidC_VideoStream * | VidStrmPtr,
|  | XVidC_VideoMode | VmId,
|  | XVidC_ColorFormat | ColorFormat,
|  | XVidC_ColorDepth | Bpc,
|  | XVidC_PixelsPerClock | Ppc
| ) |  |

This function sets the VideoStream structure for the specified video format.

Parameters

  VidStrmPtr | is a pointer to the XVidC_VideoStream structure to be set.
  VmId | specifies the resolution ID.
  ColorFormat | specifies the color format type.
  Bpc | specifies the color depth/bits per color component.
  Ppc | specifies the pixels per clock.

Returns
  - XST_SUCCESS if the timing for the supplied ID was found.
  - XST_FAILURE, otherwise.

Note
  None.

References XVidC_GetFrameRate(), XVidC_GetTimingInfo(), and XVidC_IsInterlaced().

Referenced by XVidC_Set3DVideoStream().

void XVidC_UnregisterCustomTimingModes | ( | void |  | ) |

This function unregisters the user-defined custom video mode timing table previously registered by XVidC_RegisterCustomTimingModes().

Returns
  None.

Note
  None.

## Variable Documentation

const XVidC_VideoTimingMode XVidC_VideoTimingModes[XVIDC_VM_NUM_SUPPORTED]

This table contains the main stream attributes for various standard resolutions.

Each entry is of the format: 1) ID: XVIDC_VM_<HRES>x<VRES>_<FRAME RATE (HZ)>_<P|I>(RB = Reduced Blanking) 2) Resolution naming: "<HRES>x<VRES>@<FRAME RATE (HZ)>" 3) Frame rate: XVIDC_FR<FRAME RATE (HZ)> 4) Video timing structure: 1) Horizontal active resolution (pixels) 2) Horizontal front porch (pixels) 3) Horizontal sync width (pixels) 4) Horizontal back porch (pixels) 5) Horizontal total (pixels) 6) Horizontal sync polarity (0=negative|1=positive) 7) Vertical active resolution (lines) 8) Frame 0: Vertical front porch (lines) 9) Frame 0: Vertical sync width (lines) 10) Frame 0: Vertical back porch (lines) 11) Frame 0: Vertical total (lines) 12) Frame 1: Vertical front porch (lines) 13) Frame 1: Vertical sync width (lines) 14) Frame 1: Vertical back porch (lines) 15) Frame 1: Vertical total (lines) 16) Vertical sync polarity (0=negative|1=positive)

Referenced by Edid_PrintSuppVmTable().