Add sound capture
This commit is contained in:
@@ -114,6 +114,7 @@ int main(int argc, char **argv)
|
||||
"background:rgb(241,23,17)}";
|
||||
const char *url = external_url ? argv[3] : internal_url;
|
||||
const char *css = external_url ? "" : zoom ? zoom_css : opaque ? opaque_css : transparent_css;
|
||||
const char *audio_sink = getenv("OWB_TEST_AUDIO_SINK");
|
||||
struct owb_config_header config = {
|
||||
.magic = OWB_CONFIG_MAGIC,
|
||||
.version = OWB_PROTOCOL_VERSION,
|
||||
@@ -121,12 +122,15 @@ int main(int argc, char **argv)
|
||||
.height = height,
|
||||
.fps = 10,
|
||||
.zoom_percent = zoom ? 200 : 100,
|
||||
.capture_audio = audio_sink && *audio_sink,
|
||||
.transparent = opaque ? 0 : 1,
|
||||
/* GPU rendering must still produce an invisible captured frame. */
|
||||
.hardware_acceleration = 1,
|
||||
.url_length = (uint32_t)strlen(url),
|
||||
.css_length = (uint32_t)strlen(css),
|
||||
};
|
||||
if (audio_sink)
|
||||
snprintf(config.audio_sink, sizeof(config.audio_sink), "%s", audio_sink);
|
||||
bool sent = write_exact(control[0], &config, sizeof(config)) &&
|
||||
write_exact(control[0], url, strlen(url)) &&
|
||||
write_exact(control[0], css, strlen(css));
|
||||
|
||||
Reference in New Issue
Block a user