Don't update video of sources if not displaying

This is a bit of an optimization to reduce load a little bit if any of
the video capture sources are not currently being displayed on the
screen.  They will simply not capture or update their texture data if
they are not currently being shown anywhere.

The mac and window game capture sources don't really apply due to the
fact that their textures aren't updated on the source's end (they update
inside of the hooks).
This commit is contained in:
jp9000
2015-01-03 22:39:21 -08:00
parent 77105f1d93
commit b277f2b737
6 changed files with 18 additions and 0 deletions

View File

@@ -443,6 +443,9 @@ void XCompcapMain::tick(float seconds)
{
UNUSED_PARAMETER(seconds);
if (!obs_source_showing(p->source))
return;
PLock lock(&p->lock, true);
if (!lock.isLocked())

View File

@@ -392,6 +392,8 @@ static void xshm_video_tick(void *vptr, float seconds)
if (!data->texture)
return;
if (!obs_source_showing(data->source))
return;
xcb_shm_get_image_cookie_t img_c;
xcb_shm_get_image_reply_t *img_r;