(API Change) Use 'get' convention: API callbacks
Renamed: To: ------------------------------------------------------- obs_source_info::defaults obs_source_info::get_defaults obs_source_info::properties obs_source_info::get_properties obs_output_info::defaults obs_output_info::get_defaults obs_output_info::properties obs_output_info::get_properties obs_output_info::total_bytes obs_output_info::get_total_bytes obs_output_info::dropped_frames obs_output_info::get_dropped_frames obs_encoder_info::defaults obs_encoder_info::get_defaults obs_encoder_info::properties obs_encoder_info::get_properties obs_encoder_info::extra_data obs_encoder_info::get_extra_data obs_encoder_info::sei_data obs_encoder_info::get_sei_data obs_encoder_info::audio_info obs_encoder_info::get_audio_info obs_encoder_info::video_info obs_encoder_info::get_video_fino obs_service_info::defaults obs_service_info::get_defaults obs_service_info::properties obs_service_info::get_properties
This commit is contained in:
parent
c83d05117f
commit
2d606dd8d8
@ -49,8 +49,8 @@ static bool init_encoder(struct obs_encoder *encoder, const char *name,
|
||||
if (pthread_mutex_init(&encoder->outputs_mutex, NULL) != 0)
|
||||
return false;
|
||||
|
||||
if (encoder->info.defaults)
|
||||
encoder->info.defaults(encoder->context.settings);
|
||||
if (encoder->info.get_defaults)
|
||||
encoder->info.get_defaults(encoder->context.settings);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -107,8 +107,8 @@ static inline struct audio_convert_info *get_audio_info(
|
||||
aoi = audio_output_getinfo(encoder->media);
|
||||
memset(info, 0, sizeof(struct audio_convert_info));
|
||||
|
||||
if (encoder->info.audio_info)
|
||||
encoder->info.audio_info(encoder->context.data, info);
|
||||
if (encoder->info.get_audio_info)
|
||||
encoder->info.get_audio_info(encoder->context.data, info);
|
||||
|
||||
if (info->format == AUDIO_FORMAT_UNKNOWN)
|
||||
info->format = aoi->format;
|
||||
@ -123,8 +123,8 @@ static inline struct audio_convert_info *get_audio_info(
|
||||
static inline struct video_scale_info *get_video_info(
|
||||
struct obs_encoder *encoder, struct video_scale_info *info)
|
||||
{
|
||||
if (encoder->info.video_info)
|
||||
if (encoder->info.video_info(encoder->context.data, info))
|
||||
if (encoder->info.get_video_info)
|
||||
if (encoder->info.get_video_info(encoder->context.data, info))
|
||||
return info;
|
||||
|
||||
return NULL;
|
||||
@ -224,8 +224,8 @@ const char *obs_encoder_get_name(obs_encoder_t encoder)
|
||||
static inline obs_data_t get_defaults(const struct obs_encoder_info *info)
|
||||
{
|
||||
obs_data_t settings = obs_data_create();
|
||||
if (info->defaults)
|
||||
info->defaults(settings);
|
||||
if (info->get_defaults)
|
||||
info->get_defaults(settings);
|
||||
return settings;
|
||||
}
|
||||
|
||||
@ -238,11 +238,11 @@ obs_data_t obs_encoder_defaults(const char *id)
|
||||
obs_properties_t obs_get_encoder_properties(const char *id)
|
||||
{
|
||||
const struct obs_encoder_info *ei = find_encoder(id);
|
||||
if (ei && ei->properties) {
|
||||
if (ei && ei->get_properties) {
|
||||
obs_data_t defaults = get_defaults(ei);
|
||||
obs_properties_t properties;
|
||||
|
||||
properties = ei->properties();
|
||||
properties = ei->get_properties();
|
||||
obs_properties_apply_settings(properties, defaults);
|
||||
obs_data_release(defaults);
|
||||
return properties;
|
||||
@ -252,9 +252,9 @@ obs_properties_t obs_get_encoder_properties(const char *id)
|
||||
|
||||
obs_properties_t obs_encoder_properties(obs_encoder_t encoder)
|
||||
{
|
||||
if (encoder && encoder->info.properties) {
|
||||
if (encoder && encoder->info.get_properties) {
|
||||
obs_properties_t props;
|
||||
props = encoder->info.properties();
|
||||
props = encoder->info.get_properties();
|
||||
obs_properties_apply_settings(props, encoder->context.settings);
|
||||
return props;
|
||||
}
|
||||
@ -275,8 +275,8 @@ void obs_encoder_update(obs_encoder_t encoder, obs_data_t settings)
|
||||
bool obs_encoder_get_extra_data(obs_encoder_t encoder, uint8_t **extra_data,
|
||||
size_t *size)
|
||||
{
|
||||
if (encoder && encoder->info.extra_data && encoder->context.data)
|
||||
return encoder->info.extra_data(encoder->context.data,
|
||||
if (encoder && encoder->info.get_extra_data && encoder->context.data)
|
||||
return encoder->info.get_extra_data(encoder->context.data,
|
||||
extra_data, size);
|
||||
|
||||
return false;
|
||||
@ -307,7 +307,8 @@ static void intitialize_audio_encoder(struct obs_encoder *encoder)
|
||||
encoder->samplerate = info.samples_per_sec;
|
||||
encoder->planes = get_audio_planes(info.format, info.speakers);
|
||||
encoder->blocksize = get_audio_size(info.format, info.speakers, 1);
|
||||
encoder->framesize = encoder->info.frame_size(encoder->context.data);
|
||||
encoder->framesize = encoder->info.get_frame_size(
|
||||
encoder->context.data);
|
||||
|
||||
encoder->framesize_bytes = encoder->blocksize * encoder->framesize;
|
||||
reset_audio_buffers(encoder);
|
||||
@ -453,8 +454,9 @@ bool obs_encoder_active(obs_encoder_t encoder)
|
||||
static inline bool get_sei(struct obs_encoder *encoder,
|
||||
uint8_t **sei, size_t *size)
|
||||
{
|
||||
if (encoder->info.sei_data)
|
||||
return encoder->info.sei_data(encoder->context.data, sei, size);
|
||||
if (encoder->info.get_sei_data)
|
||||
return encoder->info.get_sei_data(encoder->context.data, sei,
|
||||
size);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -139,7 +139,7 @@ struct obs_encoder_info {
|
||||
struct encoder_packet *packet, bool *received_packet);
|
||||
|
||||
/** Audio encoder only: Returns the frame size for this encoder */
|
||||
size_t (*frame_size)(void *data);
|
||||
size_t (*get_frame_size)(void *data);
|
||||
|
||||
/* ----------------------------------------------------------------- */
|
||||
/* Optional implementation */
|
||||
@ -149,14 +149,14 @@ struct obs_encoder_info {
|
||||
*
|
||||
* @param[out] settings Data to assign default settings to
|
||||
*/
|
||||
void (*defaults)(obs_data_t settings);
|
||||
void (*get_defaults)(obs_data_t settings);
|
||||
|
||||
/**
|
||||
* Gets the property information of this encoder
|
||||
*
|
||||
* @return The properties data
|
||||
*/
|
||||
obs_properties_t (*properties)(void);
|
||||
obs_properties_t (*get_properties)(void);
|
||||
|
||||
/**
|
||||
* Updates the settings for this encoder (usually used for things like
|
||||
@ -178,7 +178,7 @@ struct obs_encoder_info {
|
||||
* @return true if extra data available, false
|
||||
* otherwise
|
||||
*/
|
||||
bool (*extra_data)(void *data, uint8_t **extra_data, size_t *size);
|
||||
bool (*get_extra_data)(void *data, uint8_t **extra_data, size_t *size);
|
||||
|
||||
/**
|
||||
* Gets the SEI data, if any
|
||||
@ -188,7 +188,7 @@ struct obs_encoder_info {
|
||||
* @param[out] size Pointer to receive the SEI data size
|
||||
* @return true if SEI data available, false otherwise
|
||||
*/
|
||||
bool (*sei_data)(void *data, uint8_t **sei_data, size_t *size);
|
||||
bool (*get_sei_data)(void *data, uint8_t **sei_data, size_t *size);
|
||||
|
||||
/**
|
||||
* Returns desired audio format and sample information
|
||||
@ -198,7 +198,7 @@ struct obs_encoder_info {
|
||||
* @return true if specific format is desired, false
|
||||
* otherwise
|
||||
*/
|
||||
bool (*audio_info)(void *data, struct audio_convert_info *info);
|
||||
bool (*get_audio_info)(void *data, struct audio_convert_info *info);
|
||||
|
||||
/**
|
||||
* Returns desired video format information
|
||||
@ -208,7 +208,7 @@ struct obs_encoder_info {
|
||||
* @return true if specific format is desired, false
|
||||
* otherwise
|
||||
*/
|
||||
bool (*video_info)(void *data, struct video_scale_info *info);
|
||||
bool (*get_video_info)(void *data, struct video_scale_info *info);
|
||||
};
|
||||
|
||||
EXPORT void obs_register_encoder_s(const struct obs_encoder_info *info,
|
||||
|
@ -509,7 +509,7 @@ void obs_register_encoder_s(const struct obs_encoder_info *info, size_t size)
|
||||
CHECK_REQUIRED_VAL(info, encode, obs_register_encoder);
|
||||
|
||||
if (info->type == OBS_ENCODER_AUDIO)
|
||||
CHECK_REQUIRED_VAL(info, frame_size, obs_register_encoder);
|
||||
CHECK_REQUIRED_VAL(info, get_frame_size, obs_register_encoder);
|
||||
|
||||
REGISTER_OBS_DEF(size, obs_encoder_info, obs->encoder_types, info);
|
||||
}
|
||||
|
@ -78,8 +78,8 @@ obs_output_t obs_output_create(const char *id, const char *name,
|
||||
output->info = *info;
|
||||
output->video = obs_get_video();
|
||||
output->audio = obs_get_audio();
|
||||
if (output->info.defaults)
|
||||
output->info.defaults(output->context.settings);
|
||||
if (output->info.get_defaults)
|
||||
output->info.get_defaults(output->context.settings);
|
||||
|
||||
ret = os_event_init(&output->reconnect_stop_event,
|
||||
OS_EVENT_TYPE_MANUAL);
|
||||
@ -178,8 +178,8 @@ bool obs_output_active(obs_output_t output)
|
||||
static inline obs_data_t get_defaults(const struct obs_output_info *info)
|
||||
{
|
||||
obs_data_t settings = obs_data_create();
|
||||
if (info->defaults)
|
||||
info->defaults(settings);
|
||||
if (info->get_defaults)
|
||||
info->get_defaults(settings);
|
||||
return settings;
|
||||
}
|
||||
|
||||
@ -192,11 +192,11 @@ obs_data_t obs_output_defaults(const char *id)
|
||||
obs_properties_t obs_get_output_properties(const char *id)
|
||||
{
|
||||
const struct obs_output_info *info = find_output(id);
|
||||
if (info && info->properties) {
|
||||
if (info && info->get_properties) {
|
||||
obs_data_t defaults = get_defaults(info);
|
||||
obs_properties_t properties;
|
||||
|
||||
properties = info->properties();
|
||||
properties = info->get_properties();
|
||||
obs_properties_apply_settings(properties, defaults);
|
||||
obs_data_release(defaults);
|
||||
return properties;
|
||||
@ -206,9 +206,9 @@ obs_properties_t obs_get_output_properties(const char *id)
|
||||
|
||||
obs_properties_t obs_output_properties(obs_output_t output)
|
||||
{
|
||||
if (output && output->info.properties) {
|
||||
if (output && output->info.get_properties) {
|
||||
obs_properties_t props;
|
||||
props = output->info.properties();
|
||||
props = output->info.get_properties();
|
||||
obs_properties_apply_settings(props, output->context.settings);
|
||||
return props;
|
||||
}
|
||||
@ -346,18 +346,18 @@ void obs_output_set_reconnect_settings(obs_output_t output,
|
||||
|
||||
uint64_t obs_output_get_total_bytes(obs_output_t output)
|
||||
{
|
||||
if (!output || !output->info.total_bytes)
|
||||
if (!output || !output->info.get_total_bytes)
|
||||
return 0;
|
||||
|
||||
return output->info.total_bytes(output->context.data);
|
||||
return output->info.get_total_bytes(output->context.data);
|
||||
}
|
||||
|
||||
int obs_output_get_frames_dropped(obs_output_t output)
|
||||
{
|
||||
if (!output || !output->info.dropped_frames)
|
||||
if (!output || !output->info.get_dropped_frames)
|
||||
return 0;
|
||||
|
||||
return output->info.dropped_frames(output->context.data);
|
||||
return output->info.get_dropped_frames(output->context.data);
|
||||
}
|
||||
|
||||
int obs_output_get_total_frames(obs_output_t output)
|
||||
|
@ -47,15 +47,15 @@ struct obs_output_info {
|
||||
/* optional */
|
||||
void (*update)(void *data, obs_data_t settings);
|
||||
|
||||
void (*defaults)(obs_data_t settings);
|
||||
void (*get_defaults)(obs_data_t settings);
|
||||
|
||||
obs_properties_t (*properties)(void);
|
||||
obs_properties_t (*get_properties)(void);
|
||||
|
||||
void (*pause)(void *data);
|
||||
|
||||
uint64_t (*total_bytes)(void *data);
|
||||
uint64_t (*get_total_bytes)(void *data);
|
||||
|
||||
int (*dropped_frames)(void *data);
|
||||
int (*get_dropped_frames)(void *data);
|
||||
};
|
||||
|
||||
EXPORT void obs_register_output_s(const struct obs_output_info *info,
|
||||
|
@ -104,8 +104,8 @@ const char *obs_service_get_name(obs_service_t service)
|
||||
static inline obs_data_t get_defaults(const struct obs_service_info *info)
|
||||
{
|
||||
obs_data_t settings = obs_data_create();
|
||||
if (info->defaults)
|
||||
info->defaults(settings);
|
||||
if (info->get_defaults)
|
||||
info->get_defaults(settings);
|
||||
return settings;
|
||||
}
|
||||
|
||||
@ -118,11 +118,11 @@ obs_data_t obs_service_defaults(const char *id)
|
||||
obs_properties_t obs_get_service_properties(const char *id)
|
||||
{
|
||||
const struct obs_service_info *info = find_service(id);
|
||||
if (info && info->properties) {
|
||||
if (info && info->get_properties) {
|
||||
obs_data_t defaults = get_defaults(info);
|
||||
obs_properties_t properties;
|
||||
|
||||
properties = info->properties();
|
||||
properties = info->get_properties();
|
||||
obs_properties_apply_settings(properties, defaults);
|
||||
obs_data_release(defaults);
|
||||
return properties;
|
||||
@ -132,9 +132,9 @@ obs_properties_t obs_get_service_properties(const char *id)
|
||||
|
||||
obs_properties_t obs_service_properties(obs_service_t service)
|
||||
{
|
||||
if (service && service->info.properties) {
|
||||
if (service && service->info.get_properties) {
|
||||
obs_properties_t props;
|
||||
props = service->info.properties();
|
||||
props = service->info.get_properties();
|
||||
obs_properties_apply_settings(props, service->context.settings);
|
||||
return props;
|
||||
}
|
||||
|
@ -31,9 +31,9 @@ struct obs_service_info {
|
||||
|
||||
void (*update)(void *data, obs_data_t settings);
|
||||
|
||||
void (*defaults)(obs_data_t settings);
|
||||
void (*get_defaults)(obs_data_t settings);
|
||||
|
||||
obs_properties_t (*properties)(void);
|
||||
obs_properties_t (*get_properties)(void);
|
||||
|
||||
/**
|
||||
* Called when getting ready to start up an output, before the encoders
|
||||
|
@ -171,8 +171,8 @@ obs_source_t obs_source_create(enum obs_source_type type, const char *id,
|
||||
if (!obs_source_init_context(source, settings, name))
|
||||
goto fail;
|
||||
|
||||
if (info && info->defaults)
|
||||
info->defaults(source->context.settings);
|
||||
if (info && info->get_defaults)
|
||||
info->get_defaults(source->context.settings);
|
||||
|
||||
/* allow the source to be created even if creation fails so that the
|
||||
* user's data doesn't become lost */
|
||||
@ -321,8 +321,8 @@ bool obs_source_removed(obs_source_t source)
|
||||
static inline obs_data_t get_defaults(const struct obs_source_info *info)
|
||||
{
|
||||
obs_data_t settings = obs_data_create();
|
||||
if (info->defaults)
|
||||
info->defaults(settings);
|
||||
if (info->get_defaults)
|
||||
info->get_defaults(settings);
|
||||
return settings;
|
||||
}
|
||||
|
||||
@ -336,11 +336,11 @@ obs_properties_t obs_get_source_properties(enum obs_source_type type,
|
||||
const char *id)
|
||||
{
|
||||
const struct obs_source_info *info = get_source_info(type, id);
|
||||
if (info && info->properties) {
|
||||
if (info && info->get_properties) {
|
||||
obs_data_t defaults = get_defaults(info);
|
||||
obs_properties_t properties;
|
||||
|
||||
properties = info->properties();
|
||||
properties = info->get_properties();
|
||||
obs_properties_apply_settings(properties, defaults);
|
||||
obs_data_release(defaults);
|
||||
return properties;
|
||||
@ -350,9 +350,9 @@ obs_properties_t obs_get_source_properties(enum obs_source_type type,
|
||||
|
||||
obs_properties_t obs_source_properties(obs_source_t source)
|
||||
{
|
||||
if (source_valid(source) && source->info.properties) {
|
||||
if (source_valid(source) && source->info.get_properties) {
|
||||
obs_properties_t props;
|
||||
props = source->info.properties();
|
||||
props = source->info.get_properties();
|
||||
obs_properties_apply_settings(props, source->context.settings);
|
||||
return props;
|
||||
}
|
||||
|
@ -155,14 +155,14 @@ struct obs_source_info {
|
||||
*
|
||||
* @param[out] settings Data to assign default settings to
|
||||
*/
|
||||
void (*defaults)(obs_data_t settings);
|
||||
void (*get_defaults)(obs_data_t settings);
|
||||
|
||||
/**
|
||||
* Gets the property information of this source
|
||||
*
|
||||
* @return The properties data
|
||||
*/
|
||||
obs_properties_t (*properties)(void);
|
||||
obs_properties_t (*get_properties)(void);
|
||||
|
||||
/**
|
||||
* Updates the settings for this source
|
||||
|
@ -107,17 +107,17 @@ static obs_properties_t image_source_properties(void)
|
||||
}
|
||||
|
||||
static struct obs_source_info image_source_info = {
|
||||
.id = "image_source",
|
||||
.type = OBS_SOURCE_TYPE_INPUT,
|
||||
.output_flags = OBS_SOURCE_VIDEO,
|
||||
.get_name = image_source_get_name,
|
||||
.create = image_source_create,
|
||||
.destroy = image_source_destroy,
|
||||
.update = image_source_update,
|
||||
.get_width = image_source_getwidth,
|
||||
.get_height = image_source_getheight,
|
||||
.video_render = image_source_render,
|
||||
.properties = image_source_properties
|
||||
.id = "image_source",
|
||||
.type = OBS_SOURCE_TYPE_INPUT,
|
||||
.output_flags = OBS_SOURCE_VIDEO,
|
||||
.get_name = image_source_get_name,
|
||||
.create = image_source_create,
|
||||
.destroy = image_source_destroy,
|
||||
.update = image_source_update,
|
||||
.get_width = image_source_getwidth,
|
||||
.get_height = image_source_getheight,
|
||||
.video_render = image_source_render,
|
||||
.get_properties = image_source_properties
|
||||
};
|
||||
|
||||
OBS_DECLARE_MODULE()
|
||||
|
@ -442,25 +442,25 @@ static void *pulse_create(obs_data_t settings, obs_source_t source)
|
||||
}
|
||||
|
||||
struct obs_source_info pulse_input_capture = {
|
||||
.id = "pulse_input_capture",
|
||||
.type = OBS_SOURCE_TYPE_INPUT,
|
||||
.output_flags = OBS_SOURCE_AUDIO,
|
||||
.get_name = pulse_input_getname,
|
||||
.create = pulse_create,
|
||||
.destroy = pulse_destroy,
|
||||
.update = pulse_update,
|
||||
.defaults = pulse_input_defaults,
|
||||
.properties = pulse_input_properties
|
||||
.id = "pulse_input_capture",
|
||||
.type = OBS_SOURCE_TYPE_INPUT,
|
||||
.output_flags = OBS_SOURCE_AUDIO,
|
||||
.get_name = pulse_input_getname,
|
||||
.create = pulse_create,
|
||||
.destroy = pulse_destroy,
|
||||
.update = pulse_update,
|
||||
.get_defaults = pulse_input_defaults,
|
||||
.get_properties = pulse_input_properties
|
||||
};
|
||||
|
||||
struct obs_source_info pulse_output_capture = {
|
||||
.id = "pulse_output_capture",
|
||||
.type = OBS_SOURCE_TYPE_INPUT,
|
||||
.output_flags = OBS_SOURCE_AUDIO,
|
||||
.get_name = pulse_output_getname,
|
||||
.create = pulse_create,
|
||||
.destroy = pulse_destroy,
|
||||
.update = pulse_update,
|
||||
.defaults = pulse_output_defaults,
|
||||
.properties = pulse_output_properties
|
||||
.id = "pulse_output_capture",
|
||||
.type = OBS_SOURCE_TYPE_INPUT,
|
||||
.output_flags = OBS_SOURCE_AUDIO,
|
||||
.get_name = pulse_output_getname,
|
||||
.create = pulse_create,
|
||||
.destroy = pulse_destroy,
|
||||
.update = pulse_update,
|
||||
.get_defaults = pulse_output_defaults,
|
||||
.get_properties = pulse_output_properties
|
||||
};
|
||||
|
@ -849,13 +849,13 @@ static void *v4l2_create(obs_data_t settings, obs_source_t source)
|
||||
}
|
||||
|
||||
struct obs_source_info v4l2_input = {
|
||||
.id = "v4l2_input",
|
||||
.type = OBS_SOURCE_TYPE_INPUT,
|
||||
.output_flags = OBS_SOURCE_ASYNC_VIDEO,
|
||||
.get_name = v4l2_getname,
|
||||
.create = v4l2_create,
|
||||
.destroy = v4l2_destroy,
|
||||
.update = v4l2_update,
|
||||
.defaults = v4l2_defaults,
|
||||
.properties = v4l2_properties
|
||||
.id = "v4l2_input",
|
||||
.type = OBS_SOURCE_TYPE_INPUT,
|
||||
.output_flags = OBS_SOURCE_ASYNC_VIDEO,
|
||||
.get_name = v4l2_getname,
|
||||
.create = v4l2_create,
|
||||
.destroy = v4l2_destroy,
|
||||
.update = v4l2_update,
|
||||
.get_defaults = v4l2_defaults,
|
||||
.get_properties = v4l2_properties
|
||||
};
|
||||
|
@ -72,16 +72,16 @@ bool obs_module_load(void)
|
||||
sinfo.id = "xcomposite_input";
|
||||
sinfo.output_flags = OBS_SOURCE_VIDEO;
|
||||
|
||||
sinfo.get_name = xcompcap_getname;
|
||||
sinfo.create = xcompcap_create;
|
||||
sinfo.destroy = xcompcap_destroy;
|
||||
sinfo.properties = xcompcap_props;
|
||||
sinfo.defaults = xcompcap_defaults;
|
||||
sinfo.update = xcompcap_update;
|
||||
sinfo.video_tick = xcompcap_video_tick;
|
||||
sinfo.video_render = xcompcap_video_render;
|
||||
sinfo.get_width = xcompcap_getwidth;
|
||||
sinfo.get_height = xcompcap_getheight;
|
||||
sinfo.get_name = xcompcap_getname;
|
||||
sinfo.create = xcompcap_create;
|
||||
sinfo.destroy = xcompcap_destroy;
|
||||
sinfo.get_properties = xcompcap_props;
|
||||
sinfo.get_defaults = xcompcap_defaults;
|
||||
sinfo.update = xcompcap_update;
|
||||
sinfo.video_tick = xcompcap_video_tick;
|
||||
sinfo.video_render = xcompcap_video_render;
|
||||
sinfo.get_width = xcompcap_getwidth;
|
||||
sinfo.get_height = xcompcap_getheight;
|
||||
|
||||
obs_register_source(&sinfo);
|
||||
|
||||
|
@ -298,17 +298,17 @@ static uint32_t xshm_getheight(void *vptr)
|
||||
}
|
||||
|
||||
struct obs_source_info xshm_input = {
|
||||
.id = "xshm_input",
|
||||
.type = OBS_SOURCE_TYPE_INPUT,
|
||||
.output_flags = OBS_SOURCE_VIDEO,
|
||||
.get_name = xshm_getname,
|
||||
.create = xshm_create,
|
||||
.destroy = xshm_destroy,
|
||||
.update = xshm_update,
|
||||
.defaults = xshm_defaults,
|
||||
.properties = xshm_properties,
|
||||
.video_tick = xshm_video_tick,
|
||||
.video_render = xshm_video_render,
|
||||
.get_width = xshm_getwidth,
|
||||
.get_height = xshm_getheight
|
||||
.id = "xshm_input",
|
||||
.type = OBS_SOURCE_TYPE_INPUT,
|
||||
.output_flags = OBS_SOURCE_VIDEO,
|
||||
.get_name = xshm_getname,
|
||||
.create = xshm_create,
|
||||
.destroy = xshm_destroy,
|
||||
.update = xshm_update,
|
||||
.get_defaults = xshm_defaults,
|
||||
.get_properties = xshm_properties,
|
||||
.video_tick = xshm_video_tick,
|
||||
.video_render = xshm_video_render,
|
||||
.get_width = xshm_getwidth,
|
||||
.get_height = xshm_getheight
|
||||
};
|
||||
|
@ -834,14 +834,14 @@ static void av_capture_update(void *data, obs_data_t settings)
|
||||
}
|
||||
|
||||
struct obs_source_info av_capture_info = {
|
||||
.id = "av_capture_input",
|
||||
.type = OBS_SOURCE_TYPE_INPUT,
|
||||
.output_flags = OBS_SOURCE_ASYNC_VIDEO,
|
||||
.get_name = av_capture_getname,
|
||||
.create = av_capture_create,
|
||||
.destroy = av_capture_destroy,
|
||||
.defaults = av_capture_defaults,
|
||||
.properties = av_capture_properties,
|
||||
.update = av_capture_update,
|
||||
.id = "av_capture_input",
|
||||
.type = OBS_SOURCE_TYPE_INPUT,
|
||||
.output_flags = OBS_SOURCE_ASYNC_VIDEO,
|
||||
.get_name = av_capture_getname,
|
||||
.create = av_capture_create,
|
||||
.destroy = av_capture_destroy,
|
||||
.get_defaults = av_capture_defaults,
|
||||
.get_properties = av_capture_properties,
|
||||
.update = av_capture_update,
|
||||
};
|
||||
|
||||
|
@ -743,23 +743,23 @@ static obs_properties_t coreaudio_output_properties(void)
|
||||
}
|
||||
|
||||
struct obs_source_info coreaudio_input_capture_info = {
|
||||
.id = "coreaudio_input_capture",
|
||||
.type = OBS_SOURCE_TYPE_INPUT,
|
||||
.output_flags = OBS_SOURCE_AUDIO,
|
||||
.get_name = coreaudio_input_getname,
|
||||
.create = coreaudio_create_input_capture,
|
||||
.destroy = coreaudio_destroy,
|
||||
.defaults = coreaudio_defaults,
|
||||
.properties = coreaudio_input_properties
|
||||
.id = "coreaudio_input_capture",
|
||||
.type = OBS_SOURCE_TYPE_INPUT,
|
||||
.output_flags = OBS_SOURCE_AUDIO,
|
||||
.get_name = coreaudio_input_getname,
|
||||
.create = coreaudio_create_input_capture,
|
||||
.destroy = coreaudio_destroy,
|
||||
.get_defaults = coreaudio_defaults,
|
||||
.get_properties = coreaudio_input_properties
|
||||
};
|
||||
|
||||
struct obs_source_info coreaudio_output_capture_info = {
|
||||
.id = "coreaudio_output_capture",
|
||||
.type = OBS_SOURCE_TYPE_INPUT,
|
||||
.output_flags = OBS_SOURCE_AUDIO,
|
||||
.get_name = coreaudio_output_getname,
|
||||
.create = coreaudio_create_output_capture,
|
||||
.destroy = coreaudio_destroy,
|
||||
.defaults = coreaudio_defaults,
|
||||
.properties = coreaudio_output_properties
|
||||
.id = "coreaudio_output_capture",
|
||||
.type = OBS_SOURCE_TYPE_INPUT,
|
||||
.output_flags = OBS_SOURCE_AUDIO,
|
||||
.get_name = coreaudio_output_getname,
|
||||
.create = coreaudio_create_output_capture,
|
||||
.destroy = coreaudio_destroy,
|
||||
.get_defaults = coreaudio_defaults,
|
||||
.get_properties = coreaudio_output_properties
|
||||
};
|
||||
|
@ -320,21 +320,21 @@ static obs_properties_t display_capture_properties(void)
|
||||
}
|
||||
|
||||
struct obs_source_info display_capture_info = {
|
||||
.id = "display_capture",
|
||||
.type = OBS_SOURCE_TYPE_INPUT,
|
||||
.get_name = display_capture_getname,
|
||||
.id = "display_capture",
|
||||
.type = OBS_SOURCE_TYPE_INPUT,
|
||||
.get_name = display_capture_getname,
|
||||
|
||||
.create = display_capture_create,
|
||||
.destroy = display_capture_destroy,
|
||||
.create = display_capture_create,
|
||||
.destroy = display_capture_destroy,
|
||||
|
||||
.output_flags = OBS_SOURCE_VIDEO | OBS_SOURCE_CUSTOM_DRAW,
|
||||
.video_tick = display_capture_video_tick,
|
||||
.video_render = display_capture_video_render,
|
||||
.output_flags = OBS_SOURCE_VIDEO | OBS_SOURCE_CUSTOM_DRAW,
|
||||
.video_tick = display_capture_video_tick,
|
||||
.video_render = display_capture_video_render,
|
||||
|
||||
.get_width = display_capture_getwidth,
|
||||
.get_height = display_capture_getheight,
|
||||
.get_width = display_capture_getwidth,
|
||||
.get_height = display_capture_getheight,
|
||||
|
||||
.defaults = display_capture_defaults,
|
||||
.properties = display_capture_properties,
|
||||
.update = display_capture_update,
|
||||
.get_defaults = display_capture_defaults,
|
||||
.get_properties = display_capture_properties,
|
||||
.update = display_capture_update,
|
||||
};
|
||||
|
@ -274,16 +274,16 @@ static size_t aac_frame_size(void *data)
|
||||
}
|
||||
|
||||
struct obs_encoder_info aac_encoder_info = {
|
||||
.id = "ffmpeg_aac",
|
||||
.type = OBS_ENCODER_AUDIO,
|
||||
.codec = "AAC",
|
||||
.get_name = aac_getname,
|
||||
.create = aac_create,
|
||||
.destroy = aac_destroy,
|
||||
.encode = aac_encode,
|
||||
.frame_size = aac_frame_size,
|
||||
.defaults = aac_defaults,
|
||||
.properties = aac_properties,
|
||||
.extra_data = aac_extra_data,
|
||||
.audio_info = aac_audio_info
|
||||
.id = "ffmpeg_aac",
|
||||
.type = OBS_ENCODER_AUDIO,
|
||||
.codec = "AAC",
|
||||
.get_name = aac_getname,
|
||||
.create = aac_create,
|
||||
.destroy = aac_destroy,
|
||||
.encode = aac_encode,
|
||||
.get_frame_size = aac_frame_size,
|
||||
.get_defaults = aac_defaults,
|
||||
.get_properties = aac_properties,
|
||||
.get_extra_data = aac_extra_data,
|
||||
.get_audio_info = aac_audio_info
|
||||
};
|
||||
|
@ -289,18 +289,18 @@ static size_t libfdk_frame_size(void *data)
|
||||
}
|
||||
|
||||
struct obs_encoder_info obs_libfdk_encoder = {
|
||||
.id = "libfdk_aac",
|
||||
.type = OBS_ENCODER_AUDIO,
|
||||
.codec = "AAC",
|
||||
.get_name = libfdk_getname,
|
||||
.create = libfdk_create,
|
||||
.destroy = libfdk_destroy,
|
||||
.encode = libfdk_encode,
|
||||
.frame_size = libfdk_frame_size,
|
||||
.defaults = libfdk_defaults,
|
||||
.properties = libfdk_properties,
|
||||
.extra_data = libfdk_extra_data,
|
||||
.audio_info = libfdk_audio_info
|
||||
.id = "libfdk_aac",
|
||||
.type = OBS_ENCODER_AUDIO,
|
||||
.codec = "AAC",
|
||||
.get_name = libfdk_getname,
|
||||
.create = libfdk_create,
|
||||
.destroy = libfdk_destroy,
|
||||
.encode = libfdk_encode,
|
||||
.get_frame_size = libfdk_frame_size,
|
||||
.get_defaults = libfdk_defaults,
|
||||
.get_properties = libfdk_properties,
|
||||
.get_extra_data = libfdk_extra_data,
|
||||
.get_audio_info = libfdk_audio_info
|
||||
};
|
||||
|
||||
bool obs_module_load(void)
|
||||
|
@ -207,5 +207,5 @@ struct obs_output_info flv_output_info = {
|
||||
.start = flv_output_start,
|
||||
.stop = flv_output_stop,
|
||||
.encoded_packet = flv_output_data,
|
||||
.properties = flv_output_properties
|
||||
.get_properties = flv_output_properties
|
||||
};
|
||||
|
@ -588,18 +588,18 @@ static int rtmp_stream_dropped_frames(void *data)
|
||||
}
|
||||
|
||||
struct obs_output_info rtmp_output_info = {
|
||||
.id = "rtmp_output",
|
||||
.flags = OBS_OUTPUT_AV |
|
||||
OBS_OUTPUT_ENCODED |
|
||||
OBS_OUTPUT_SERVICE,
|
||||
.get_name = rtmp_stream_getname,
|
||||
.create = rtmp_stream_create,
|
||||
.destroy = rtmp_stream_destroy,
|
||||
.start = rtmp_stream_start,
|
||||
.stop = rtmp_stream_stop,
|
||||
.encoded_packet = rtmp_stream_data,
|
||||
.defaults = rtmp_stream_defaults,
|
||||
.properties = rtmp_stream_properties,
|
||||
.total_bytes = rtmp_stream_total_bytes_sent,
|
||||
.dropped_frames = rtmp_stream_dropped_frames
|
||||
};
|
||||
.id = "rtmp_output",
|
||||
.flags = OBS_OUTPUT_AV |
|
||||
OBS_OUTPUT_ENCODED |
|
||||
OBS_OUTPUT_SERVICE,
|
||||
.get_name = rtmp_stream_getname,
|
||||
.create = rtmp_stream_create,
|
||||
.destroy = rtmp_stream_destroy,
|
||||
.start = rtmp_stream_start,
|
||||
.stop = rtmp_stream_stop,
|
||||
.encoded_packet = rtmp_stream_data,
|
||||
.get_defaults = rtmp_stream_defaults,
|
||||
.get_properties = rtmp_stream_properties,
|
||||
.get_total_bytes = rtmp_stream_total_bytes_sent,
|
||||
.get_dropped_frames = rtmp_stream_dropped_frames
|
||||
};
|
||||
|
@ -511,17 +511,17 @@ static bool obs_x264_video_info(void *data, struct video_scale_info *info)
|
||||
}
|
||||
|
||||
struct obs_encoder_info obs_x264_encoder = {
|
||||
.id = "obs_x264",
|
||||
.type = OBS_ENCODER_VIDEO,
|
||||
.codec = "h264",
|
||||
.get_name = obs_x264_getname,
|
||||
.create = obs_x264_create,
|
||||
.destroy = obs_x264_destroy,
|
||||
.encode = obs_x264_encode,
|
||||
.properties = obs_x264_props,
|
||||
.defaults = obs_x264_defaults,
|
||||
.update = obs_x264_update,
|
||||
.extra_data = obs_x264_extra_data,
|
||||
.sei_data = obs_x264_sei,
|
||||
.video_info = obs_x264_video_info
|
||||
.id = "obs_x264",
|
||||
.type = OBS_ENCODER_VIDEO,
|
||||
.codec = "h264",
|
||||
.get_name = obs_x264_getname,
|
||||
.create = obs_x264_create,
|
||||
.destroy = obs_x264_destroy,
|
||||
.encode = obs_x264_encode,
|
||||
.update = obs_x264_update,
|
||||
.get_properties = obs_x264_props,
|
||||
.get_defaults = obs_x264_defaults,
|
||||
.get_extra_data = obs_x264_extra_data,
|
||||
.get_sei_data = obs_x264_sei,
|
||||
.get_video_info = obs_x264_video_info
|
||||
};
|
||||
|
@ -331,13 +331,13 @@ static const char *rtmp_common_key(void *data)
|
||||
}
|
||||
|
||||
struct obs_service_info rtmp_common_service = {
|
||||
.id = "rtmp_common",
|
||||
.get_name = rtmp_common_getname,
|
||||
.create = rtmp_common_create,
|
||||
.destroy = rtmp_common_destroy,
|
||||
.update = rtmp_common_update,
|
||||
.properties = rtmp_common_properties,
|
||||
.initialize = rtmp_common_initialize,
|
||||
.get_url = rtmp_common_url,
|
||||
.get_key = rtmp_common_key
|
||||
.id = "rtmp_common",
|
||||
.get_name = rtmp_common_getname,
|
||||
.create = rtmp_common_create,
|
||||
.destroy = rtmp_common_destroy,
|
||||
.update = rtmp_common_update,
|
||||
.initialize = rtmp_common_initialize,
|
||||
.get_properties = rtmp_common_properties,
|
||||
.get_url = rtmp_common_url,
|
||||
.get_key = rtmp_common_key
|
||||
};
|
||||
|
@ -62,12 +62,12 @@ static const char *rtmp_custom_key(void *data)
|
||||
}
|
||||
|
||||
struct obs_service_info rtmp_custom_service = {
|
||||
.id = "rtmp_custom",
|
||||
.get_name = rtmp_custom_name,
|
||||
.create = rtmp_custom_create,
|
||||
.destroy = rtmp_custom_destroy,
|
||||
.update = rtmp_custom_update,
|
||||
.properties = rtmp_custom_properties,
|
||||
.get_url = rtmp_custom_url,
|
||||
.get_key = rtmp_custom_key
|
||||
.id = "rtmp_custom",
|
||||
.get_name = rtmp_custom_name,
|
||||
.create = rtmp_custom_create,
|
||||
.destroy = rtmp_custom_destroy,
|
||||
.update = rtmp_custom_update,
|
||||
.get_properties = rtmp_custom_properties,
|
||||
.get_url = rtmp_custom_url,
|
||||
.get_key = rtmp_custom_key
|
||||
};
|
||||
|
@ -164,9 +164,9 @@ struct obs_source_info monitor_capture_info = {
|
||||
.get_name = monitor_capture_getname,
|
||||
.create = monitor_capture_create,
|
||||
.destroy = monitor_capture_destroy,
|
||||
.video_render = monitor_capture_render,
|
||||
.video_tick = monitor_capture_tick,
|
||||
.get_width = monitor_capture_width,
|
||||
.get_height = monitor_capture_height,
|
||||
.defaults = monitor_capture_defaults,
|
||||
.video_render = monitor_capture_render,
|
||||
.video_tick = monitor_capture_tick
|
||||
.get_defaults = monitor_capture_defaults
|
||||
};
|
||||
|
@ -450,17 +450,17 @@ static void wc_render(void *data, effect_t effect)
|
||||
}
|
||||
|
||||
struct obs_source_info window_capture_info = {
|
||||
.id = "window_capture",
|
||||
.type = OBS_SOURCE_TYPE_INPUT,
|
||||
.output_flags = OBS_SOURCE_VIDEO | OBS_SOURCE_CUSTOM_DRAW,
|
||||
.get_name = wc_getname,
|
||||
.create = wc_create,
|
||||
.destroy = wc_destroy,
|
||||
.update = wc_update,
|
||||
.get_width = wc_width,
|
||||
.get_height = wc_height,
|
||||
.defaults = wc_defaults,
|
||||
.properties = wc_properties,
|
||||
.video_render = wc_render,
|
||||
.video_tick = wc_tick
|
||||
.id = "window_capture",
|
||||
.type = OBS_SOURCE_TYPE_INPUT,
|
||||
.output_flags = OBS_SOURCE_VIDEO | OBS_SOURCE_CUSTOM_DRAW,
|
||||
.get_name = wc_getname,
|
||||
.create = wc_create,
|
||||
.destroy = wc_destroy,
|
||||
.update = wc_update,
|
||||
.video_render = wc_render,
|
||||
.video_tick = wc_tick,
|
||||
.get_width = wc_width,
|
||||
.get_height = wc_height,
|
||||
.get_defaults = wc_defaults,
|
||||
.get_properties = wc_properties
|
||||
};
|
||||
|
@ -1196,16 +1196,15 @@ bool obs_module_load(void)
|
||||
obs_source_info info = {};
|
||||
info.id = "dshow_input";
|
||||
info.type = OBS_SOURCE_TYPE_INPUT;
|
||||
info.output_flags = OBS_SOURCE_VIDEO |
|
||||
OBS_SOURCE_ASYNC;
|
||||
info.output_flags = OBS_SOURCE_VIDEO | OBS_SOURCE_ASYNC;
|
||||
info.get_name = GetDShowInputName;
|
||||
info.create = CreateDShowInput;
|
||||
info.destroy = DestroyDShowInput;
|
||||
info.update = UpdateDShowInput;
|
||||
info.get_width = GetDShowWidth;
|
||||
info.get_height = GetDShowHeight;
|
||||
info.update = UpdateDShowInput;
|
||||
info.defaults = GetDShowDefaults;
|
||||
info.properties = GetDShowProperties;
|
||||
info.get_defaults = GetDShowDefaults;
|
||||
info.get_properties = GetDShowProperties;
|
||||
obs_register_source(&info);
|
||||
|
||||
return true;
|
||||
|
@ -516,8 +516,8 @@ void RegisterWASAPIInput()
|
||||
info.create = CreateWASAPIInput;
|
||||
info.destroy = DestroyWASAPISource;
|
||||
info.update = UpdateWASAPISource;
|
||||
info.defaults = GetWASAPIDefaults;
|
||||
info.properties = GetWASAPIPropertiesInput;
|
||||
info.get_defaults = GetWASAPIDefaults;
|
||||
info.get_properties = GetWASAPIPropertiesInput;
|
||||
obs_register_source(&info);
|
||||
}
|
||||
|
||||
@ -531,7 +531,7 @@ void RegisterWASAPIOutput()
|
||||
info.create = CreateWASAPIOutput;
|
||||
info.destroy = DestroyWASAPISource;
|
||||
info.update = UpdateWASAPISource;
|
||||
info.defaults = GetWASAPIDefaults;
|
||||
info.properties = GetWASAPIPropertiesOutput;
|
||||
info.get_defaults = GetWASAPIDefaults;
|
||||
info.get_properties = GetWASAPIPropertiesOutput;
|
||||
obs_register_source(&info);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user