Add activate_feed and deactivate_feed virtual bind to CameraFeed

This commit is contained in:
Jason Kuo
2024-09-28 13:02:09 +08:00
parent 4364ed6ccd
commit 3720de4b6f
3 changed files with 22 additions and 3 deletions

View File

@@ -58,6 +58,9 @@ void CameraFeed::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_formats"), &CameraFeed::get_formats);
ClassDB::bind_method(D_METHOD("set_format", "index", "parameters"), &CameraFeed::set_format);
GDVIRTUAL_BIND(_activate_feed);
GDVIRTUAL_BIND(_deactivate_feed);
ADD_SIGNAL(MethodInfo("frame_changed"));
ADD_SIGNAL(MethodInfo("format_changed"));
@@ -273,12 +276,13 @@ void CameraFeed::set_external(int p_width, int p_height) {
}
bool CameraFeed::activate_feed() {
// nothing to do here
return true;
bool ret = true;
GDVIRTUAL_CALL(_activate_feed, ret);
return ret;
}
void CameraFeed::deactivate_feed() {
// nothing to do here
GDVIRTUAL_CALL(_deactivate_feed);
}
bool CameraFeed::set_format(int p_index, const Dictionary &p_parameters) {