예제 #1
0
void obs_register_source_s(const struct obs_source_info *info, size_t size)
{
	struct obs_source_info data = {0};
	struct darray *array;

	CHECK_REQUIRED_VAL(info, getname,   obs_register_source);
	CHECK_REQUIRED_VAL(info, create,    obs_register_source);
	CHECK_REQUIRED_VAL(info, destroy,   obs_register_source);

	if (info->type == OBS_SOURCE_TYPE_INPUT &&
	    info->output_flags & OBS_SOURCE_VIDEO) {
		CHECK_REQUIRED_VAL(info, getwidth,  obs_register_source);
		CHECK_REQUIRED_VAL(info, getheight, obs_register_source);
	}

	memcpy(&data, info, size);

	if (info->type == OBS_SOURCE_TYPE_INPUT) {
		array = &obs->input_types.da;
	} else if (info->type == OBS_SOURCE_TYPE_FILTER) {
		array = &obs->filter_types.da;
	} else if (info->type == OBS_SOURCE_TYPE_TRANSITION) {
		array = &obs->transition_types.da;
	} else {
		blog(LOG_ERROR, "Tried to register unknown source type: %u",
				info->type);
		return;
	}

	darray_push_back(sizeof(struct obs_source_info), array, &data);
}
예제 #2
0
void obs_regsiter_modal_ui_s(const struct obs_modal_ui *info, size_t size)
{
	CHECK_REQUIRED_VAL(info, task,   obs_regsiter_modal_ui);
	CHECK_REQUIRED_VAL(info, target, obs_regsiter_modal_ui);
	CHECK_REQUIRED_VAL(info, exec,   obs_regsiter_modal_ui);

	REGISTER_OBS_DEF(size, obs_modal_ui, obs->modal_ui_callbacks, info);
}
예제 #3
0
void obs_register_encoder_s(const struct obs_encoder_info *info, size_t size)
{
	CHECK_REQUIRED_VAL(info, getname,    obs_register_encoder);
	CHECK_REQUIRED_VAL(info, create,     obs_register_encoder);
	CHECK_REQUIRED_VAL(info, destroy,    obs_register_encoder);
	CHECK_REQUIRED_VAL(info, encode,     obs_register_encoder);

	if (info->type == OBS_ENCODER_AUDIO)
		CHECK_REQUIRED_VAL(info, frame_size, obs_register_encoder);

	REGISTER_OBS_DEF(size, obs_encoder_info, obs->encoder_types, info);
}
예제 #4
0
void obs_register_service_s(const struct obs_service_info *info, size_t size)
{
    if (find_service(info->id)) {
        blog(LOG_WARNING, "Service id '%s' already exists!  "
             "Duplicate library?", info->id);
        return;
    }

    CHECK_REQUIRED_VAL(info, get_name, obs_register_service);
    CHECK_REQUIRED_VAL(info, create,   obs_register_service);
    CHECK_REQUIRED_VAL(info, destroy,  obs_register_service);

    REGISTER_OBS_DEF(size, obs_service_info, obs->service_types, info);
}
예제 #5
0
void obs_register_output_s(const struct obs_output_info *info, size_t size)
{
    if (find_output(info->id)) {
        blog(LOG_WARNING, "Output id '%s' already exists!  "
             "Duplicate library?", info->id);
        return;
    }

    CHECK_REQUIRED_VAL(info, get_name, obs_register_output);
    CHECK_REQUIRED_VAL(info, create,   obs_register_output);
    CHECK_REQUIRED_VAL(info, destroy,  obs_register_output);
    CHECK_REQUIRED_VAL(info, start,    obs_register_output);
    CHECK_REQUIRED_VAL(info, stop,     obs_register_output);

    if (info->flags & OBS_OUTPUT_ENCODED) {
        CHECK_REQUIRED_VAL(info, encoded_packet, obs_register_output);
    } else {
        if (info->flags & OBS_OUTPUT_VIDEO)
            CHECK_REQUIRED_VAL(info, raw_video,
                               obs_register_output);

        if (info->flags & OBS_OUTPUT_AUDIO)
            CHECK_REQUIRED_VAL(info, raw_audio,
                               obs_register_output);
    }

    REGISTER_OBS_DEF(size, obs_output_info, obs->output_types, info);
}
예제 #6
0
void obs_register_encoder_s(const struct obs_encoder_info *info, size_t size)
{
    if (find_encoder(info->id)) {
        blog(LOG_WARNING, "Encoder id '%s' already exists!  "
             "Duplicate library?", info->id);
        return;
    }

    CHECK_REQUIRED_VAL(info, get_name, obs_register_encoder);
    CHECK_REQUIRED_VAL(info, create,   obs_register_encoder);
    CHECK_REQUIRED_VAL(info, destroy,  obs_register_encoder);
    CHECK_REQUIRED_VAL(info, encode,   obs_register_encoder);

    if (info->type == OBS_ENCODER_AUDIO)
        CHECK_REQUIRED_VAL(info, get_frame_size, obs_register_encoder);

    REGISTER_OBS_DEF(size, obs_encoder_info, obs->encoder_types, info);
}
예제 #7
0
void obs_register_source_s(const struct obs_source_info *info, size_t size)
{
	struct obs_source_info data = {0};
	struct darray *array;

	if (info->type == OBS_SOURCE_TYPE_INPUT) {
		array = &obs->input_types.da;
	} else if (info->type == OBS_SOURCE_TYPE_FILTER) {
		array = &obs->filter_types.da;
	} else if (info->type == OBS_SOURCE_TYPE_TRANSITION) {
		array = &obs->transition_types.da;
	} else {
		blog(LOG_ERROR, "Tried to register unknown source type: %u",
				info->type);
		return;
	}

	if (find_source(array, info->id)) {
		blog(LOG_WARNING, "Source d '%s' already exists!  "
		                  "Duplicate library?", info->id);
		return;
	}

	CHECK_REQUIRED_VAL(info, get_name, obs_register_source);
	CHECK_REQUIRED_VAL(info, create,   obs_register_source);
	CHECK_REQUIRED_VAL(info, destroy,  obs_register_source);

	if (info->type == OBS_SOURCE_TYPE_INPUT          &&
	    (info->output_flags & OBS_SOURCE_VIDEO) != 0 &&
	    (info->output_flags & OBS_SOURCE_ASYNC) == 0) {
		CHECK_REQUIRED_VAL(info, get_width,  obs_register_source);
		CHECK_REQUIRED_VAL(info, get_height, obs_register_source);
	}

	memcpy(&data, info, size);

	/* mark audio-only filters as an async filter categorically */
	if (data.type == OBS_SOURCE_TYPE_FILTER) {
		if ((data.output_flags & OBS_SOURCE_VIDEO) == 0)
			data.output_flags |= OBS_SOURCE_ASYNC;
	}

	darray_push_back(sizeof(struct obs_source_info), array, &data);
}
예제 #8
0
void obs_register_output_s(const struct obs_output_info *info, size_t size)
{
	CHECK_REQUIRED_VAL(info, getname, obs_register_output);
	CHECK_REQUIRED_VAL(info, create,  obs_register_output);
	CHECK_REQUIRED_VAL(info, destroy, obs_register_output);
	CHECK_REQUIRED_VAL(info, start,   obs_register_output);
	CHECK_REQUIRED_VAL(info, stop,    obs_register_output);

	if (info->flags & OBS_OUTPUT_ENCODED) {
		CHECK_REQUIRED_VAL(info, encoded_packet, obs_register_output);
	} else {
		if (info->flags & OBS_OUTPUT_VIDEO)
			CHECK_REQUIRED_VAL(info, raw_video,
					obs_register_output);

		if (info->flags & OBS_OUTPUT_AUDIO)
			CHECK_REQUIRED_VAL(info, raw_audio,
					obs_register_output);
	}

	REGISTER_OBS_DEF(size, obs_output_info, obs->output_types, info);
}