From e7cb77346edd38039ac4b5a120741c4ad8167ead Mon Sep 17 00:00:00 2001 From: Craig Edwards Date: Sat, 5 Oct 2024 18:29:16 +0000 Subject: [PATCH] rename constants and enums --- src/dpp/dave/codec_utils.cpp | 2 +- src/dpp/dave/common.h | 2 +- src/dpp/dave/encryptor.cpp | 2 +- src/dpp/dave/frame_processors.cpp | 14 +++++++------- src/dpp/dave/frame_processors.h | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/dpp/dave/codec_utils.cpp b/src/dpp/dave/codec_utils.cpp index 50f220a210..e8cd21a0bc 100755 --- a/src/dpp/dave/codec_utils.cpp +++ b/src/dpp/dave/codec_utils.cpp @@ -411,7 +411,7 @@ bool process_frame_av1(outbound_frame_processor& processor, array_view frame) { auto codec = processor.get_codec(); - if (codec != codec::H264 && codec != codec::H265) { + if (codec != codec::cd_h264 && codec != codec::cd_h265) { return true; } diff --git a/src/dpp/dave/common.h b/src/dpp/dave/common.h index 7c6635a1cb..f5c16e8953 100755 --- a/src/dpp/dave/common.h +++ b/src/dpp/dave/common.h @@ -48,7 +48,7 @@ using transition_id = uint16_t; using supplemental_bytes_size = uint8_t; enum media_type : uint8_t { media_audio, media_video }; -enum codec : uint8_t { Unknown, Opus, VP8, VP9, H264, H265, AV1 }; +enum codec : uint8_t { cd_unknown, cd_opus, cd_vp8, cd_vp9, cd_h264, cd_h265, cd_av1 }; // Returned in std::variant when a message is hard-rejected and should trigger a reset struct failed_t {}; diff --git a/src/dpp/dave/encryptor.cpp b/src/dpp/dave/encryptor.cpp index 7c66ab2e77..d73f971211 100755 --- a/src/dpp/dave/encryptor.cpp +++ b/src/dpp/dave/encryptor.cpp @@ -258,7 +258,7 @@ codec encryptor::codec_for_ssrc(uint32_t ssrc) return existingCodecIt->second; } else { - return codec::Opus; + return codec::cd_opus; } } diff --git a/src/dpp/dave/frame_processors.cpp b/src/dpp/dave/frame_processors.cpp index 2b96b6ea2d..eb31bf17f7 100755 --- a/src/dpp/dave/frame_processors.cpp +++ b/src/dpp/dave/frame_processors.cpp @@ -324,7 +324,7 @@ void inbound_frame_processor::add_ciphertext_bytes(const uint8_t* data, size_t s void outbound_frame_processor::reset() { - codec_ = codec::Unknown; + codec_ = codec::cd_unknown; frameIndex_ = 0; unencryptedBytes_.clear(); encryptedBytes_.clear(); @@ -341,22 +341,22 @@ void outbound_frame_processor::process_frame(array_view frame, co bool success = false; switch (codec) { - case codec::Opus: + case codec::cd_opus: success = codec_utils::process_frame_opus(*this, frame); break; - case codec::VP8: + case codec::cd_vp8: success = codec_utils::process_frame_vp8(*this, frame); break; - case codec::VP9: + case codec::cd_vp9: success = codec_utils::process_frame_vp9(*this, frame); break; - case codec::H264: + case codec::cd_h264: success = codec_utils::process_frame_h264(*this, frame); break; - case codec::H265: + case codec::cd_h265: success = codec_utils::process_frame_h265(*this, frame); break; - case codec::AV1: + case codec::cd_av1: success = codec_utils::process_frame_av1(*this, frame); break; default: diff --git a/src/dpp/dave/frame_processors.h b/src/dpp/dave/frame_processors.h index 3cb6003ba6..534caaa18b 100755 --- a/src/dpp/dave/frame_processors.h +++ b/src/dpp/dave/frame_processors.h @@ -95,7 +95,7 @@ class outbound_frame_processor { void add_encrypted_bytes(const uint8_t* bytes, size_t size); private: - codec codec_{codec::Unknown}; + codec codec_{codec::cd_unknown}; size_t frameIndex_{0}; std::vector unencryptedBytes_; std::vector encryptedBytes_;