Skip to content

Commit

Permalink
av1: define and make AV1_AGGR_HDR_SIZE public (#393)
Browse files Browse the repository at this point in the history
  • Loading branch information
alfredh authored Jun 8, 2022
1 parent 71390b4 commit dd83ddc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
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

0 comments on commit dd83ddc

Please sign in to comment.