Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor detector's name #16

Merged
merged 1 commit into from
Oct 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
feature: ['feature/*', 'feat/*', 'feature-*', 'feat-*']
bug: ['fix/*', 'fix-*']
chore: ['chore/*', 'chore-*']
refactor: ['refactor/*', 'refactoring/*', 'refactor-*', 'refactoring-*']
2 changes: 2 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ categories:
- 'bug'
- title: '🧰 Maintenance'
label: 'chore'
- title: '🔧 Refactoring'
label: 'refactor'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
version-resolver:
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ set(RELEASE_DIR "${PROJECT_SOURCE_DIR}/Release" CACHE STRING "Directory for buil

set(SOURCES
src/plugin.cpp
src/obs-virtualbg.cpp
src/obs-virtualbg-detector.cpp
src/obs-virtualbg-render.cpp
)

Expand Down
26 changes: 13 additions & 13 deletions src/obs-virtualbg.cpp → src/obs-virtualbg-detector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ struct virtual_bg_filter_data {

float lut[256];

const char *virtual_bg_get_name(void *data) {
const char *detector_get_name(void *data) {
UNUSED_PARAMETER(data);
return obs_module_text("VirtualBackGroundDetectorFilter");
}

void virtual_bg_destroy(void *data) {
blog(LOG_INFO, "virtual_bg_destroy");
void detector_destroy(void *data) {
blog(LOG_INFO, "detector_destroy");
virtual_bg_filter_data *filter_data = static_cast<virtual_bg_filter_data *>(data);
if (filter_data == NULL) {
return;
Expand All @@ -51,13 +51,13 @@ void virtual_bg_destroy(void *data) {
bfree(filter_data);
}

void virtual_bg_update(void *data, obs_data_t *settings) {
void detector_update(void *data, obs_data_t *settings) {
virtual_bg_filter_data *filter_data = static_cast<virtual_bg_filter_data *>(data);
if (filter_data == NULL) {
return;
}
UNUSED_PARAMETER(settings);
blog(LOG_INFO, "virtual_bg_update");
blog(LOG_INFO, "detector_update");

Ort::SessionOptions sessionOptions;

Expand Down Expand Up @@ -112,8 +112,8 @@ void virtual_bg_update(void *data, obs_data_t *settings) {
blog(LOG_INFO, "vitual_bg_update done.");
}

void *virtual_bg_create(obs_data_t *settings, obs_source_t *source) {
blog(LOG_INFO, "Start virtual_bg_create");
void *detector_create(obs_data_t *settings, obs_source_t *source) {
blog(LOG_INFO, "Start detector_create");
UNUSED_PARAMETER(settings);
struct virtual_bg_filter_data *filter_data =
reinterpret_cast<virtual_bg_filter_data *>(bzalloc(sizeof(struct virtual_bg_filter_data)));
Expand All @@ -127,8 +127,8 @@ void *virtual_bg_create(obs_data_t *settings, obs_source_t *source) {
}
blog(LOG_INFO, "ORT Session Created");

blog(LOG_INFO, "virtual_bg_create");
virtual_bg_update(filter_data, settings);
blog(LOG_INFO, "detector_create");
detector_update(filter_data, settings);
if (filter_data->feedback_buffer) {
bfree(filter_data->feedback_buffer);
}
Expand All @@ -142,7 +142,7 @@ void *virtual_bg_create(obs_data_t *settings, obs_source_t *source) {
return filter_data;
}

struct obs_source_frame *virtual_bg_filter_video(void *data, struct obs_source_frame *frame) {
struct obs_source_frame *detector_filter_video(void *data, struct obs_source_frame *frame) {
auto start = std::chrono::high_resolution_clock::now();
virtual_bg_filter_data *filter_data = static_cast<virtual_bg_filter_data *>(data);
if (filter_data == NULL) {
Expand Down Expand Up @@ -213,8 +213,8 @@ struct obs_source_frame *virtual_bg_filter_video(void *data, struct obs_source_f
return frame;
}

struct obs_source_info obs_virtualbg_source_info {
struct obs_source_info obs_virtualbg_detector_source_info {
.id = "virtualbg", .type = OBS_SOURCE_TYPE_FILTER, .output_flags = OBS_SOURCE_ASYNC_VIDEO,
.get_name = virtual_bg_get_name, .create = virtual_bg_create, .destroy = virtual_bg_destroy,
.update = virtual_bg_update, .filter_video = virtual_bg_filter_video
.get_name = detector_get_name, .create = detector_create, .destroy = detector_destroy,
.update = detector_update, .filter_video = detector_filter_video
};
4 changes: 2 additions & 2 deletions src/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ void delete_mask_data(obs_source_t *source) {
}
}

extern struct obs_source_info obs_virtualbg_source_info;
extern struct obs_source_info obs_virtualbg_detector_source_info;
extern struct obs_source_info obs_virtualbg_render_source_info;

bool obs_module_load(void) {
obs_register_source(&obs_virtualbg_source_info);
obs_register_source(&obs_virtualbg_detector_source_info);
obs_register_source(&obs_virtualbg_render_source_info);
return true;
}
Expand Down