Skip to content

Commit

Permalink
rename constants and enums
Browse files Browse the repository at this point in the history
  • Loading branch information
braindigitalis committed Oct 5, 2024
1 parent c32e1ff commit e7cb773
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/dpp/dave/codec_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ bool process_frame_av1(outbound_frame_processor& processor, array_view<const uin
bool validate_encrypted_frame(outbound_frame_processor& processor, array_view<uint8_t> frame)
{
auto codec = processor.get_codec();
if (codec != codec::H264 && codec != codec::H265) {
if (codec != codec::cd_h264 && codec != codec::cd_h265) {
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/dpp/dave/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {};
Expand Down
2 changes: 1 addition & 1 deletion src/dpp/dave/encryptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ codec encryptor::codec_for_ssrc(uint32_t ssrc)
return existingCodecIt->second;
}
else {
return codec::Opus;
return codec::cd_opus;
}
}

Expand Down
14 changes: 7 additions & 7 deletions src/dpp/dave/frame_processors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -341,22 +341,22 @@ void outbound_frame_processor::process_frame(array_view<const uint8_t> 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:
Expand Down
2 changes: 1 addition & 1 deletion src/dpp/dave/frame_processors.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint8_t> unencryptedBytes_;
std::vector<uint8_t> encryptedBytes_;
Expand Down

0 comments on commit e7cb773

Please sign in to comment.