Fix math involving enums in C++20

(-Wdeprecated-anon-enum-enum-conversion)
- Replace enum with constexpr if necessary.
- Merge multiple definitions for H.264 NalDefs and FuDefs and apply
  constexpr.

Bug: chromium:1284275
Change-Id: I4a4d95ed6aba258e7c19c3ae6251c8b78caf84ec
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276561
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#38215}
This commit is contained in:
Byoungchan Lee
2022-09-27 14:37:26 +09:00
committed by WebRTC LUCI CQ
parent 806261ae8e
commit 6c2ac2ea6b
8 changed files with 55 additions and 57 deletions

View File

@ -26,6 +26,16 @@
namespace webrtc {
// Bit masks for NAL (F, NRI, Type) indicators.
constexpr uint8_t kH264FBit = 0x80;
constexpr uint8_t kH264NriMask = 0x60;
constexpr uint8_t kH264TypeMask = 0x1F;
// Bit masks for FU (A and B) headers.
constexpr uint8_t kH264SBit = 0x80;
constexpr uint8_t kH264EBit = 0x40;
constexpr uint8_t kH264RBit = 0x20;
class RtpPacketizerH264 : public RtpPacketizer {
public:
// Initialize with payload from encoder.