/* USBD_VIDEO_GetEpDesc This function return the Video Endpoint descriptor.  */
static void * USBD_VIDEO_GetEpDesc(uint8_t *pConfDesc, uint8_t EpAddr)
/* USBD_VIDEO_GetEpDesc This function return the Video Endpoint descriptor.  */
static void * USBD_VIDEO_GetEpDesc(uint8_t *pConfDesc, uint8_t EpAddr)
{
  USBD_VIDEO_DescHeader_t *pdesc = (USBD_VIDEO_DescHeader_t *)(void *)pConfDesc;
  USBD_ConfigDescTypedef *desc = (USBD_ConfigDescTypedef *)(void *)pConfDesc;
  USBD_EpDescTypedef *pEpDesc = 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->bDescriptorType == USB_DESC_TYPE_ENDPOINT)
      {
        pEpDesc = (USBD_EpDescTypedef *)(void *)pdesc;
        if (pEpDesc->bEndpointAddress == EpAddr)
        {
          break;
        }
        else
        {
          pEpDesc = NULL;
        }
      }
    }
  }
  return (void *)pEpDesc;
}