vidcap: missing audio notavail checks

This commit is contained in:
Martin Pulec
2023-06-12 13:39:05 +02:00
parent 64f2bb7da4
commit d7082b647e
4 changed files with 15 additions and 6 deletions

View File

@@ -604,6 +604,9 @@ static int vidcap_avfoundation_init(struct vidcap_params *params, void **state)
[vidcap_avfoundation_state usage: true];
return VIDCAP_INIT_NOERR;
}
if ((vidcap_params_get_flags(params) & VIDCAP_FLAG_AUDIO_ANY) != 0U) {
return VIDCAP_INIT_AUDIO_NOT_SUPPORTED;
}
NSMutableDictionary *init_params = [[NSMutableDictionary alloc] init];
char *tmp = strdup(vidcap_params_get_fmt(params));
char *item, *save_ptr, *cfg = tmp;

View File

@@ -96,9 +96,6 @@ struct vidcap_gpustitch_state {
int frames;
struct timeval t, t0;
int audio_source_index;
gpustitch::Stitcher stitcher;
gpustitch::Stitcher_params stitch_params;
std::vector<gpustitch::Cam_params> cam_properties;
@@ -521,12 +518,13 @@ static void stop_grab_workers(vidcap_gpustitch_state *s){
static int
vidcap_gpustitch_init(struct vidcap_params *params, void **state)
{
struct vidcap_gpustitch_state *s;
printf("vidcap_gpustitch_init\n");
if ((vidcap_params_get_flags(params) & VIDCAP_FLAG_AUDIO_ANY) != 0U) {
return VIDCAP_INIT_AUDIO_NOT_SUPPORTED;
}
s = new vidcap_gpustitch_state();
struct vidcap_gpustitch_state *s = new vidcap_gpustitch_state();
if(s == NULL) {
printf("Unable to allocate gpustitch capture state\n");
return VIDCAP_INIT_FAIL;

View File

@@ -116,6 +116,10 @@ static void usage()
static int vidcap_spout_init(struct vidcap_params *params, void **state)
{
if ((vidcap_params_get_flags(params) & VIDCAP_FLAG_AUDIO_ANY) != 0U) {
return VIDCAP_INIT_AUDIO_NOT_SUPPORTED;
}
state_vidcap_spout *s = new state_vidcap_spout();
double fps = DEFAULT_FPS;

View File

@@ -442,6 +442,10 @@ static int vidcap_syphon_init_common(char *opts, struct state_vidcap_syphon **ou
static int vidcap_syphon_init(struct vidcap_params *params, void **state)
{
if ((vidcap_params_get_flags(params) & VIDCAP_FLAG_AUDIO_ANY) != 0U) {
return VIDCAP_INIT_AUDIO_NOT_SUPPORTED;
}
char *opts = strdup(vidcap_params_get_fmt(params));
struct state_vidcap_syphon *s = NULL;
int ret = vidcap_syphon_init_common(opts, &s);