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

Question: Mumble Plugin support? #18

Closed
hbeni opened this issue Dec 23, 2023 · 12 comments
Closed

Question: Mumble Plugin support? #18

hbeni opened this issue Dec 23, 2023 · 12 comments

Comments

@hbeni
Copy link

hbeni commented Dec 23, 2023

Hi,
I‘m very interested about this lib; for integrating the fgcom-mumble plugin directly into flightgear flight simulator.

Is it planned to make an interface to load a compiled plugin into the lib, so it calls the hooks?

@hbeni hbeni changed the title Plugin support? Question: Mumble Plugin support? Dec 23, 2023
@davidebeatrici
Copy link
Member

Hi,

This library can be used to implement your own client/server. The plugin API is part of the official client.

If you need full access to the Mumble protocol, libmumble is the way to go. Basically, you would be loading the library in your application rather than the opposite.

@Krzmbrzl
Copy link
Member

That is to say that currently there are no plans to integrate Mumble's plugin framework into this library. It just doesn't seem like a good fit as this library is meant to implement the low-level of handling the Mumble protocol and client plugins are quite high level and not all downstream users of this library will even want plugin support, I guess 🤔

@hbeni
Copy link
Author

hbeni commented Dec 24, 2023

Thanks for the quick answer!

I understand, but what I still wonder: Does the lib provide some means for example to modify the incoming audio data?
And will it provide a method to send/receive plugin data?

Merry Christmas ☺️🎄

@davidebeatrici
Copy link
Member

davidebeatrici commented Dec 24, 2023

Yes, absolutely. Audio can be decoded/encoded using Opus::Decoder and Opus::Encoder.

MUMBLE_MESSAGE_DECL(Audio) {
enum : uint8_t { Unknown, ClientToServer, ServerToClient } direction;
union {
// Client to server.
uint32_t target = UINT32_MAX;
// Server to client.
uint32_t context;
};
std::optional< uint32_t > senderSession = {};
uint64_t frameNumber = 0;
std::vector< std::byte > opusData = {};
std::vector< float > positionalData = {};
float volumeAdjustment = 0.f;
bool isTerminator = false;
MUMBLE_MESSAGE_COMMON(Audio)
};

As for sending/receiving plugin data:

std::vector< std::byte > pluginContext = {};
std::string pluginIdentity = {};

MUMBLE_MESSAGE_DECL(PluginDataTransmission) {
uint32_t senderSession = UINT32_MAX;
std::vector< uint32_t > receiverSessions = {};
std::vector< std::byte > data = {};
std::string dataID = {};
MUMBLE_MESSAGE_COMMON(PluginDataTransmission)
};

These are all messages you can receive and interpret or construct and send through the library.

Merry Christmas too!

@hbeni
Copy link
Author

hbeni commented Dec 24, 2023

Thank you very much!

How stable is libmumble? Is it a good point in time to start integrating?

And are there examples on how to integrate the lib build/linking to the main application?

@Krzmbrzl
Copy link
Member

It should work but the API is not yet stable. It may be changed without notice or regards for backwards compatibility.

@mumble-voip mumble-voip deleted a comment from Krzmbrzl Dec 24, 2023
@davidebeatrici
Copy link
Member

@Krzmbrzl I deleted your duplicate comment.

@hbeni Examples can currently be found in the examples directory.

@hbeni
Copy link
Author

hbeni commented Dec 24, 2023

Thanks!

what would be the best way to integrate libmumble into an cmake build setup?

@davidebeatrici
Copy link
Member

davidebeatrici commented Dec 24, 2023

For the time being I would add it as a Git submodule.

In your CMake project you then call add_subdirectory() and link your target to the library using target_link_libraries().

@hbeni hbeni closed this as completed Dec 24, 2023
@Krzmbrzl
Copy link
Member

Krzmbrzl commented Dec 25, 2023

Use FetchContent. That creates fewer hassles than using a submodule in my experience 👀

@hbeni
Copy link
Author

hbeni commented Dec 26, 2023

Ah okay.

and one last question (I hope): how does the lib work overall?
I learned that it will create a threadpool for the tcp/udp data exchange, but am I correct in understanding that

  • for sending audio data, I will just call a lib function and hand over the packets?
  • For receiving audio, the lib will call some callback function which gets the audio data handed over?

@davidebeatrici
Copy link
Member

Correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants