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

av1: define and make AV1_AGGR_HDR_SIZE public #393

Merged
merged 1 commit into from
Jun 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions include/re_av1.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ int av1_packetize(bool *newp, bool marker, uint64_t rtp_ts,
av1_packet_h *pkth, void *arg);


enum {
AV1_AGGR_HDR_SIZE = 1,
};

/** AV1 Aggregation Header */
struct av1_aggr_hdr {
unsigned z:1; /**< Continuation of OBU fragment from prev packet */
Expand Down
11 changes: 3 additions & 8 deletions src/av1/pkt.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@
#include <re_av1.h>


enum {
HDR_SIZE = 1,
};


static void hdr_encode(uint8_t hdr[HDR_SIZE],
static void hdr_encode(uint8_t hdr[AV1_AGGR_HDR_SIZE],
bool z, bool y, uint8_t w, bool n)
{
hdr[0] = z<<7 | y<<6 | w<<4 | n<<3;
Expand All @@ -40,12 +35,12 @@ int av1_packetize(bool *newp, bool marker, uint64_t rtp_ts,
const uint8_t *buf, size_t len, size_t maxlen,
av1_packet_h *pkth, void *arg)
{
uint8_t hdr[HDR_SIZE];
uint8_t hdr[AV1_AGGR_HDR_SIZE];
bool cont = false;
uint8_t w = 0; /* variable OBU count */
int err = 0;

if (!newp || !buf || !len || maxlen < (HDR_SIZE + 1) || !pkth)
if (!newp || !buf || !len || maxlen < (AV1_AGGR_HDR_SIZE + 1) || !pkth)
return EINVAL;

maxlen -= sizeof(hdr);
Expand Down