Example #1
0
NaoCamera::NaoCamera(const char* device, CameraInfo::Camera camera, int width, int height, bool flip,
                     const CameraSettings::CameraSettingsCollection& settings, const Matrix5uc& autoExposureWeightTable) :
  camera(camera),
  WIDTH(width),
  HEIGHT(height)
{
  VERIFY((fd = open(device, O_RDWR | O_NONBLOCK)) != -1);

  mapBuffers();
  queueBuffers();

  setImageFormat();
  setFrameRate(1, 30);

  checkSettingsAvailability();

  specialSettings.horizontalFlip.value = flip ? 1 : 0;
  setControlSetting(specialSettings.horizontalFlip);
  specialSettings.verticalFlip.value = flip ? 1 : 0;
  setControlSetting(specialSettings.verticalFlip);
  setSettings(settings, autoExposureWeightTable);
  writeCameraSettings();
  readCameraSettings();

  startCapturing();
}
Example #2
0
void StreamSoundSource::play()
{
    if(!m_soundFile) {
        g_logger.error("there is not sound file to play the stream");
        return;
    }

    queueBuffers();

    SoundSource::play();
}
Example #3
0
bool Stream::play()
{
   // We don't want to play this Stream twice, do we ?
   if (playing())
      return true;
   if (!streamBuf(buffers[0]))
      return false;
   if (!streamBuf(buffers[1]))
      return false;

   queueBuffers(2, buffers);
   playSource();

   return true;
}
Example #4
0
bool Stream::update()
{
   int processed = processedBuffers();

   bool active = true;
   while (processed--)
   {
      ALuint buffer;
      unqueueBuffers(1, &buffer);
      
      active = streamBuf(buffer);

      queueBuffers(1, &buffer);
   }
   return active;
}
void StreamSoundSource::play()
{
    m_playing = true;

    if(!m_soundFile) {
        m_waitingFile = true;
        return;
    }

    if(m_eof) {
        m_soundFile->reset();
        m_eof = false;
    }

    queueBuffers();

    SoundSource::play();
}
Example #6
0
void Stream::stop()
{
   queueBuffers(2, buffers);
   stopSource();
}
Example #7
0
void Stream::pause()
{
   queueBuffers(2, buffers);
   pauseSource();
}