添加 Box 类及其子类 ItemLocationBox 的实现,包含初始化和解析逻辑

This commit is contained in:
Nymiro
2025-10-20 11:58:35 +13:00
parent 23808a3ba6
commit 8ee1d7984a
8 changed files with 131 additions and 62 deletions
+15
View File
@@ -0,0 +1,15 @@
from typing import List
class Box:
"""
Represents a generic ISOBMFF box. This is a simple data container.
"""
def __init__(self, size: int, box_type: str, offset: int, raw_data: bytes):
self.size = size
self.type = box_type
self.offset = offset
self.raw_data = raw_data
self.children: List['Box'] = [] # Initially empty
def __repr__(self) -> str:
return f"<Box '{self.type}' size={self.size} offset={self.offset}>"