cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
phil@pswitchers.com
Participant
Participant
757 Views
Registered: ‎01-21-2019

VPSS Question about SetStream Routines

Jump to solution

There are three VPSS routines that I find conflicting. I am hopeful that someone can tell me the difference. Maybe this new information may help me better understand this video subsystem.

int XVprocSs_SetStreamResolution(XVidC_VideoStream *StreamPtr,
const XVidC_VideoMode VmId,
XVidC_VideoTiming const *Timing)

int XVprocSs_SetVidStreamIn(XVprocSs *InstancePtr,
const XVidC_VideoStream *StrmIn)

int XVprocSs_SetVidStreamOut(XVprocSs *InstancePtr,
const XVidC_VideoStream *StrmOut)

SetStreamResolution says it sets the video stream of the VPSS to a particular video format (VmID) and timing (Timing).

SetVidStreamIn and SetVidStreamOut basically say that they are defining the video stream resolution coming into the VPSS and leaving the VPSS.

This seems conflicting information.

Can someone explain how these routines are different?  The demo functions seem to be using both at the same time.

Thank you.

Phil

 

0 Kudos
1 Solution

Accepted Solutions
phil@pswitchers.com
Participant
Participant
703 Views
Registered: ‎01-21-2019

All,

Turns out the SetStreamResolution() simply writes resolution and timing information to the Video_Stream structure. It doesn't actually call any routines to update the VPSS. One uses the Video_Stream updated by SetStreamResolution() and use that information to set the stream on the input or output side of the VPSS. These calls are the beforementioned SetVidStreamIn() and SetVidStreamOut().

You should consider a different functioncalled XVidC_SetVideoStream(). It also sets the resolution and timing. Additionally, this routine allows you to set the colorspace, colordepth, and pixels per clock.

Here is an example how one might use these together:

CurVideoMode = XVidC_GetVideoModeId(1920,1080, XVIDC_FR_60HZ, interlaced_flag);
if (CurVideoMode == XVIDC_VM_NOT_SUPPORTED)
     print("\n\n*** ERROR: Resolution Not Supported!");
else
{
    TimingPtr = XVidC_GetTimingInfo(CurVideoMode);
// XVprocSs_SetStreamResolution(&vidStrmIn, CurVideoMode, TimingPtr);
    XVidC_SetVideoStream(&vidStrmIn,CurVideoMode,XVIDC_CSF_RGB,XVIDC_BPC_10,XVIDC_PPC_2);  // vidStrmIn gets updated by this routine.
    XVprocSs_SetVidStreamIn(&VprocInst0, &vidStrmIn);
}

 

View solution in original post

0 Kudos
4 Replies
nathanx
Moderator
Moderator
728 Views
Registered: ‎08-01-2007

Here are the difference.

 

vidStrmOut.VmId = XVIDC_VM_1920x1080_60_P;
vidStrmOut.ColorFormatId = XVIDC_CSF_RGB;
vidStrmOut.FrameRate = XVIDC_FR_60HZ;
vidStrmOut.IsInterlaced = FALSE;
vidStrmOut.ColorDepth = (XVidC_ColorDepth)XVprocSsPtr->Config.ColorDepth;
vidStrmOut.PixPerClk = (XVidC_PixelsPerClock)XVprocSsPtr->Config.PixPerClock;

TimingPtr = XVidC_GetTimingInfo(vidStrmOut.VmId);
vidStrmOut.Timing = *TimingPtr;

/* Setup Default Input Stream configuration */
vidStrmIn.VmId = XVIDC_VM_1920x1080_60_P;
vidStrmIn.ColorFormatId = XVIDC_CSF_RGB;
vidStrmIn.FrameRate = XVIDC_FR_60HZ;
vidStrmIn.IsInterlaced = FALSE;
vidStrmIn.ColorDepth = (XVidC_ColorDepth)XVprocSsPtr->Config.ColorDepth;
vidStrmIn.PixPerClk = (XVidC_PixelsPerClock)XVprocSsPtr->Config.PixPerClock;

TimingPtr = XVidC_GetTimingInfo(vidStrmIn.VmId);
vidStrmIn.Timing = *TimingPtr;

/* Setup Video Processing subsystem input/output configuration */
XVprocSs_SetVidStreamIn(XVprocSsPtr, &vidStrmIn);
XVprocSs_SetVidStreamOut(XVprocSsPtr, &vidStrmOut);

 

 

/*****************************************************************************/
/**
* This function sets the required subsystem video stream to the user provided
* stream and timing parameters
*
* @param StreamPtr is a pointer to the subsystem video stream to be configured
* @param VmId is the Video Mode ID of the new resolution to be set
* @param Timing is the timing parameters of the new resolution to be set

* @return XST_SUCCESS if successful else XST_FAILURE
******************************************************************************/
int XVprocSs_SetStreamResolution(XVidC_VideoStream *StreamPtr,
const XVidC_VideoMode VmId, XVidC_VideoTiming const *Timing)

0 Kudos
phil@pswitchers.com
Participant
Participant
715 Views
Registered: ‎01-21-2019

Nathan,

Thank you for your quick response.

So, is it correct to say that SetStreamResolution() is used to define a structure, Video_Stream, which is then used in a SetVidStreamIn() or SetVidStreamOut() call to define the input or output resolution timing of the VPSS modules?

Phil

 

0 Kudos
phil@pswitchers.com
Participant
Participant
704 Views
Registered: ‎01-21-2019

All,

Turns out the SetStreamResolution() simply writes resolution and timing information to the Video_Stream structure. It doesn't actually call any routines to update the VPSS. One uses the Video_Stream updated by SetStreamResolution() and use that information to set the stream on the input or output side of the VPSS. These calls are the beforementioned SetVidStreamIn() and SetVidStreamOut().

You should consider a different functioncalled XVidC_SetVideoStream(). It also sets the resolution and timing. Additionally, this routine allows you to set the colorspace, colordepth, and pixels per clock.

Here is an example how one might use these together:

CurVideoMode = XVidC_GetVideoModeId(1920,1080, XVIDC_FR_60HZ, interlaced_flag);
if (CurVideoMode == XVIDC_VM_NOT_SUPPORTED)
     print("\n\n*** ERROR: Resolution Not Supported!");
else
{
    TimingPtr = XVidC_GetTimingInfo(CurVideoMode);
// XVprocSs_SetStreamResolution(&vidStrmIn, CurVideoMode, TimingPtr);
    XVidC_SetVideoStream(&vidStrmIn,CurVideoMode,XVIDC_CSF_RGB,XVIDC_BPC_10,XVIDC_PPC_2);  // vidStrmIn gets updated by this routine.
    XVprocSs_SetVidStreamIn(&VprocInst0, &vidStrmIn);
}

 

View solution in original post

0 Kudos
florentw
Moderator
Moderator
664 Views
Registered: ‎11-09-2015

Hi phil@pswitchers.com ,

Thank you for sharing your findings.

Not all APIs for the VPSS are programing the VPSS. Some are only used to give a higher view. And you might not find all APIs usefull but some might find it useful (to give more literal sense to a code for example) this is why they are here.

If you have all you need, can you mark your previous reply as accepted solution to close the topic?

Thanks and Regards,


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos