-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
81 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#pragma once | ||
|
||
#include <stdint.h> | ||
|
||
// https://www.ietf.org/rfc/rfc2326#section-10.12 | ||
typedef struct __attribute__((packed)) | ||
{ | ||
char magic; // Magic encapsulation ASCII dollar sign (24 hexadecimal) | ||
uint8_t channel; // Channel identifier | ||
uint16_t length; // Network order | ||
} rtp_over_tcp_hdr_t; | ||
|
||
// RTP data header - http://www.ietf.org/rfc/rfc3550.txt | ||
typedef struct __attribute__((packed)) | ||
{ | ||
uint16_t version : 2; // protocol version | ||
uint16_t padding : 1; // padding flag | ||
uint16_t extension : 1; // header extension flag | ||
uint16_t cc : 4; // CSRC count | ||
uint16_t marker : 1; // marker bit | ||
uint16_t pt : 7; // payload type | ||
uint16_t seq : 16; // sequence number | ||
uint32_t ts; // timestamp | ||
uint32_t ssrc; // synchronization source | ||
} rtp_hdr_t; | ||
|
||
// https://datatracker.ietf.org/doc/html/rfc2435 | ||
typedef struct __attribute__((packed)) | ||
{ | ||
uint32_t tspec : 8; // type-specific field | ||
uint32_t off : 24; // fragment byte offset | ||
uint8_t type; // id of jpeg decoder params | ||
uint8_t q; // Q values 0-127 indicate the quantization tables. JPEG types 0 and 1 (and their corresponding types 64 and 65) | ||
uint8_t width; // frame width in 8 pixel blocks | ||
uint8_t height; // frame height in 8 pixel blocks | ||
} jpeg_hdr_t; | ||
|
||
typedef struct __attribute__((packed)) | ||
{ | ||
uint16_t dri; | ||
uint16_t f : 1; | ||
uint16_t l : 1; | ||
uint16_t count : 14; | ||
} jpeg_hdr_rst_t; | ||
|
||
typedef struct __attribute__((packed)) | ||
{ | ||
uint8_t mbz; | ||
uint8_t precision; | ||
uint16_t length; | ||
} jpeg_hdr_qtable_t; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters