ultravideo / uvgRTP

An open-source library for RTP/SRTP media delivery
BSD 2-Clause "Simplified" License
318 stars 90 forks source link

Cannot set the RTP play load to 8 and others? #113

Closed MattWei closed 2 years ago

MattWei commented 2 years ago

The RTP format only have below value:

typedef enum RTP_FORMAT {
    RTP_FORMAT_GENERIC = 0,   ///< Generic format
    RTP_FORMAT_H264    = 95,  ///< H.264/AVC
    RTP_FORMAT_H265    = 96,  ///< H.265/HEVC
    RTP_FORMAT_H266    = 97,  ///< H.266/VVC
    RTP_FORMAT_OPUS    = 98,  ///< Opus
} rtp_format_t;

Is it mean that I can't use the PCMA with play load type to 8 and others?

jrsnen commented 2 years ago

Hi.

Technically no, but you could probably configure the payload number with RCC_DYN_PAYLOAD_TYPE (see configuration example on how to use RCC flags) and use RTP_FORMAT_GENERIC to get the correct result.

If the formats don't use a specific RTP packetization formats (as I believe is the case with many audio formats) adding support to this enum would probably be relatively simple. If you want to help the community, you are welcome to make a PR (just check where RTP_FORMAT_GENERIC is used (plus here) and add cases for desired formats).

BR, Joni

jrsnen commented 2 years ago

I went through RFC 3551 in fe28c423a93e5596c7ea0a1a10aa99aba110f2e7 and added all formats to the enum that required no additional packetization.