avbuf: xavbuf.h File Reference

| avbuf Xilinx SDK Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List

Data Structures | Enumerations | Functions
xavbuf.h File Reference

## Overview

This file implements all the functions related to the Video Pipeline of the DisplayPort Subsystem.

Features supported by this driver

- Live Video and Graphics input.
- Non-Live Video Graphics input.
- Output Formats Supported - RGB, YUV444, YUV4222.

    MODIFICATION HISTORY:

    Ver   Who  Date     Changes

    1.0   aad  06/24/17 Initial release.
    2.0   aad  10/07/17 Added Enums for Video and Audio sources.

## Data Structures
struct | XAVBuf_VideoAttribute
| This typedef describes the attributes associated with the video formats. More...
struct | XAVBuf_AudioAttribute
| This typedef stores the attributes of an audio stream. More...
struct | XAVBuf_AVModes
| This typedef stores the data associated with the Audio Video input modes. More...
struct | XAVBuf_BlenderBgClr
| This structure stores the background color information. More...
struct | XAVBuf_Config
| This typedef stores the AVBuf Configuration information. More...
struct | XAVBuf_Blender
| This typedef stores all the attributes associated to the Blender block of the DisplayPort Subsystem. More...
struct | XAVBuf
| The XAVBuf driver instance data. More...

## Enumerations
enum | XAVBuf_VideoFormat
| This typedef describes all the Video Formats supported by the driver. More...
enum | XAVBuf_VideoModes
| This data structure describes video planes. More...
enum | XAVBuf_VideoStream
| This typedef describes the video source list. More...
enum | XAVBuf_GfxStream
| This typedef describes the graphics source list. More...
enum | XAVBuf_AudioStream1
| This typedef describes the audio stream 1 source list. More...
enum | XAVBuf_AudioStream2
| This typedef describes the audio stream 2 source list. More...

