Skip to content

Commit

Permalink
[mp4tree] Break out NAL and SEI parsing
Browse files Browse the repository at this point in the history
  * A refactoring step since main file has grown a bit
  • Loading branch information
Nils Andgren committed Feb 18, 2020
1 parent df0d1c1 commit a6f2fd2
Show file tree
Hide file tree
Showing 9 changed files with 566 additions and 497 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ TARGET = mp4tree

SRCS := mp4tree.c
SRCS += atom-desc.c
SRCS += common.c
SRCS += nal.c
SRCS += sei.c

$(TARGET): $(SRCS)
$(CC) $(CFLAGS) -o $(TARGET) $(SRCS)
Expand Down
26 changes: 26 additions & 0 deletions common.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include <string.h>

#include "common.h"

const char *
indent(int depth, int header)
{
static char buf[64];
int i = 0;

memset(buf, 0 , sizeof buf);

for (i = 0; i < depth; i++)
{
strcat(buf, "| ");
}

if (header)
strcat(buf, "+");
else
strcat(buf, "");

return buf;
}


7 changes: 7 additions & 0 deletions common.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#pragma once

#include <stdlib.h>
#include <stdint.h>

const char *
indent(int depth, int header);
Loading

0 comments on commit a6f2fd2

Please sign in to comment.