Esempio n. 1
0
bool CVDPAU::FiniOutputMethod()
{
  VdpStatus vdp_st;

  if (vdp_flip_queue != VDP_INVALID_HANDLE)
  {
    vdp_st = vdp_presentation_queue_destroy(vdp_flip_queue);
    vdp_flip_queue = VDP_INVALID_HANDLE;
    CheckStatus(vdp_st, __LINE__);
  }

  if (vdp_flip_target != VDP_INVALID_HANDLE)
  {
    vdp_st = vdp_presentation_queue_target_destroy(vdp_flip_target);
    vdp_flip_target = VDP_INVALID_HANDLE;
    CheckStatus(vdp_st, __LINE__);
  }

  if (m_glPixmap)
  {
    CLog::Log(LOGDEBUG, "GLX: Destroying glPixmap");
    glXDestroyPixmap(m_Display, m_glPixmap);
    m_glPixmap = NULL;
  }

  if (m_Pixmap)
  {
    CLog::Log(LOGDEBUG, "GLX: Destroying XPixmap");
    XFreePixmap(m_Display, m_Pixmap);
    m_Pixmap = NULL;
  }

  outputSurface = presentSurface = VDP_INVALID_HANDLE;

  for (int i = 0; i < totalAvailableOutputSurfaces; i++)
  {
    if (outputSurfaces[i] == VDP_INVALID_HANDLE)
       continue;
    vdp_st = vdp_output_surface_destroy(outputSurfaces[i]);
    outputSurfaces[i] = VDP_INVALID_HANDLE;
    CheckStatus(vdp_st, __LINE__);
  }

  if (videoMixer != VDP_INVALID_HANDLE)
  {
    vdp_st = vdp_video_mixer_destroy(videoMixer);
    videoMixer = VDP_INVALID_HANDLE;
    if (CheckStatus(vdp_st, __LINE__));
  }

  while (!m_DVDVideoPics.empty())
    m_DVDVideoPics.pop();

  return true;
}
Esempio n. 2
0
VDPAUDecoder::~VDPAUDecoder()
{
    if (m_VDPMixer != VDP_INVALID_HANDLE) {
        vdp_video_mixer_destroy(m_VDPMixer);
    }
    if (m_VDPDecoder != VDP_INVALID_HANDLE) {
        vdp_decoder_destroy(m_VDPDecoder);
    }
    for (unsigned i = 0; i < m_RenderStates.size(); i++) {
        vdp_video_surface_destroy(m_RenderStates[i]->surface);
        delete m_RenderStates[i];
    }
}
Esempio n. 3
0
void CVDPAU::FiniVDPAUOutput()
{
  if (vdp_device == VDP_INVALID_HANDLE || !vdpauConfigured) return;

  CLog::Log(LOGNOTICE, " (VDPAU) %s", __FUNCTION__);

  VdpStatus vdp_st;

  vdp_st = vdp_decoder_destroy(decoder);
  CheckStatus(vdp_st, __LINE__);
  decoder = VDP_INVALID_HANDLE;

  vdp_st = vdp_presentation_queue_destroy(vdp_flip_queue);
  CheckStatus(vdp_st, __LINE__);
  vdp_flip_queue = VDP_INVALID_HANDLE;

  vdp_st = vdp_presentation_queue_target_destroy(vdp_flip_target);
  CheckStatus(vdp_st, __LINE__);
  vdp_flip_target = VDP_INVALID_HANDLE;

  outputSurface = presentSurface = VDP_INVALID_HANDLE;

  for (int i = 0; i < totalAvailableOutputSurfaces; i++)
  {
    vdp_st = vdp_output_surface_destroy(outputSurfaces[i]);
    CheckStatus(vdp_st, __LINE__);
    outputSurfaces[i] = VDP_INVALID_HANDLE;
  }

  vdp_st = vdp_video_mixer_destroy(videoMixer);
  CheckStatus(vdp_st, __LINE__);
  videoMixer = VDP_INVALID_HANDLE;

  for(unsigned int i = 0; i < m_videoSurfaces.size(); i++)
  {
    vdp_st = vdp_video_surface_destroy(m_videoSurfaces[i]->surface);
    CheckStatus(vdp_st, __LINE__);
    m_videoSurfaces[i]->surface = VDP_INVALID_HANDLE;
    free(m_videoSurfaces[i]);
  }
  m_videoSurfaces.clear();
  while (!m_DVDVideoPics.empty())
    m_DVDVideoPics.pop();
}