2024-09-15 11:39:23 +02:00
|
|
|
#pragma once
|
|
|
|
|
2024-09-16 20:24:07 +02:00
|
|
|
//#include <solanaceae/object_store/fwd.hpp>
|
|
|
|
#include <solanaceae/object_store/object_store.hpp>
|
2024-09-15 11:39:23 +02:00
|
|
|
#include "./tox_av.hpp"
|
|
|
|
#include "./texture_uploader.hpp"
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <cstdint>
|
|
|
|
|
|
|
|
class DebugToxCall : public ToxAVEventI {
|
|
|
|
ObjectStore2& _os;
|
|
|
|
ToxAV& _toxav;
|
|
|
|
TextureUploaderI& _tu;
|
|
|
|
|
|
|
|
struct Call {
|
|
|
|
bool incoming {false};
|
|
|
|
bool incoming_a {false};
|
|
|
|
bool incoming_v {false};
|
|
|
|
|
|
|
|
uint32_t state {0}; // ? just last state ?
|
|
|
|
|
2024-09-16 20:24:07 +02:00
|
|
|
uint32_t incomming_abr {0};
|
|
|
|
uint32_t incomming_vbr {0};
|
2024-09-15 11:39:23 +02:00
|
|
|
|
|
|
|
size_t num_a_frames {0};
|
|
|
|
size_t num_v_frames {0};
|
|
|
|
|
2024-09-16 20:24:07 +02:00
|
|
|
ObjectHandle incoming_vsrc;
|
|
|
|
ObjectHandle incoming_asrc;
|
2024-09-15 11:39:23 +02:00
|
|
|
|
2024-09-16 20:24:07 +02:00
|
|
|
ObjectHandle outgoing_vsink;
|
|
|
|
ObjectHandle outgoing_asink;
|
2024-09-15 11:39:23 +02:00
|
|
|
};
|
|
|
|
// tox friend id -> call
|
|
|
|
std::map<uint32_t, Call> _calls;
|
|
|
|
|
|
|
|
public:
|
|
|
|
DebugToxCall(ObjectStore2& os, ToxAV& toxav, TextureUploaderI& tu);
|
2024-09-18 16:40:44 +02:00
|
|
|
~DebugToxCall(void);
|
2024-09-15 11:39:23 +02:00
|
|
|
|
|
|
|
void tick(float time_delta);
|
|
|
|
float render(void);
|
|
|
|
|
|
|
|
protected: // toxav events
|
|
|
|
bool onEvent(const Events::FriendCall&) override;
|
|
|
|
bool onEvent(const Events::FriendCallState&) override;
|
|
|
|
bool onEvent(const Events::FriendAudioBitrate&) override;
|
|
|
|
bool onEvent(const Events::FriendVideoBitrate&) override;
|
|
|
|
bool onEvent(const Events::FriendAudioFrame&) override;
|
|
|
|
bool onEvent(const Events::FriendVideoFrame&) override;
|
|
|
|
};
|