(API Change) Unsquish libobs (base) names

Previous names:             New names:
-----------------------------------------------------------
obs_view_setsource          obs_view_set_source
obs_view_getsource          obs_view_get_source
obs_source_getdisplayname   obs_source_get_display_name
obs_source_getwidth         obs_source_get_width
obs_source_getheight        obs_source_get_height
obs_filter_getparent        obs_filter_get_parent
obs_filter_gettarget        obs_filter_get_target
obs_source_filter_setorder  obs_source_filter_set_order
obs_source_getsettings      obs_source_get_settings
obs_source_getname          obs_source_get_name
obs_source_setname          obs_source_set_name
obs_source_setvolume        obs_source_set_volume
obs_source_getvolume        obs_source_get_volume
obs_scene_getsource         obs_scene_get_source
obs_scene_fromsource        obs_scene_from_source
obs_scene_findsource        obs_scene_find_source
obs_output_getdisplayname   obs_output_get_display_name
obs_output_getname          obs_output_get_name
obs_encoder_getname         obs_encoder_get_name
obs_service_getdisplayname  obs_service_get_display_name
obs_service_getname         obs_service_get_name
master
jp9000 2014-08-04 08:41:15 -07:00
parent 41176eef27
commit 73baaa59e9
24 changed files with 114 additions and 112 deletions

View File

@ -30,7 +30,7 @@ struct obs_encoder_info *find_encoder(const char *id)
return NULL;
}
const char *obs_encoder_getdisplayname(const char *id)
const char *obs_encoder_get_display_name(const char *id)
{
struct obs_encoder_info *ei = find_encoder(id);
return ei ? ei->getname() : NULL;
@ -216,7 +216,7 @@ void obs_encoder_destroy(obs_encoder_t encoder)
}
}
const char *obs_encoder_getname(obs_encoder_t encoder)
const char *obs_encoder_get_name(obs_encoder_t encoder)
{
return encoder ? encoder->context.name : NULL;
}

View File

@ -31,7 +31,7 @@ const struct obs_output_info *find_output(const char *id)
return NULL;
}
const char *obs_output_getdisplayname(const char *id)
const char *obs_output_get_display_name(const char *id)
{
const struct obs_output_info *info = find_output(id);
return (info != NULL) ? info->getname() : NULL;
@ -146,7 +146,7 @@ void obs_output_destroy(obs_output_t output)
}
}
const char *obs_output_getname(obs_output_t output)
const char *obs_output_get_name(obs_output_t output)
{
return output ? output->context.name : NULL;
}

View File

@ -223,8 +223,8 @@ static void calculate_bounds_data(struct obs_scene_item *item,
static void update_item_transform(struct obs_scene_item *item)
{
uint32_t width = obs_source_getwidth(item->source);
uint32_t height = obs_source_getheight(item->source);
uint32_t width = obs_source_get_width(item->source);
uint32_t height = obs_source_get_height(item->source);
uint32_t cx = width;
uint32_t cy = height;
struct vec2 base_origin;
@ -291,8 +291,8 @@ static void update_item_transform(struct obs_scene_item *item)
static inline bool source_size_changed(struct obs_scene_item *item)
{
uint32_t width = obs_source_getwidth(item->source);
uint32_t height = obs_source_getheight(item->source);
uint32_t width = obs_source_get_width(item->source);
uint32_t height = obs_source_get_height(item->source);
return item->last_width != width || item->last_height != height;
}
@ -388,7 +388,7 @@ static void scene_load(void *scene, obs_data_t settings)
static void scene_save_item(obs_data_array_t array, struct obs_scene_item *item)
{
obs_data_t item_data = obs_data_create();
const char *name = obs_source_getname(item->source);
const char *name = obs_source_get_name(item->source);
obs_data_setstring(item_data, "name", name);
obs_data_setbool (item_data, "visible", item->visible);
@ -471,12 +471,12 @@ void obs_scene_release(obs_scene_t scene)
obs_source_release(scene->source);
}
obs_source_t obs_scene_getsource(obs_scene_t scene)
obs_source_t obs_scene_get_source(obs_scene_t scene)
{
return scene ? scene->source : NULL;
}
obs_scene_t obs_scene_fromsource(obs_source_t source)
obs_scene_t obs_scene_from_source(obs_source_t source)
{
if (!source || source->info.id != scene_info.id)
return NULL;

View File

@ -27,7 +27,7 @@ const struct obs_service_info *find_service(const char *id)
return NULL;
}
const char *obs_service_getdisplayname(const char *id)
const char *obs_service_get_display_name(const char *id)
{
const struct obs_service_info *info = find_service(id);
return (info != NULL) ? info->getname() : NULL;
@ -96,7 +96,7 @@ void obs_service_destroy(obs_service_t service)
}
}
const char *obs_service_getname(obs_service_t service)
const char *obs_service_get_name(obs_service_t service)
{
return service ? service->context.name : NULL;
}

View File

@ -95,7 +95,8 @@ bool obs_source_init_context(struct obs_source *source,
source_signals);
}
const char *obs_source_getdisplayname(enum obs_source_type type, const char *id)
const char *obs_source_get_display_name(enum obs_source_type type,
const char *id)
{
const struct obs_source_info *info = get_source_info(type, id);
return (info != NULL) ? info->getname() : NULL;
@ -1109,7 +1110,7 @@ void obs_source_video_render(obs_source_t source)
obs_source_render_async_video(source);
}
uint32_t obs_source_getwidth(obs_source_t source)
uint32_t obs_source_get_width(obs_source_t source)
{
if (!source_valid(source)) return 0;
@ -1118,7 +1119,7 @@ uint32_t obs_source_getwidth(obs_source_t source)
return source->async_width;
}
uint32_t obs_source_getheight(obs_source_t source)
uint32_t obs_source_get_height(obs_source_t source)
{
if (!source_valid(source)) return 0;
@ -1127,12 +1128,12 @@ uint32_t obs_source_getheight(obs_source_t source)
return source->async_height;
}
obs_source_t obs_filter_getparent(obs_source_t filter)
obs_source_t obs_filter_get_parent(obs_source_t filter)
{
return filter ? filter->filter_parent : NULL;
}
obs_source_t obs_filter_gettarget(obs_source_t filter)
obs_source_t obs_filter_get_target(obs_source_t filter)
{
return filter ? filter->filter_target : NULL;
}
@ -1189,7 +1190,7 @@ void obs_source_filter_remove(obs_source_t source, obs_source_t filter)
filter->filter_target = NULL;
}
void obs_source_filter_setorder(obs_source_t source, obs_source_t filter,
void obs_source_filter_set_order(obs_source_t source, obs_source_t filter,
enum obs_order_movement movement)
{
size_t idx, i;
@ -1230,7 +1231,7 @@ void obs_source_filter_setorder(obs_source_t source, obs_source_t filter,
}
}
obs_data_t obs_source_getsettings(obs_source_t source)
obs_data_t obs_source_get_settings(obs_source_t source)
{
if (!source) return NULL;
@ -1615,12 +1616,12 @@ void obs_source_release_frame(obs_source_t source,
}
}
const char *obs_source_getname(obs_source_t source)
const char *obs_source_get_name(obs_source_t source)
{
return source ? source->context.name : NULL;
}
void obs_source_setname(obs_source_t source, const char *name)
void obs_source_set_name(obs_source_t source, const char *name)
{
if (!source) return;
@ -1696,12 +1697,12 @@ void obs_source_process_filter(obs_source_t filter, effect_t effect,
if (!filter) return;
target = obs_filter_gettarget(filter);
parent = obs_filter_getparent(filter);
target = obs_filter_get_target(filter);
parent = obs_filter_get_parent(filter);
target_flags = target->info.output_flags;
parent_flags = parent->info.output_flags;
cx = obs_source_getwidth(target);
cy = obs_source_getheight(target);
cx = obs_source_get_width(target);
cy = obs_source_get_height(target);
use_matrix = !!(target_flags & OBS_SOURCE_COLOR_MATRIX);
expects_def = !(parent_flags & OBS_SOURCE_CUSTOM_DRAW);
can_directly = allow_direct == OBS_ALLOW_DIRECT_RENDERING;
@ -1744,7 +1745,7 @@ proc_handler_t obs_source_prochandler(obs_source_t source)
return source ? source->context.procs : NULL;
}
void obs_source_setvolume(obs_source_t source, float volume)
void obs_source_set_volume(obs_source_t source, float volume)
{
if (source) {
struct calldata data = {0};
@ -1784,7 +1785,7 @@ void obs_source_set_present_volume(obs_source_t source, float volume)
}
}
float obs_source_getvolume(obs_source_t source)
float obs_source_get_volume(obs_source_t source)
{
return source ? source->user_volume : 0.0f;
}

View File

@ -63,7 +63,7 @@ void obs_view_destroy(obs_view_t view)
}
}
obs_source_t obs_view_getsource(obs_view_t view, uint32_t channel)
obs_source_t obs_view_get_source(obs_view_t view, uint32_t channel)
{
obs_source_t source;
assert(channel < MAX_CHANNELS);
@ -82,7 +82,7 @@ obs_source_t obs_view_getsource(obs_view_t view, uint32_t channel)
return source;
}
void obs_view_setsource(obs_view_t view, uint32_t channel,
void obs_view_set_source(obs_view_t view, uint32_t channel,
obs_source_t source)
{
struct obs_source *prev_source;

View File

@ -912,7 +912,7 @@ bool obs_add_source(obs_source_t source)
obs_source_t obs_get_output_source(uint32_t channel)
{
if (!obs) return NULL;
return obs_view_getsource(&obs->data.main_view, channel);
return obs_view_get_source(&obs->data.main_view, channel);
}
void obs_set_output_source(uint32_t channel, obs_source_t source)
@ -1170,7 +1170,7 @@ obs_source_t obs_load_source(obs_data_t source_data)
obs_data_set_default_double(source_data, "volume", 1.0);
volume = obs_data_getdouble(source_data, "volume");
obs_source_setvolume(source, (float)volume);
obs_source_set_volume(source, (float)volume);
obs_data_release(settings);
@ -1208,9 +1208,9 @@ void obs_load_sources(obs_data_array_t array)
obs_data_t obs_save_source(obs_source_t source)
{
obs_data_t source_data = obs_data_create();
obs_data_t settings = obs_source_getsettings(source);
float volume = obs_source_getvolume(source);
const char *name = obs_source_getname(source);
obs_data_t settings = obs_source_get_settings(source);
float volume = obs_source_get_volume(source);
const char *name = obs_source_get_name(source);
const char *id = obs_source_get_id(source);
obs_source_save(source);

View File

@ -517,11 +517,11 @@ EXPORT obs_view_t obs_view_create(void);
EXPORT void obs_view_destroy(obs_view_t view);
/** Sets the source to be used for this view context. */
EXPORT void obs_view_setsource(obs_view_t view, uint32_t channel,
EXPORT void obs_view_set_source(obs_view_t view, uint32_t channel,
obs_source_t source);
/** Gets the source currently in use for this view context */
EXPORT obs_source_t obs_view_getsource(obs_view_t view,
EXPORT obs_source_t obs_view_get_source(obs_view_t view,
uint32_t channel);
/** Renders the sources of this view context */
@ -568,7 +568,7 @@ EXPORT void obs_display_remove_draw_callback(obs_display_t display,
/* Sources */
/** Returns the translated display name of a source */
EXPORT const char *obs_source_getdisplayname(enum obs_source_type type,
EXPORT const char *obs_source_get_display_name(enum obs_source_type type,
const char *id);
/**
@ -619,16 +619,16 @@ EXPORT void obs_source_update(obs_source_t source, obs_data_t settings);
EXPORT void obs_source_video_render(obs_source_t source);
/** Gets the width of a source (if it has video) */
EXPORT uint32_t obs_source_getwidth(obs_source_t source);
EXPORT uint32_t obs_source_get_width(obs_source_t source);
/** Gets the height of a source (if it has video) */
EXPORT uint32_t obs_source_getheight(obs_source_t source);
EXPORT uint32_t obs_source_get_height(obs_source_t source);
/** If the source is a filter, returns the parent source of the filter */
EXPORT obs_source_t obs_filter_getparent(obs_source_t filter);
EXPORT obs_source_t obs_filter_get_parent(obs_source_t filter);
/** If the source is a filter, returns the target source of the filter */
EXPORT obs_source_t obs_filter_gettarget(obs_source_t filter);
EXPORT obs_source_t obs_filter_get_target(obs_source_t filter);
/** Adds a filter to the source (which is used whenever the source is used) */
EXPORT void obs_source_filter_add(obs_source_t source, obs_source_t filter);
@ -637,17 +637,17 @@ EXPORT void obs_source_filter_add(obs_source_t source, obs_source_t filter);
EXPORT void obs_source_filter_remove(obs_source_t source, obs_source_t filter);
/** Modifies the order of a specific filter */
EXPORT void obs_source_filter_setorder(obs_source_t source, obs_source_t filter,
enum obs_order_movement movement);
EXPORT void obs_source_filter_set_order(obs_source_t source,
obs_source_t filter, enum obs_order_movement movement);
/** Gets the settings string for a source */
EXPORT obs_data_t obs_source_getsettings(obs_source_t source);
EXPORT obs_data_t obs_source_get_settings(obs_source_t source);
/** Gets the name of a source */
EXPORT const char *obs_source_getname(obs_source_t source);
EXPORT const char *obs_source_get_name(obs_source_t source);
/** Sets the name of a source */
EXPORT void obs_source_setname(obs_source_t source, const char *name);
EXPORT void obs_source_set_name(obs_source_t source, const char *name);
/** Gets the source type */
EXPORT enum obs_source_type obs_source_get_type(obs_source_t source);
@ -662,13 +662,13 @@ EXPORT signal_handler_t obs_source_signalhandler(obs_source_t source);
EXPORT proc_handler_t obs_source_prochandler(obs_source_t source);
/** Sets the user volume for a source that has audio output */
EXPORT void obs_source_setvolume(obs_source_t source, float volume);
EXPORT void obs_source_set_volume(obs_source_t source, float volume);
/** Sets the presentation volume for a source */
EXPORT void obs_source_set_present_volume(obs_source_t source, float volume);
/** Gets the user volume for a source that has audio output */
EXPORT float obs_source_getvolume(obs_source_t source);
EXPORT float obs_source_get_volume(obs_source_t source);
/** Gets the presentation volume for a source */
EXPORT float obs_source_get_present_volume(obs_source_t source);
@ -773,10 +773,10 @@ EXPORT void obs_scene_addref(obs_scene_t scene);
EXPORT void obs_scene_release(obs_scene_t scene);
/** Gets the scene's source context */
EXPORT obs_source_t obs_scene_getsource(obs_scene_t scene);
EXPORT obs_source_t obs_scene_get_source(obs_scene_t scene);
/** Gets the scene from its source, or NULL if not a scene */
EXPORT obs_scene_t obs_scene_fromsource(obs_source_t source);
EXPORT obs_scene_t obs_scene_from_source(obs_source_t source);
/** Determines whether a source is within a scene */
EXPORT obs_sceneitem_t obs_scene_find_source(obs_scene_t scene,
@ -845,7 +845,7 @@ EXPORT void obs_sceneitem_get_box_transform(obs_sceneitem_t item,
/* ------------------------------------------------------------------------- */
/* Outputs */
EXPORT const char *obs_output_getdisplayname(const char *id);
EXPORT const char *obs_output_get_display_name(const char *id);
/**
* Creates an output.
@ -857,7 +857,7 @@ EXPORT obs_output_t obs_output_create(const char *id, const char *name,
obs_data_t settings);
EXPORT void obs_output_destroy(obs_output_t output);
EXPORT const char *obs_output_getname(obs_output_t output);
EXPORT const char *obs_output_get_name(obs_output_t output);
/** Starts the output. */
EXPORT bool obs_output_start(obs_output_t output);
@ -1027,7 +1027,7 @@ EXPORT obs_encoder_t obs_audio_encoder_create(const char *id, const char *name,
/** Destroys an encoder context */
EXPORT void obs_encoder_destroy(obs_encoder_t encoder);
EXPORT const char *obs_encoder_getname(obs_encoder_t encoder);
EXPORT const char *obs_encoder_get_name(obs_encoder_t encoder);
/** Returns the codec of the encoder */
EXPORT const char *obs_encoder_get_codec(obs_encoder_t encoder);
@ -1088,13 +1088,13 @@ EXPORT void obs_free_encoder_packet(struct encoder_packet *packet);
/* ------------------------------------------------------------------------- */
/* Stream Services */
EXPORT const char *obs_service_getdisplayname(const char *id);
EXPORT const char *obs_service_get_display_name(const char *id);
EXPORT obs_service_t obs_service_create(const char *id, const char *name,
obs_data_t settings);
EXPORT void obs_service_destroy(obs_service_t service);
EXPORT const char *obs_service_getname(obs_service_t service);
EXPORT const char *obs_service_get_name(obs_service_t service);
/** Gets the default settings for a service */
EXPORT obs_data_t obs_service_defaults(const char *id);

View File

@ -89,7 +89,7 @@ void VolControl::SliderChanged(int vol)
signal_handler_disconnect(obs_source_signalhandler(source),
"volume", OBSVolumeChanged, this);
obs_source_setvolume(source, float(vol)*0.01f);
obs_source_set_volume(source, float(vol)*0.01f);
signal_handler_connect(obs_source_signalhandler(source),
"volume", OBSVolumeChanged, this);
@ -117,7 +117,7 @@ VolControl::VolControl(OBSSource source_)
{
QVBoxLayout *mainLayout = new QVBoxLayout();
QHBoxLayout *textLayout = new QHBoxLayout();
int vol = int(obs_source_getvolume(source) * 100.0f);
int vol = int(obs_source_get_volume(source) * 100.0f);
nameLabel = new QLabel();
volLabel = new QLabel();
@ -127,7 +127,7 @@ VolControl::VolControl(OBSSource source_)
QFont font = nameLabel->font();
font.setPointSize(font.pointSize()-1);
nameLabel->setText(obs_source_getname(source));
nameLabel->setText(obs_source_get_name(source));
nameLabel->setFont(font);
volLabel->setText(QString::number(vol));
volLabel->setFont(font);

View File

@ -136,7 +136,7 @@ static obs_data_t GenerateSaveData()
obs_data_t saveData = obs_data_create();
obs_data_array_t sourcesArray = obs_save_sources();
obs_source_t currentScene = obs_get_output_source(0);
const char *sceneName = obs_source_getname(currentScene);
const char *sceneName = obs_source_get_name(currentScene);
SaveAudioDevice(DESKTOP_AUDIO_1, 1, saveData);
SaveAudioDevice(DESKTOP_AUDIO_2, 2, saveData);
@ -194,7 +194,7 @@ static void LoadAudioDevice(const char *name, int channel, obs_data_t parent)
void OBSBasic::CreateDefaultScene()
{
obs_scene_t scene = obs_scene_create(Str("Basic.Scene"));
obs_source_t source = obs_scene_getsource(scene);
obs_source_t source = obs_scene_get_source(scene);
obs_add_source(source);
@ -209,7 +209,7 @@ void OBSBasic::CreateDefaultScene()
}
#endif
obs_set_output_source(0, obs_scene_getsource(scene));
obs_set_output_source(0, obs_scene_get_source(scene));
obs_scene_release(scene);
}
@ -630,7 +630,7 @@ void OBSBasic::UpdateSources(OBSScene scene)
void OBSBasic::InsertSceneItem(obs_sceneitem_t item)
{
obs_source_t source = obs_sceneitem_get_source(item);
const char *name = obs_source_getname(source);
const char *name = obs_source_get_name(source);
QListWidgetItem *listItem = new QListWidgetItem(QT_UTF8(name));
listItem->setFlags(listItem->flags() | Qt::ItemIsEditable);
@ -659,8 +659,8 @@ void OBSBasic::CreatePropertiesWindow(obs_source_t source)
void OBSBasic::AddScene(OBSSource source)
{
const char *name = obs_source_getname(source);
obs_scene_t scene = obs_scene_fromsource(source);
const char *name = obs_source_get_name(source);
obs_scene_t scene = obs_scene_from_source(source);
QListWidgetItem *item = new QListWidgetItem(QT_UTF8(name));
item->setFlags(item->flags() | Qt::ItemIsEditable);
@ -684,7 +684,7 @@ void OBSBasic::AddScene(OBSSource source)
void OBSBasic::RemoveScene(OBSSource source)
{
const char *name = obs_source_getname(source);
const char *name = obs_source_get_name(source);
QListWidgetItem *sel = ui->scenes->currentItem();
QList<QListWidgetItem*> items = ui->scenes->findItems(QT_UTF8(name),
@ -738,8 +738,8 @@ void OBSBasic::RemoveSceneItem(OBSSceneItem item)
void OBSBasic::UpdateSceneSelection(OBSSource source)
{
if (source) {
obs_scene_t scene = obs_scene_fromsource(source);
const char *name = obs_source_getname(source);
obs_scene_t scene = obs_scene_from_source(source);
const char *name = obs_source_get_name(source);
if (!scene)
return;
@ -835,7 +835,7 @@ void OBSBasic::DeactivateAudioSource(OBSSource source)
bool OBSBasic::QueryRemoveSource(obs_source_t source)
{
const char *name = obs_source_getname(source);
const char *name = obs_source_get_name(source);
QString text = QTStr("ConfirmRemove.Text");
text.replace("$1", QT_UTF8(name));
@ -960,7 +960,7 @@ void OBSBasic::RemoveSelectedScene()
{
OBSScene scene = GetCurrentScene();
if (scene) {
obs_source_t source = obs_scene_getsource(scene);
obs_source_t source = obs_scene_get_source(scene);
if (QueryRemoveSource(source))
obs_source_remove(source);
}
@ -1003,7 +1003,7 @@ void OBSBasic::SourceAdded(void *data, calldata_t params)
OBSBasic *window = static_cast<OBSBasic*>(data);
obs_source_t source = (obs_source_t)calldata_ptr(params, "source");
if (obs_scene_fromsource(source) != NULL)
if (obs_scene_from_source(source) != NULL)
QMetaObject::invokeMethod(window,
"AddScene",
Q_ARG(OBSSource, OBSSource(source)));
@ -1013,7 +1013,7 @@ void OBSBasic::SourceRemoved(void *data, calldata_t params)
{
obs_source_t source = (obs_source_t)calldata_ptr(params, "source");
if (obs_scene_fromsource(source) != NULL)
if (obs_scene_from_source(source) != NULL)
QMetaObject::invokeMethod(static_cast<OBSBasic*>(data),
"RemoveScene",
Q_ARG(OBSSource, OBSSource(source)));
@ -1297,7 +1297,7 @@ void OBSBasic::ResetAudioDevice(const char *sourceId, const char *deviceName,
source = obs_get_output_source(channel);
if (source) {
settings = obs_source_getsettings(source);
settings = obs_source_get_settings(source);
const char *curId = obs_data_getstring(settings, "device_id");
same = (strcmp(curId, deviceId) == 0);
@ -1427,7 +1427,7 @@ void OBSBasic::on_scenes_currentItemChanged(QListWidgetItem *current,
obs_scene_t scene;
scene = current->data(Qt::UserRole).value<OBSScene>();
source = obs_scene_getsource(scene);
source = obs_scene_get_source(scene);
}
/* TODO: allow transitions */
@ -1496,7 +1496,7 @@ void OBSBasic::on_actionAddScene_triggered()
}
obs_scene_t scene = obs_scene_create(name.c_str());
source = obs_scene_getsource(scene);
source = obs_scene_get_source(scene);
obs_add_source(source);
obs_scene_release(scene);
@ -1507,7 +1507,7 @@ void OBSBasic::on_actionAddScene_triggered()
void OBSBasic::on_actionRemoveScene_triggered()
{
OBSScene scene = GetCurrentScene();
obs_source_t source = obs_scene_getsource(scene);
obs_source_t source = obs_scene_get_source(scene);
if (source && QueryRemoveSource(source))
obs_source_remove(source);
@ -1605,7 +1605,7 @@ QMenu *OBSBasic::CreateAddSourcePopupMenu()
QMenu *popup = new QMenu(QTStr("Add"));
while (obs_enum_input_types(idx++, &type)) {
const char *name = obs_source_getdisplayname(
const char *name = obs_source_get_display_name(
OBS_SOURCE_TYPE_INPUT, type);
if (strcmp(type, "scene") == 0)
@ -1819,7 +1819,7 @@ void OBSBasic::logUploadFinished()
static void RenameListItem(QListWidget *listWidget, obs_source_t source,
const string &name)
{
const char *prevName = obs_source_getname(source);
const char *prevName = obs_source_get_name(source);
obs_source_t foundSource = obs_get_source_by_name(name.c_str());
QListWidgetItem *listItem = listWidget->currentItem();
@ -1828,7 +1828,7 @@ static void RenameListItem(QListWidget *listWidget, obs_source_t source,
obs_source_release(foundSource);
} else {
listItem->setText(QT_UTF8(name.c_str()));
obs_source_setname(source, name.c_str());
obs_source_set_name(source, name.c_str());
}
}
@ -1842,7 +1842,7 @@ void OBSBasic::SceneNameEdited(QWidget *editor,
if (!scene)
return;
obs_source_t source = obs_scene_getsource(scene);
obs_source_t source = obs_scene_get_source(scene);
RenameListItem(ui->scenes, source, text);
UNUSED_PARAMETER(endHint);

View File

@ -275,8 +275,8 @@ static vec2 GetItemSize(obs_sceneitem_t item)
vec2 scale;
obs_sceneitem_get_scale(item, &scale);
size.x = float(obs_source_getwidth(source)) * scale.x;
size.y = float(obs_source_getheight(source)) * scale.y;
size.x = float(obs_source_get_width(source)) * scale.x;
size.y = float(obs_source_get_height(source)) * scale.y;
}
return size;
@ -617,8 +617,8 @@ void OBSBasicPreview::StretchItem(const vec2 &pos)
vec2 baseSize;
vec2_set(&baseSize,
float(obs_source_getwidth(source)),
float(obs_source_getheight(source)));
float(obs_source_get_width(source)),
float(obs_source_get_height(source)));
vec2 size;
vec2_set(&size,br. x - tl.x, br.y - tl.y);

View File

@ -38,7 +38,7 @@ OBSBasicProperties::OBSBasicProperties(QWidget *parent, OBSSource source_)
{
ui->setupUi(this);
OBSData settings = obs_source_getsettings(source);
OBSData settings = obs_source_get_settings(source);
obs_data_release(settings);
view = new OBSPropertiesView(settings,
@ -56,7 +56,7 @@ OBSBasicProperties::OBSBasicProperties(QWidget *parent, OBSSource source_)
resizeTimer = startTimer(100);
});
const char *name = obs_source_getname(source);
const char *name = obs_source_get_name(source);
setWindowTitle(QTStr("Basic.PropertiesWindow").arg(QT_UTF8(name)));
}
@ -75,8 +75,8 @@ void OBSBasicProperties::DrawPreview(void *data, uint32_t cx, uint32_t cy)
if (!window->source)
return;
uint32_t sourceCX = max(obs_source_getwidth(window->source), 1u);
uint32_t sourceCY = max(obs_source_getheight(window->source), 1u);
uint32_t sourceCX = max(obs_source_get_width(window->source), 1u);
uint32_t sourceCY = max(obs_source_get_height(window->source), 1u);
int x, y;
int newCX, newCY;

View File

@ -219,7 +219,7 @@ void OBSBasicSettings::LoadServiceTypes()
size_t idx = 0;
while (obs_enum_service_types(idx++, &type)) {
const char *name = obs_service_getdisplayname(type);
const char *name = obs_service_get_display_name(type);
QString qName = QT_UTF8(name);
QString qType = QT_UTF8(type);

View File

@ -24,7 +24,7 @@
bool OBSBasicSourceSelect::EnumSources(void *data, obs_source_t source)
{
OBSBasicSourceSelect *window = static_cast<OBSBasicSourceSelect*>(data);
const char *name = obs_source_getname(source);
const char *name = obs_source_get_name(source);
const char *id = obs_source_get_id(source);
if (strcmp(id, window->id) == 0)
@ -53,7 +53,7 @@ void OBSBasicSourceSelect::OBSSourceRemoved(void *data, calldata_t calldata)
void OBSBasicSourceSelect::SourceAdded(OBSSource source)
{
const char *name = obs_source_getname(source);
const char *name = obs_source_get_name(source);
const char *sourceId = obs_source_get_id(source);
if (strcmp(sourceId, id) != 0)
@ -64,7 +64,7 @@ void OBSBasicSourceSelect::SourceAdded(OBSSource source)
void OBSBasicSourceSelect::SourceRemoved(OBSSource source)
{
const char *name = obs_source_getname(source);
const char *name = obs_source_get_name(source);
const char *sourceId = obs_source_get_id(source);
if (strcmp(sourceId, id) != 0)
@ -82,7 +82,7 @@ void OBSBasicSourceSelect::SourceRemoved(OBSSource source)
static void AddExisting(const char *name)
{
obs_source_t source = obs_get_output_source(0);
obs_scene_t scene = obs_scene_fromsource(source);
obs_scene_t scene = obs_scene_from_source(source);
if (!scene)
return;
@ -98,7 +98,7 @@ static void AddExisting(const char *name)
bool AddNew(QWidget *parent, const char *id, const char *name)
{
obs_source_t source = obs_get_output_source(0);
obs_scene_t scene = obs_scene_fromsource(source);
obs_scene_t scene = obs_scene_from_source(source);
bool success = false;
if (!source)
return false;
@ -164,7 +164,7 @@ OBSBasicSourceSelect::OBSBasicSourceSelect(OBSBasic *parent, const char *id_)
{
ui->setupUi(this);
QString placeHolderText{QT_UTF8(obs_source_getdisplayname(
QString placeHolderText{QT_UTF8(obs_source_get_display_name(
OBS_SOURCE_TYPE_INPUT, id))};
QString text{placeHolderText};

View File

@ -66,7 +66,7 @@ void OBSBasicTransform::SetScene(OBSScene scene)
removeSignal.Disconnect();
if (scene) {
OBSSource source = obs_scene_getsource(scene);
OBSSource source = obs_scene_get_source(scene);
signal_handler_t signal = obs_source_signalhandler(source);
transformSignal.Connect(signal, "item_transform",
@ -102,7 +102,7 @@ void OBSBasicTransform::OBSChannelChanged(void *param, calldata_t data)
OBSSource source = (obs_source_t)calldata_ptr(data, "source");
if (channel == 0) {
OBSScene scene = obs_scene_fromsource(source);
OBSScene scene = obs_scene_from_source(source);
window->SetScene(scene);
if (!scene)
@ -184,8 +184,8 @@ void OBSBasicTransform::RefreshControls()
obs_sceneitem_get_info(item, &osi);
obs_source_t source = obs_sceneitem_get_source(item);
float width = float(obs_source_getwidth(source));
float height = float(obs_source_getheight(source));
float width = float(obs_source_get_width(source));
float height = float(obs_source_get_height(source));
int alignIndex = AlignToList(osi.alignment);
int boundsAlignIndex = AlignToList(osi.bounds_alignment);
@ -221,8 +221,8 @@ void OBSBasicTransform::OnBoundsType(int index)
obs_bounds_type lastType = obs_sceneitem_get_bounds_type(item);
if (lastType == OBS_BOUNDS_NONE) {
OBSSource source = obs_sceneitem_get_source(item);
int width = (int)obs_source_getwidth(source);
int height = (int)obs_source_getheight(source);
int width = (int)obs_source_get_width(source);
int height = (int)obs_source_get_height(source);
ui->boundsWidth->setValue(width);
ui->boundsHeight->setValue(height);
@ -238,8 +238,8 @@ void OBSBasicTransform::OnControlChanged()
return;
obs_source_t source = obs_sceneitem_get_source(item);
double width = double(obs_source_getwidth(source));
double height = double(obs_source_getheight(source));
double width = double(obs_source_get_width(source));
double height = double(obs_source_get_height(source));
obs_transform_info oti;
oti.pos.x = float(ui->positionX->value());

View File

@ -2,7 +2,7 @@
#define warn(format, ...) \
blog(LOG_WARNING, "[image_source: '%s'] " format, \
obs_source_getname(context->source), ##__VA_ARGS__)
obs_source_get_name(context->source), ##__VA_ARGS__)
struct image_source {
obs_source_t source;

View File

@ -186,7 +186,7 @@ static int_fast32_t pulse_start_recording(struct pulse_data *data)
data->bytes_per_frame = pa_frame_size(&spec);
data->stream = pulse_stream_new(obs_source_getname(data->source),
data->stream = pulse_stream_new(obs_source_get_name(data->source),
&spec, NULL);
if (!data->stream) {
blog(LOG_ERROR, "pulse-input: Unable to create stream");

View File

@ -32,7 +32,7 @@ struct av_capture;
#define AVLOG(level, format, ...) \
blog(level, "%s: " format, \
obs_source_getname(capture->source), ##__VA_ARGS__)
obs_source_get_name(capture->source), ##__VA_ARGS__)
#define AVFREE(x) {[x release]; x = nil;}

View File

@ -108,7 +108,8 @@ static inline void display_stream_update(struct display_capture *dc,
size_t dropped_frames = CGDisplayStreamUpdateGetDropCount(update_ref);
if (dropped_frames > 0)
blog(LOG_INFO, "%s: Dropped %zu frames",
obs_source_getname(dc->source), dropped_frames);
obs_source_get_name(dc->source),
dropped_frames);
}
static bool init_display_stream(struct display_capture *dc)

View File

@ -28,7 +28,7 @@
#define do_log(level, format, ...) \
blog(level, "[rtmp stream: '%s'] " format, \
obs_output_getname(stream->output), ##__VA_ARGS__)
obs_output_get_name(stream->output), ##__VA_ARGS__)
#define warn(format, ...) do_log(LOG_WARNING, format, ##__VA_ARGS__)
#define info(format, ...) do_log(LOG_INFO, format, ##__VA_ARGS__)

View File

@ -28,7 +28,7 @@
#define do_log(level, format, ...) \
blog(level, "[x264 encoder: '%s'] " format, \
obs_encoder_getname(obsx264->encoder), ##__VA_ARGS__)
obs_encoder_get_name(obsx264->encoder), ##__VA_ARGS__)
#define warn(format, ...) do_log(LOG_WARNING, format, ##__VA_ARGS__)
#define info(format, ...) do_log(LOG_INFO, format, ##__VA_ARGS__)

View File

@ -418,7 +418,7 @@ void DShowInput::Update(obs_data_t settings)
interval = best_interval;
blog(LOG_INFO, "%s: Using interval %lld",
obs_source_getname(source), interval);
obs_source_get_name(source), interval);
}
videoConfig.name = id.name.c_str();

View File

@ -82,7 +82,7 @@ static SceneContext SetupScene()
/* ------------------------------------------------------ */
/* set the scene as the primary draw source and go */
obs_set_output_source(0, obs_scene_getsource(scene));
obs_set_output_source(0, obs_scene_get_source(scene));
return scene;
}

View File

@ -180,7 +180,7 @@ int WINAPI WinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR cmdLine,
/* ------------------------------------------------------ */
/* set the scene as the primary draw source and go */
obs_set_output_source(0, obs_scene_getsource(scene));
obs_set_output_source(0, obs_scene_get_source(scene));
/* ------------------------------------------------------ */
/* set the main output render callback */