## Functions
void | XAVBuf_CfgInitialize (XAVBuf *InstancePtr, u32 BaseAddr, u16 DeviceId)
| This function intializes the configuration for the AVBuf Instance. More...
void | XAVBuf_InputVideoSelect (XAVBuf *InstancePtr, XAVBuf_VideoStream VidStream, XAVBuf_GfxStream GfxStream)
| This function selects the source for the Video and Graphics streams that are passed on to the blender block. More...
void | XAVBuf_InputAudioSelect (XAVBuf *InstancePtr, XAVBuf_AudioStream1 AudStream, XAVBuf_AudioStream2 AudioStream2)
| This function selects the source for audio streams corresponding to the Video and Graphics streams that are passed on to the blender. More...
int | XAVBuf_SetInputNonLiveVideoFormat (XAVBuf *InstancePtr, XAVBuf_VideoFormat Format)
| This function sets the video format for the non-live video. More...
int | XAVBuf_SetInputNonLiveGraphicsFormat (XAVBuf *InstancePtr, XAVBuf_VideoFormat Format)
| This function sets the graphics format for the non-live video. More...
int | XAVBuf_SetInputLiveVideoFormat (XAVBuf *InstancePtr, XAVBuf_VideoFormat Format)
| This function sets the video format for the live video. More...
int | XAVBuf_SetInputLiveGraphicsFormat (XAVBuf *InstancePtr, XAVBuf_VideoFormat Format)
| This function sets the graphics format for the live video. More...
int | XAVBuf_SetOutputVideoFormat (XAVBuf *InstancePtr, XAVBuf_VideoFormat Format)
| This function sets the Output Video Format. More...
XAVBuf_VideoAttribute * | XAVBuf_GetLiveVideoAttribute (XAVBuf_VideoFormat Format)
| This function looks up if the video format is valid or not for the non-live video datapath and returns a pointer to the attributes of the video. More...
XAVBuf_VideoAttribute * | XAVBuf_GetNLiveVideoAttribute (XAVBuf_VideoFormat Format)
| This function looks up if the video format is valid or not and returns a pointer to the attributes of the video. More...
XAVBuf_VideoAttribute * | XAVBuf_GetNLGraphicsAttribute (XAVBuf_VideoFormat Format)
| This function looks up if the video format is valid or not and returns a pointer to the attributes of the video. More...
void | XAVBuf_SetAudioVideoClkSrc (XAVBuf *InstancePtr, u8 VideoClk, u8 AudioClk)
| This function sets the Audio and Video Clock Source and the video timing source. More...
void | XAVBuf_ConfigureVideoPipeline (XAVBuf *InstancePtr)
| This function configures the Video Pipeline. More...
void | XAVBuf_ConfigureGraphicsPipeline (XAVBuf *InstancePtr)
| This function configures the Graphics Pipeline. More...
void | XAVBuf_BlendSetBgColor (XAVBuf *InstancePtr, XAVBuf_BlenderBgClr *Color)
| This function sets the blender background color. More...
void | XAVBuf_SetBlenderAlpha (XAVBuf *InstancePtr, u8 Alpha, u8 Enable)
| This function enables or disables global alpha. More...
void | XAVBuf_SoftReset (XAVBuf *InstancePtr)
| This function applies a soft reset to the Audio Video pipeline. More...
void | XABuf_LineResetDisable (XAVBuf *InstancePtr, u8 Disable)
| This function enables End of Line Reset for reduced blanking resolutions. More...
void | XAVBuf_ConfigureOutputVideo (XAVBuf *InstancePtr)
| This function configures the Output of the Video Pipeline. More...
void | XAVBuf_AudioSoftReset (XAVBuf *InstancePtr)
| This function resets the Audio Pipe. More...
void | XAVBuf_AudioMixerVolumeControl (XAVBuf *InstancePtr, u8 Channel0Volume, u8 Channel1Volume)
| This function sets up the scaling factor for Audio Mixer Volume Control. More...
void | XAVBuf_EnableGraphicsBuffers (XAVBuf *InstancePtr, u8 Enable)
| This function enables the graphics interface between the DPDMA and the AVBuf. More...
void | XAVBuf_EnableVideoBuffers (XAVBuf *InstancePtr, u8 Enable)
| This function enables the video channel interface between the DPDMA and the AVBuf. More...
void | XAVBuf_EnableAudio0Buffers (XAVBuf *InstancePtr, u8 Enable)
| This function enables the audio interface between the DPDMA and the AVBuf. More...
void | XAVBuf_EnableAudio1Buffers (XAVBuf *InstancePtr, u8 Enable)
| This function enables the audio interface between the DPDMA and the AVBuf. More...

## Enumeration Type Documentation

enum XAVBuf_AudioStream1

This typedef describes the audio stream 1 source list.

enum XAVBuf_AudioStream2

This typedef describes the audio stream 2 source list.

enum XAVBuf_GfxStream

This typedef describes the graphics source list.

enum XAVBuf_VideoFormat

This typedef describes all the Video Formats supported by the driver.

enum XAVBuf_VideoModes

This data structure describes video planes.

enum XAVBuf_VideoStream

This typedef describes the video source list.

## Function Documentation

void XABuf_LineResetDisable | ( | XAVBuf * | InstancePtr,
|  | u8 | Disable
| ) |  |

This function enables End of Line Reset for reduced blanking resolutions.

Parameters

  InstancePtr | is a pointer to the XAVBuf Instance.
  Disable | is to be set while using Reduced Blanking Resolutions.

Returns
  None.

Note
  None.

References XAVBUF_AUD_SOFT_RST, XAVBuf_ReadReg, and XAVBuf_WriteReg.

void XAVBuf_AudioMixerVolumeControl | ( | XAVBuf * | InstancePtr,
|  | u8 | Channel0Volume,
|  | u8 | Channel1Volume
| ) |  |

This function sets up the scaling factor for Audio Mixer Volume Control.

