mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Merge pull request #97571 from j20001970/camerafeed-virtual
Add `activate_feed` and `deactivate_feed` virtual bind to CameraFeed
This commit is contained in:
commit
d0a0f5834e
3 changed files with 22 additions and 3 deletions
|
@ -11,6 +11,18 @@
|
|||
<tutorials>
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="_activate_feed" qualifiers="virtual">
|
||||
<return type="bool" />
|
||||
<description>
|
||||
Called when the camera feed is activated.
|
||||
</description>
|
||||
</method>
|
||||
<method name="_deactivate_feed" qualifiers="virtual">
|
||||
<return type="void" />
|
||||
<description>
|
||||
Called when the camera feed is deactivated.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_datatype" qualifiers="const">
|
||||
<return type="int" enum="CameraFeed.FeedDataType" />
|
||||
<description>
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -123,6 +123,9 @@ public:
|
|||
|
||||
virtual bool activate_feed();
|
||||
virtual void deactivate_feed();
|
||||
|
||||
GDVIRTUAL0R(bool, _activate_feed)
|
||||
GDVIRTUAL0(_deactivate_feed)
|
||||
};
|
||||
|
||||
VARIANT_ENUM_CAST(CameraFeed::FeedDataType);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue