|
|
|
|
@ -91,7 +91,8 @@ static void *thread_video(void *ignored_argument) {
|
|
|
|
|
currentimage.SetSize (config.web_width, config.web_height);
|
|
|
|
|
|
|
|
|
|
while (running) {
|
|
|
|
|
if (vdev->GetFrame(&inputimage, &inputfloat) == 0) {
|
|
|
|
|
// if (vdev->GetFrame(&inputimage, &inputfloat) == 0) {
|
|
|
|
|
if (vdev->GetFrame(&inputimage, NULL) == 0) {
|
|
|
|
|
vdev->Stop();
|
|
|
|
|
vdev->Start();
|
|
|
|
|
}
|
|
|
|
|
@ -104,6 +105,7 @@ static void *thread_video(void *ignored_argument) {
|
|
|
|
|
debug ("FPS: %f", framespersecond);
|
|
|
|
|
debug ("Brightness: %f", current_brightness);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Lock();
|
|
|
|
|
current_brightness = 0.0f;
|
|
|
|
|
inputimage.CopyTo(¤timage, config.web_width, config.web_height, ¤t_brightness);
|
|
|
|
|
@ -174,8 +176,11 @@ static void *thread_video(void *ignored_argument) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// calculate the frames per second
|
|
|
|
|
if (framespersecond == -1) framespersecond = 1.0/(timedeiff_ms(&tv_fps)/1000.0);
|
|
|
|
|
else framespersecond = (framespersecond * 59.0 + 1.0/(timedeiff_ms(&tv_fps)/1000.0)) / 60.0;
|
|
|
|
|
float time_diff = timedeiff_ms(&tv_fps);
|
|
|
|
|
if (isnan(framespersecond) || isinf(framespersecond) || framespersecond < 0.0)
|
|
|
|
|
framespersecond = 1.0/((float)time_diff/1000.0);
|
|
|
|
|
else
|
|
|
|
|
framespersecond = (framespersecond * 59.0 + 1.0/((float)time_diff/1000.0)) / 60.0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
thread_video_exit:
|
|
|
|
|
|