forked from mccoyst/ogg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
34 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// © 2014 Steve McCoy under the MIT license. See LICENSE for details. | ||
|
||
package ogg | ||
|
||
import ( | ||
"encoding/binary" | ||
"hash/crc32" | ||
) | ||
|
||
const MIMEType = "application/ogg" | ||
|
||
var ByteOrder = binary.LittleEndian | ||
|
||
type pageHeader struct { | ||
OggS [4]byte // 0-3, always == "OggS" | ||
StreamVersion byte // 4, always == 0 | ||
HeaderType byte // 5 | ||
Granule int64 // 6-13, codec-specific | ||
Serial uint32 // 14-17, associated with a logical stream | ||
Page uint32 // 18-21, sequence number of page in packet | ||
Crc uint32 // 22-25 | ||
Nsegs byte // 26 | ||
} | ||
|
||
const ( | ||
// Continuation of packet | ||
cop byte = 1 + iota | ||
// Beginning of stream | ||
bos = 1 << iota | ||
// End of stream | ||
eos = 1 << iota | ||
) | ||
|
||
var crcTable = crc32.MakeTable(0x04c11db7) |