Parameters

  InstancePtr | is a pointer to the XAVBuf instance.
  Channel0Volume | is the volume to be set for Audio from Channel0
  Channel1Volume | is the volume to be set for Audio from Channel1

Returns
  None.

Note
  None.

References XAVBUF_AUD_MIXER_VOLUME_CONTROL, and XAVBuf_WriteReg.

void XAVBuf_AudioSoftReset | ( | XAVBuf * | InstancePtr | ) |

This function resets the Audio Pipe.

Parameters

  InstancePtr | is a pointer to the XAVBuf Instance.

Returns
  None.

Note
  Needed when non-live audio is disabled.

References XAVBUF_AUD_SOFT_RST, XAVBuf_ReadReg, and XAVBuf_WriteReg.

void XAVBuf_BlendSetBgColor | ( | XAVBuf * | InstancePtr,
|  | XAVBuf_BlenderBgClr * | Color
| ) |  |

This function sets the blender background color.

Parameters

  InstancePtr | is an pointer to the XAVBuf Instance.
  Color | is a pointer to the structure XAVBuf_BlenderBgClr

Returns
  None.

Note
  None.

References XAVBUF_V_BLEND_BG_CLR_0, XAVBUF_V_BLEND_BG_CLR_1, XAVBUF_V_BLEND_BG_CLR_2, and XAVBuf_WriteReg.

void XAVBuf_CfgInitialize | ( | XAVBuf * | InstancePtr,
|  | u32 | BaseAddr,
|  | u16 | DeviceId
| ) |  |

This function intializes the configuration for the AVBuf Instance.

Parameters

  InstancePtr | is a pointer to the XAVBuf instance.
  BaseAddr | sets the base address of the AVBuf instance
  DeviceId | is the id of the device from the design.

Returns
  None.

Note
  Base address and DeviceId is same as the DP Core driver.

void XAVBuf_ConfigureGraphicsPipeline | ( | XAVBuf * | InstancePtr | ) |

This function configures the Graphics Pipeline.

Parameters

  InstancePtr | is an pointer to the XAVBuf Instance.

Returns
  None.

Note
  None.

void XAVBuf_ConfigureOutputVideo | ( | XAVBuf * | InstancePtr | ) |

This function configures the Output of the Video Pipeline.

Parameters

  InstancePtr | is an pointer to the XAVBuf Instance.

Returns
  None.

Note
  None.

References XAVBUF_V_BLEND_OUTPUT_VID_FORMAT, and XAVBuf_WriteReg.

void XAVBuf_ConfigureVideoPipeline | ( | XAVBuf * | InstancePtr | ) |

This function configures the Video Pipeline.

Parameters

  InstancePtr | is an pointer to the XAVBuf Instance.

Returns
  None.

Note
  None.

void XAVBuf_EnableAudio0Buffers | ( | XAVBuf * | InstancePtr,
|  | u8 | Enable
| ) |  |

This function enables the audio interface between the DPDMA and the AVBuf.

Parameters

  InstancePtr | is a pointer to the XAVBuf Instance.
  Enable | sets the corresponding buffers.

Returns
  None.

Note
  None.

References XAVBUF_CHBUF4, and XAVBuf_WriteReg.

void XAVBuf_EnableAudio1Buffers | ( | XAVBuf * | InstancePtr,
|  | u8 | Enable
| ) |  |

This function enables the audio interface between the DPDMA and the AVBuf.

Parameters

  InstancePtr | is a pointer to the XAVBuf Instance.
  Enable | sets the corresponding buffers.

Returns
  None.

Note
  None.

References XAVBUF_CHBUF5, and XAVBuf_WriteReg.

void XAVBuf_EnableGraphicsBuffers | ( | XAVBuf * | InstancePtr,
|  | u8 | Enable
| ) |  |

This function enables the graphics interface between the DPDMA and the AVBuf.

Parameters

  InstancePtr | is a pointer to the XAVBuf Instance.
  Enable | sets the corresponding buffers.

