Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rtcp: avoid bitfields in struct rtcp_hdr #1108

Closed
wants to merge 1 commit into from
Closed

Conversation

alfredh
Copy link
Contributor

@alfredh alfredh commented Apr 27, 2024

No description provided.

@sreimers
Copy link
Member

Should we close this, if bit-field support is now working for re_printf #1110?

struct rtcp_hdr {
        unsigned int               version:2;            /*     0: 0  4 */
        unsigned int               p:1;                  /*     0: 2  4 */
        unsigned int               count:5;              /*     0: 3  4 */
        unsigned int               pt:8;                 /*     0: 8  4 */

        /* Bitfield combined with next fields */

        uint16_t                   length;               /*     2     2 */

        /* size: 4, cachelines: 1, members: 5 */
        /* last cacheline: 4 bytes */
};
struct rtcp_hdr {
        uint8_t                    version;              /*     0     1 */
        _Bool                      p;                    /*     1     1 */
        uint8_t                    count;                /*     2     1 */

        /* XXX 1 byte hole, try to pack */

        enum rtcp_type             pt;                   /*     4     4 */
        uint16_t                   length;               /*     8     2 */

        /* size: 12, cachelines: 1, members: 5 */
        /* sum members: 9, holes: 1, sum holes: 1 */
        /* padding: 2 */
        /* last cacheline: 12 bytes */
};

@alfredh alfredh closed this Apr 28, 2024
@alfredh
Copy link
Contributor Author

alfredh commented Apr 28, 2024

Thanks.

The "version" field can also in theory be removed, since we only support RTP version 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants