Comments (1)
Hello,
there is a problem with the names of the APP packets. API guide states the following:
When in fact, any name that is longer than 3 characters results in name corruption. For example, a packet named "123" produces:
whereas packet named "1234" produces:
In the rtcp_app_packet declaration the name is represented as
So it is converted to an array with a length of [4] and is probably null-terminated, because the function takes char pointer
I'm actually not convinced there is a problem. When looking at the spec (RFC 3550), 4 is the correct length for the name
Then, when looking at the name
I get the impression that you are supposed to use all 4 bytes for your name and not less. How uvgRTP handles this is just assume there are 4 characters there and copies them (this could probably be handled better, but it works in context of the specification.) This means that 123 will have the null-termination even though it is not supposed to have it. In case of 1234, it is copied without the null-termination, but this is actually correct, since the termination is not supposed to be there. In other words, when printing the name, you should not assume it is null-terminated, because it is not supposed to be.
rtp_error_t send_app_packet(char *name, uint8_t subtype, size_t payload_len, uint8_t *payload);
You are right, that the char* in the API is misleading.
So I guess this is the intended behaviour with a misleading API guide. But I think that 3 characters long names are a bit short.
Either the API should be fixed, or the names allowed to be longer, API fix is easier tho :)
The length is specified by the RFC, so it cannot be increased. The API should probably be improved in some way.
p.s also when converting the name from the app packet that we receive back to char*, it becomes non null-terminated.
I'm not super familiar with C, but maybe you should use a conversion function that adds the null-termination.
from uvgrtp.
Related Issues (20)
- Multiplexing packets based on protocol HOT 3
- Streaming 4K H264 video through Wireguard VPN HOT 9
- Compilation on Nanopi board HOT 3
- RTCP interval issues HOT 2
- A mistake for APP packet payload copying HOT 1
- Python API HOT 1
- Failed to flush the message queue HOT 15
- RTP header extension HOT 2
- uint8 overflow in a test HOT 2
- H264 Failed to flush the message queue HOT 16
- H265 Failed to flush the message queue HOT 3
- Streaming H264 video HOT 2
- Visual Studio Library Linking Documentation HOT 2
- Not Receiving RTP Packets from FFmpeg HOT 5
- H26x: Aggregation causes NAL units to be sent in different order HOT 5
- H26x incorrectly detected start code if preceded by 0x1 HOT 1
- H26x 00 01 00 detected as start code at certain alignments HOT 3
- bug in reception_flow.cc HOT 3
- error in uvgrtp::formats::h26x::packet_handler HOT 2
- [Android] Library fails to compile (at least for old SDK level 21) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uvgrtp.