mirror of
https://github.com/langhuihui/monibuca.git
synced 2025-12-24 13:48:04 +08:00
37 lines
1.0 KiB
Go
37 lines
1.0 KiB
Go
package box
|
||
|
||
import "encoding/binary"
|
||
|
||
// aligned(8) class DataEntryUrlBox (bit(24) flags) extends FullBox(‘url ’, version = 0, flags) {
|
||
// string location;
|
||
// }
|
||
// aligned(8) class DataEntryUrnBox (bit(24) flags) extends FullBox(‘urn ’, version = 0, flags) {
|
||
// string name;
|
||
// string location;
|
||
// }
|
||
// aligned(8) class DataReferenceBox extends FullBox(‘dref’, version = 0, 0) {
|
||
// unsigned int(32) entry_count;
|
||
// for (i=1; i <= entry_count; i++) {
|
||
// DataEntryBox(entry_version, entry_flags) data_entry;
|
||
// }
|
||
// }
|
||
|
||
func makeDefaultDinfBox() []byte {
|
||
dinf := BasicBox{Type: [4]byte{'d', 'i', 'n', 'f'}}
|
||
dinf.Size = 36
|
||
offset, dinfbox := dinf.Encode()
|
||
binary.BigEndian.PutUint32(dinfbox[offset:], 28)
|
||
offset += 4
|
||
copy(dinfbox[offset:], []byte("dref"))
|
||
offset += 4
|
||
offset += 4
|
||
binary.BigEndian.PutUint32(dinfbox[offset:], 1)
|
||
offset += 4
|
||
binary.BigEndian.PutUint32(dinfbox[offset:], 0xc)
|
||
offset += 4
|
||
copy(dinfbox[offset:], []byte("url "))
|
||
offset += 4
|
||
binary.BigEndian.PutUint32(dinfbox[offset:], 1)
|
||
return dinfbox
|
||
}
|