mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-26 20:25:34 +08:00
Opus codec module test pass
This commit is contained in:
@@ -5,17 +5,19 @@
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
|
||||
#include "audio_decoder.h"
|
||||
#include "audio_encoder.h"
|
||||
#include "ice_transmission.h"
|
||||
#include "video_decoder_factory.h"
|
||||
#include "video_encoder_factory.h"
|
||||
#include "ws_transmission.h"
|
||||
#include "x.h"
|
||||
|
||||
enum SignalStatus { SignalConnecting = 0, SignalConnected, SignalClosed };
|
||||
|
||||
typedef void (*OnReceiveBuffer)(const char *, size_t, const char *,
|
||||
const size_t);
|
||||
|
||||
typedef void (*OnSignalStatus)(SignalStatus status);
|
||||
|
||||
typedef void (*OnConnectionStatus)(ConnectionStatus status);
|
||||
|
||||
typedef void (*NetStatusReport)(const unsigned short, const unsigned short);
|
||||
@@ -25,6 +27,7 @@ typedef struct {
|
||||
OnReceiveBuffer on_receive_video_buffer;
|
||||
OnReceiveBuffer on_receive_audio_buffer;
|
||||
OnReceiveBuffer on_receive_data_buffer;
|
||||
OnSignalStatus on_signal_status;
|
||||
OnConnectionStatus on_connection_status;
|
||||
NetStatusReport net_status_report;
|
||||
} PeerConnectionParams;
|
||||
@@ -56,6 +59,7 @@ class PeerConnection {
|
||||
|
||||
private:
|
||||
int CreateVideoCodec(bool hardware_acceleration);
|
||||
int CreateAudioCodec();
|
||||
|
||||
void ProcessSignal(const std::string &signal);
|
||||
|
||||
@@ -81,12 +85,14 @@ class PeerConnection {
|
||||
private:
|
||||
std::shared_ptr<WsTransmission> ws_transport_ = nullptr;
|
||||
std::function<void(const std::string &)> on_receive_ws_msg_ = nullptr;
|
||||
std::function<void(WsStatus)> on_ws_status_ = nullptr;
|
||||
unsigned int ws_connection_id_ = 0;
|
||||
std::string user_id_ = "";
|
||||
std::string transmission_id_ = "";
|
||||
std::vector<std::string> user_id_list_;
|
||||
SignalStatus signal_status_ = SignalStatus::SignalClosed;
|
||||
std::mutex signal_status_mutex_;
|
||||
bool leave_ = false;
|
||||
|
||||
private:
|
||||
std::map<std::string, std::unique_ptr<IceTransmission>>
|
||||
@@ -103,6 +109,7 @@ class PeerConnection {
|
||||
OnReceiveBuffer on_receive_video_buffer_;
|
||||
OnReceiveBuffer on_receive_audio_buffer_;
|
||||
OnReceiveBuffer on_receive_data_buffer_;
|
||||
OnSignalStatus on_signal_status_;
|
||||
OnConnectionStatus on_connection_status_;
|
||||
char *nv12_data_ = nullptr;
|
||||
bool inited_ = false;
|
||||
@@ -114,6 +121,10 @@ class PeerConnection {
|
||||
bool hardware_accelerated_encode_ = false;
|
||||
bool hardware_accelerated_decode_ = false;
|
||||
bool b_force_i_frame_ = false;
|
||||
|
||||
private:
|
||||
std::unique_ptr<AudioEncoder> audio_encoder_ = nullptr;
|
||||
std::unique_ptr<AudioDecoder> audio_decoder_ = nullptr;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user