[fix] fix h264 rtp packet packetization and depacketization

This commit is contained in:
dijunkun
2025-01-23 17:28:17 +08:00
parent cd349cd98d
commit 7b839ab773
50 changed files with 871 additions and 422 deletions

View File

@@ -0,0 +1,43 @@
/*
* @Author: DI JUNKUN
* @Date: 2025-01-23
* Copyright (c) 2025 by DI JUNKUN, All Rights Reserved.
*/
#ifndef _RTP_DEFINES_H_
#define _RTP_DEFINES_H_
#include <cstddef>
#include <cstdint>
#define DEFAULT_MTU 1500
#define MAX_NALU_LEN 1400
namespace rtp {
typedef enum {
UNDEFINED = 0,
H264 = 96,
H264_FEC_SOURCE = 97,
H264_FEC_REPAIR = 98,
AV1 = 99,
OPUS = 111,
DATA = 127
} PAYLOAD_TYPE;
typedef struct {
uint8_t forbidden_bit : 1;
uint8_t nal_reference_idc : 2;
uint8_t nal_unit_type : 5;
} FU_INDICATOR;
typedef struct {
uint8_t start : 1;
uint8_t end : 1;
uint8_t remain_bit : 1;
uint8_t nal_unit_type : 5;
} FU_HEADER;
typedef enum { UNKNOWN = 0, NALU = 1, FU_A = 28, FU_B = 29 } NAL_UNIT_TYPE;
} // namespace rtp
#endif