/* USBD_VIDEO_GetVSFrameDesc This function return the Video Endpoint descriptor.  */
static void * USBD_VIDEO_GetVSFrameDesc(uint8_t *pConfDesc)
/* USBD_VIDEO_GetVSFrameDesc This function return the Video Endpoint descriptor.  */
static void * USBD_VIDEO_GetVSFrameDesc(uint8_t *pConfDesc)
{
  USBD_VIDEO_DescHeader_t *pdesc = (USBD_VIDEO_DescHeader_t *)(void *)pConfDesc;
  USBD_ConfigDescTypedef *desc = (USBD_ConfigDescTypedef *)(void *)pConfDesc;
  USBD_VIDEO_VSFrameDescTypeDef *pVSFrameDesc = NULL;
  uint16_t ptr;
  if (desc->wTotalLength > desc->bLength)
  {
    ptr = desc->bLength;
    while (ptr < desc->wTotalLength)
    {
      pdesc = USBD_VIDEO_GetNextDesc((uint8_t *)pdesc, &ptr);
      if ((pdesc->bDescriptorSubType == VS_FRAME_MJPEG) ||
          (pdesc->bDescriptorSubType == VS_FRAME_UNCOMPRESSED))
      {
        pVSFrameDesc = (USBD_VIDEO_VSFrameDescTypeDef *)(void *)pdesc;
        break;
      }
    }
  }
  return (void *)pVSFrameDesc;
}