Returns
  None.

Note
  None.

References XAVBUF_CHBUF3, and XAVBuf_WriteReg.

void XAVBuf_EnableVideoBuffers | ( | XAVBuf * | InstancePtr,
|  | u8 | Enable
| ) |  |

This function enables the video channel interface between the DPDMA and the AVBuf.

Parameters

  InstancePtr | is a pointer to the XAVBuf Instance.
  Enable | sets the corresponding buffers.

Returns
  None.

Note
  None.

References XAVBUF_CHBUF0, and XAVBuf_WriteReg.

XAVBuf_VideoAttribute* XAVBuf_GetLiveVideoAttribute | ( | XAVBuf_VideoFormat | Format | ) |

This function looks up if the video format is valid or not for the non-live video datapath and returns a pointer to the attributes of the video.

Parameters

  Format | takes in the video format for which attributes are being requested.

Returns
  A pointer to the structure XAVBuf_VideoAttribute if the video format is valid, else returns NULL.

Note
  None.

Referenced by XAVBuf_SetInputLiveGraphicsFormat(), XAVBuf_SetInputLiveVideoFormat(), and XAVBuf_SetOutputVideoFormat().

XAVBuf_VideoAttribute* XAVBuf_GetNLGraphicsAttribute | ( | XAVBuf_VideoFormat | Format | ) |

This function looks up if the video format is valid or not and returns a pointer to the attributes of the video.

Parameters

  Format | takes in the video format for which attributes are being requested.

Returns
  A pointer to the structure XAVBuf_VideoAttribute if the video format is valid, else returns NULL.

Note
  None.

Referenced by XAVBuf_SetInputNonLiveGraphicsFormat().

XAVBuf_VideoAttribute* XAVBuf_GetNLiveVideoAttribute | ( | XAVBuf_VideoFormat | Format | ) |

This function looks up if the video format is valid or not and returns a pointer to the attributes of the video.

Parameters

  Format | takes in the video format for which attributes are being requested.

Returns
  A pointer to the structure XAVBuf_VideoAttribute if the video format is valid, else returns NULL.

Note
  None.

Referenced by XAVBuf_SetInputNonLiveVideoFormat().

void XAVBuf_InputAudioSelect | ( | XAVBuf * | InstancePtr,
|  | XAVBuf_AudioStream1 | AudStream1,
|  | XAVBuf_AudioStream2 | AudStream2
| ) |  |

This function selects the source for audio streams corresponding to the Video and Graphics streams that are passed on to the blender.

Parameters

  InstancePtr | is a pointer to the XAVBuf instance.
  AudStream1 | selects the audio stream source corresponding to the video source selected
  AudStream2 | selects the audio stream source corresponding to the graphics source selected.

Returns
  None.

Note
  None.

References XAVBUF_BUF_OUTPUT_AUD_VID_SELECT, XAVBuf_ReadReg, and XAVBuf_WriteReg.

void XAVBuf_InputVideoSelect | ( | XAVBuf * | InstancePtr,
|  | XAVBuf_VideoStream | VidStream,
|  | XAVBuf_GfxStream | GfxStream
| ) |  |

This function selects the source for the Video and Graphics streams that are passed on to the blender block.

Parameters

  InstancePtr | is a pointer to the XAVBuf instance.
  VidStream | selects the stream coming from the video sources
  GfxStream | selects the stream coming from the graphics sources

Returns
  None.

Note
  None.

References XAVBUF_BUF_OUTPUT_AUD_VID_SELECT, XAVBuf_ReadReg, and XAVBuf_WriteReg.

void XAVBuf_SetAudioVideoClkSrc | ( | XAVBuf * | InstancePtr,
|  | u8 | VideoClk,
|  | u8 | AudioClk
| ) |  |

This function sets the Audio and Video Clock Source and the video timing source.

Parameters

  InstancePtr | is a pointer to the XAVBuf instance.
  VideoClk | selects the Video Clock Source
  AudioClk | selects the Audio Clock Source

Returns
  None.

Note
  System uses PL Clock for Video when Live source is in use.

References XAVBUF_BUF_AUD_VID_CLK_SOURCE, XAVBuf_SoftReset(), and XAVBuf_WriteReg.

void XAVBuf_SetBlenderAlpha | ( | XAVBuf * | InstancePtr,
|  | u8 | Alpha,
|  | u8 | Enable
| ) |  |

This function enables or disables global alpha.

Parameters

  InstancePtr | is an pointer to the XAVBuf Instance.
  Enable | sets a software flag for global alpha
  Alpha | sets the value for the global alpha blending

Returns
  None.

Note
  GlobalAlphaEn = 1, enables the global alpha. GlobalAlphaEn = 0, disables the global alpha. Alpha = 0, passes stream2 Alpha = 255, passes stream1

References XAVBUF_V_BLEND_SET_GLOBAL_ALPHA_REG, and XAVBuf_WriteReg.

int XAVBuf_SetInputLiveGraphicsFormat | ( | XAVBuf * | InstancePtr,
|  | XAVBuf_VideoFormat | Format
| ) |  |

This function sets the graphics format for the live video.

Parameters

  InstancePtr | is a pointer to the XAVBuf instance.
  Format | is the enum for the non-live video format

Returns
  XST_SUCCESS if the correct format has been set. XST_FAILURE if the format is invalid.

Note
  None.

References XAVBuf_GetLiveVideoAttribute().

int XAVBuf_SetInputLiveVideoFormat | ( | XAVBuf * | InstancePtr,
|  | XAVBuf_VideoFormat | Format
| ) |  |

This function sets the video format for the live video.

Parameters

  InstancePtr | is a pointer to the XAVBuf instance.
  Format | is the enum for the non-live video format

Returns
  XST_SUCCESS if the correct format has been set. XST_FAILURE if the format is invalid.

Note
  None.

References XAVBuf_GetLiveVideoAttribute().

int XAVBuf_SetInputNonLiveGraphicsFormat | ( | XAVBuf * | InstancePtr,
|  | XAVBuf_VideoFormat | Format
| ) |  |

This function sets the graphics format for the non-live video.

Parameters

  InstancePtr | is a pointer to the XAVBuf instance.
  Format | is the enum for the non-live video format

Returns
  XST_SUCCESS if the correct format has been set. XST_FAILURE if the format is invalid.

Note
  None.

References XAVBuf_GetNLGraphicsAttribute().

int XAVBuf_SetInputNonLiveVideoFormat | ( | XAVBuf * | InstancePtr,
|  | XAVBuf_VideoFormat | Format
| ) |  |

This function sets the video format for the non-live video.

Parameters

  InstancePtr | is a pointer to the XAVBuf instance.
  Format | is the enum for the non-live video format

Returns
  XST_SUCCESS if the correct format has been set. XST_FAILURE if the format is invalid.

Note
  None.

References XAVBuf_GetNLiveVideoAttribute().

int XAVBuf_SetOutputVideoFormat | ( | XAVBuf * | InstancePtr,
|  | XAVBuf_VideoFormat | Format
| ) |  |

This function sets the Output Video Format.

Parameters

  InstancePtr | is a pointer to the XAVBuf instance.
  Format | is the enum for the non-live video format

Returns
  XST_SUCCESS if the correct format has been set. XST_FAILURE if the format is invalid.

Note
  None.

References XAVBuf_GetLiveVideoAttribute().

void XAVBuf_SoftReset | ( | XAVBuf * | InstancePtr | ) |

This function applies a soft reset to the Audio Video pipeline.

Parameters

  InstancePtr | is a pointer to the XAVBuf instance.

Returns
  None.

Note
  None.

References XAVBUF_BUF_SRST_REG, and XAVBuf_WriteReg.

Referenced by XAVBuf_SetAudioVideoClkSrc().