aboutsummaryrefslogtreecommitdiff
path: root/box.go
diff options
context:
space:
mode:
authorOnur Gündüz <ogunduz@gmail.com>2026-02-13 11:52:40 +0100
committerOnur Gündüz <ogunduz@gmail.com>2026-02-13 11:52:40 +0100
commitb77eda22996be44ecb9c63f665c0acf1d6786821 (patch)
treeaee54821006521001ddb718e140c9ea87a907d78 /box.go
parentf4b35bb7f4475db77fa6969eb42964824f616fb0 (diff)
downloadmp4-b77eda22996be44ecb9c63f665c0acf1d6786821.tar.gz
mp4-b77eda22996be44ecb9c63f665c0acf1d6786821.zip
Add segment type and index boxes, and update CttsIter for version handling
Diffstat (limited to 'box.go')
-rw-r--r--box.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/box.go b/box.go
index 6185728..0c836b0 100644
--- a/box.go
+++ b/box.go
@@ -11,6 +11,7 @@ func (t BoxType) String() string {
// Known box types.
var (
TypeFtyp = BoxType{'f', 't', 'y', 'p'}
+ TypeStyp = BoxType{'s', 't', 'y', 'p'} // Segment type box (used in fragmented MP4)
TypeMoov = BoxType{'m', 'o', 'o', 'v'}
TypeMvhd = BoxType{'m', 'v', 'h', 'd'}
TypeTrak = BoxType{'t', 'r', 'a', 'k'}
@@ -51,6 +52,7 @@ var (
TypeSubs = BoxType{'s', 'u', 'b', 's'}
TypeSaiz = BoxType{'s', 'a', 'i', 'z'}
TypeSaio = BoxType{'s', 'a', 'i', 'o'}
+ // Fragment movie boxes
TypeMvex = BoxType{'m', 'v', 'e', 'x'}
TypeMehd = BoxType{'m', 'e', 'h', 'd'}
TypeTrex = BoxType{'t', 'r', 'e', 'x'}
@@ -61,13 +63,20 @@ var (
TypeTfhd = BoxType{'t', 'f', 'h', 'd'}
TypeTfdt = BoxType{'t', 'f', 'd', 't'}
TypeTrun = BoxType{'t', 'r', 'u', 'n'}
+ TypeSidx = BoxType{'s', 'i', 'd', 'x'} // Segment index box
+ TypeEmsg = BoxType{'e', 'm', 's', 'g'} // Event message box
+ // Metadata boxes
TypeMeta = BoxType{'m', 'e', 't', 'a'}
TypeUdta = BoxType{'u', 'd', 't', 'a'}
+ // Data boxes
TypeMdat = BoxType{'m', 'd', 'a', 't'}
TypeFree = BoxType{'f', 'r', 'e', 'e'}
TypeSkip = BoxType{'s', 'k', 'i', 'p'}
+ // Sample entry boxes
TypeAvc1 = BoxType{'a', 'v', 'c', '1'}
TypeAvcC = BoxType{'a', 'v', 'c', 'C'}
+ TypeBtrt = BoxType{'b', 't', 'r', 't'} // MPEG-4 Bit rate box
+ TypePasp = BoxType{'p', 'a', 's', 'p'} // Pixel aspect ratio box
TypeMp4a = BoxType{'m', 'p', '4', 'a'}
TypeEsds = BoxType{'e', 's', 'd', 's'}
)
@@ -82,7 +91,7 @@ func IsFullBox(t BoxType) bool {
TypeMeta, TypeEsds, TypeMehd, TypeTrex,
TypeMfhd, TypeTfhd, TypeTfdt, TypeTrun,
TypeSbgp, TypeSgpd, TypeSaiz, TypeSaio,
- TypeCslg, TypeSdtp:
+ TypeCslg, TypeSdtp, TypeSidx, TypeEmsg:
return true
}
return false