Пример #1
0
int CPlayerSession::session_has_video (void)
{
  CPlayerMedia *p;
  p = m_my_media;
  while (p != NULL) {
    if (p->is_video() != FALSE) {
      return (1);
    }
    p = p->get_next();
  }
  return (0);
}
Пример #2
0
void CPlayerSession::syncronize_rtp_bytestreams (rtcp_sync_t *sync)
{
  if (sync != NULL) {
    m_audio_rtcp_sync = *sync;
    m_have_audio_rtcp_sync = true;
  } else {
    if (!m_have_audio_rtcp_sync) 
      return;
  }
  CPlayerMedia *mptr = m_my_media;
  while (mptr != NULL) {
    if (mptr->is_video()) {
      mptr->syncronize_rtp_bytestreams(&m_audio_rtcp_sync);
    }
    mptr = mptr->get_next();
  }
}
Пример #3
0
/*
 * set_up_sync_thread.  Creates the sync thread, and a sync class
 * for each media
 */
void CPlayerSession::set_up_sync_thread(void) 
{
  CPlayerMedia *media;

  media = m_my_media;
  while (media != NULL) {
    if (media->is_video()) {
      media->set_video_sync(set_up_video_sync());
    } else {
       media->set_audio_sync(set_up_audio_sync());
    }
    media= media->get_next();
  }
  m_sync_sem = SDL_CreateSemaphore(0);
#ifndef NEED_SDL_VIDEO_IN_MAIN_THREAD
  m_sync_thread = SDL_CreateThread(c_sync_thread, this);
#endif
}