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

Add get_buffered_amount() to WebRTCDataChannel (Godot 3.x) #50659

Merged
merged 1 commit into from Jul 21, 2021

Conversation

dsnopek
Copy link
Contributor

@dsnopek dsnopek commented Jul 20, 2021

Godot 3.x version of PR #50658

@Faless
Copy link
Collaborator

Faless commented Jul 20, 2021

If we want to backport this cleanly to 3.x (i.e. without breaking GDNative compatibility) we should probably use the next field:
https://github.com/godotengine/godot/blob/58ec58d5d0435d52c1a01ffeece35799ba3da533/modules/gdnative/include/net/godot_webrtc.h#L108-L110

And add a new godot_net_webrtc_peer_connection_ext struct with the new function, and a next pointer.
The plugin will then add the extra struct to the next pointer.

That way the old version of the plugin would still work with the new version of the engine.

@dsnopek
Copy link
Contributor Author

dsnopek commented Jul 20, 2021

Oh, cool! I didn't realize there was a mechanism in place for this. :-) I'll update this PR and the gdnative one to use that approach.

@dsnopek dsnopek force-pushed the webrtc-get-buffered-amount-3.x branch from 58ec58d to 5b2dcc5 Compare July 20, 2021 21:52
@dsnopek
Copy link
Contributor Author

dsnopek commented Jul 20, 2021

PR is now updated to preserve backcompat!

Copy link
Collaborator

@Faless Faless left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job!

@Faless Faless merged commit 7c4cc42 into godotengine:3.x Jul 21, 2021
@Faless
Copy link
Collaborator

Faless commented Jul 21, 2021

Thanks!

@dsnopek
Copy link
Contributor Author

dsnopek commented Jul 21, 2021

Thanks for the review and speedy merge! :-)

I've made a PR to godot-headers that should allow the official GDNative plugin to build:

godotengine/godot-headers#94

@Faless
Copy link
Collaborator

Faless commented Jul 21, 2021

Yeah, I was actually too hasty :(.
#define GODOT_NET_WEBRTC_API_MINOR should have been updated to 4 with this change.

And the master one should have been updated to:
#define GODOT_NET_WEBRTC_API_MAJOR 4
#define GODOT_NET_WEBRTC_API_MINOR 0

@dsnopek
Copy link
Contributor Author

dsnopek commented Jul 21, 2021

I just created these two PRs to fix those #define's:

akien-mga added a commit that referenced this pull request Jul 22, 2021
Update GDNative API version for changes from #50659
akien-mga added a commit that referenced this pull request Jul 22, 2021
Update GDNative API version for changes from #50659 (Godot 3.x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants