From 9cba1af32a2d2e177d5e10e01ed8fef684e4926d Mon Sep 17 00:00:00 2001 From: Aaro Altonen Date: Wed, 5 Aug 2020 13:03:02 +0300 Subject: [PATCH] Remove Opus code from the project --- include/formats/opus.hh | 22 ------------------ src/formats/module.mk | 1 - src/formats/opus.cc | 51 ----------------------------------------- 3 files changed, 74 deletions(-) delete mode 100644 include/formats/opus.hh delete mode 100644 src/formats/opus.cc diff --git a/include/formats/opus.hh b/include/formats/opus.hh deleted file mode 100644 index bac9cd9..0000000 --- a/include/formats/opus.hh +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once - -#include - -#include "formats/generic.hh" - -namespace uvg_rtp { - - namespace opus { - struct opus_config { - uint32_t samplerate; - uint8_t channels; - uint8_t config_number; - }; - - /* TODO: */ - rtp_error_t push_frame(uvg_rtp::sender *sender, uint8_t *data, uint32_t data_len, int flags); - - /* TODO: */ - rtp_error_t push_frame(uvg_rtp::sender *sender, std::unique_ptr data, uint32_t data_len, int flags); - }; -}; diff --git a/src/formats/module.mk b/src/formats/module.mk index 63c1f0d..7a4802d 100644 --- a/src/formats/module.mk +++ b/src/formats/module.mk @@ -1,6 +1,5 @@ SOURCES += \ src/formats/media.cc \ - src/formats/opus.cc \ src/formats/hevc.cc \ src/formats/hevc_pkt_handler.cc \ src/formats/hevc_recv_optimistic.cc diff --git a/src/formats/opus.cc b/src/formats/opus.cc deleted file mode 100644 index 3968e94..0000000 --- a/src/formats/opus.cc +++ /dev/null @@ -1,51 +0,0 @@ -#if 0 -#include -#include - -#include "debug.hh" -#include "send.hh" - -#include "formats/opus.hh" - -/* Validity of arguments is checked by uvg_rtp::sender. We just need to relay them there */ -rtp_error_t uvg_rtp::opus::push_frame(uvg_rtp::sender *sender, uint8_t *data, uint32_t data_len, int flags) -{ - return uvg_rtp::generic::push_frame(sender, data, data_len, flags); - -#if 0 - rtp_error_t ret; - - if ((ret = uvg_rtp::sender::write_rtp_header(conn, timestamp)) != RTP_OK) { - LOG_ERROR("Failed to write RTP Header for Opus frame!"); - return ret; - } - - return uvg_rtp::sender::write_payload(conn, data, data_len); - - uint8_t buffer[MAX_PACKET] = { 0 }; - RTPOpus::OpusConfig *config = (RTPOpus::OpusConfig *)conn->getConfig(); - - LOG_DEBUG("sending opus packet of size %u", dataLen); - - if (config == nullptr) { - LOG_ERROR("Opus config has not been set!"); - return RTP_INVALID_VALUE; - } - - buffer[0] = (config->configurationNumber << 3) | - (config->channels > 1 ? (1 << 2) : 0) | 0; - - memcpy(&buffer[1], data, dataLen); - - return RTPGeneric::pushGenericFrame(conn, buffer, dataLen + 1, 0); - - conn->setPayloadType(RTP_FORMAT_OPUS); - return RTPGeneric::pushGenericFrame(conn, data, dataLen, 0); -#endif -} - -rtp_error_t uvg_rtp::opus::push_frame(uvg_rtp::sender *sender, std::unique_ptr data, uint32_t data_len, int flags) -{ - return uvg_rtp::generic::push_frame(sender, std::move(data), data_len, flags); -} -#endif