libobs: Don't use source flags for async buffering

(This commit also modifies the decklink, linux-v4l2, mac-avcapture,
obs-ffmpeg, and win-dshow modules)

Originally, async buffering for sources was supposed to be a
user-controllable flag.  However, that turned out to be less than ideal
because sources (such as the win-dshow plugin) were programmed with
automatic control over their buffering (such as automatically detecting
USB 2.0 capture devices and then enabling in those cases).

The fact that it was a flag caused a design flaw to where buffering
values would be overwritten when a source is loaded from save data.

Because of that, this flag is being deprecated and replaced with a
specific function to enable unbuffered mode instead.
This commit is contained in:
jp9000
2017-05-13 23:32:40 -07:00
parent d64542e10b
commit d13fa96851
9 changed files with 30 additions and 30 deletions

View File

@@ -645,13 +645,7 @@ static inline bool update_frame(av_capture *capture,
static void av_capture_enable_buffering(av_capture *capture, bool enabled)
{
obs_source_t *source = capture->source;
uint32_t flags = obs_source_get_flags(source);
if (enabled)
flags &= ~OBS_SOURCE_FLAG_UNBUFFERED;
else
flags |= OBS_SOURCE_FLAG_UNBUFFERED;
obs_source_set_flags(source, flags);
obs_source_set_async_unbuffered(capture->source, !enabled);
}
static const char *av_capture_getname(void*)