tomato/src/frame_streams/voip_model.hpp

78 lines
1.8 KiB
C++
Raw Normal View History

2024-09-29 13:11:29 +02:00
#pragma once
#include <solanaceae/contact/contact_model3.hpp>
#include <solanaceae/object_store/fwd.hpp>
struct VoIPModelI;
namespace Components::VoIP {
struct TagVoIPSession {};
2024-10-01 11:13:27 +02:00
// getting called or invited by
struct Incoming {
Contact3 c{entt::null};
};
2024-09-29 22:10:20 +02:00
struct DefaultConfig {
bool incoming_audio {true};
bool incoming_video {true};
bool outgoing_audio {true};
bool outgoing_video {true};
};
2024-09-29 13:11:29 +02:00
// to talk to the model handling this session
//struct VoIPModel {
//VoIPModelI* ptr {nullptr};
//};
2024-09-29 13:11:29 +02:00
struct SessionState {
// ????
// incoming
// outgoing
enum class State {
RINGING,
CONNECTED,
} state;
};
struct SessionContact {
Contact3 c{entt::null};
};
struct StreamSources {
// list of all stream sources originating from this VoIP session
std::vector<Object> streams;
};
struct StreamSinks {
// list of all stream sinks going to this VoIP session
std::vector<Object> streams;
};
} // Components::VoIP
// TODO: events? piggyback on objects?
// stream model instead?? -> more generic than "just" audio and video?
// or specialized like this
// streams abstract type in a nice way
struct VoIPModelI {
virtual ~VoIPModelI(void) {}
// enters a call/voicechat/videocall ???
// - contact
// - default stream sources/sinks ?
// - enable a/v ? -> done on connecting to sources
// returns object tieing together the VoIP session
2024-10-01 11:13:27 +02:00
virtual ObjectHandle enter(const Contact3 c, const Components::VoIP::DefaultConfig& defaults = {true, true, true, true}) { (void)c,(void)defaults; return {}; }
2024-09-29 13:11:29 +02:00
// accept/join an invite to a session
2024-10-01 11:13:27 +02:00
virtual bool accept(ObjectHandle session, const Components::VoIP::DefaultConfig& defaults = {true, true, true, true}) { (void)session,(void)defaults; return false; }
2024-09-29 13:11:29 +02:00
// leaves a call
// - VoIP session object
2024-10-01 11:13:27 +02:00
virtual bool leave(ObjectHandle session) { (void)session; return false; }
2024-09-29 13:11:29 +02:00
};