-
Notifications
You must be signed in to change notification settings - Fork 0
/
encoding.go
54 lines (48 loc) · 1.32 KB
/
encoding.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package dash
import "fmt"
type ContentProtection struct {
SchemeIdUri string `xml:"schemeIdUri,attr"`
// this might not exist
Default_KID string `xml:"default_KID,attr"`
// this might not exist
PSSH string `xml:"pssh"`
}
type Range struct {
Start uint64
End uint64
}
type RawRange string
func (r RawRange) Scan() (*Range, error) {
var v Range
_, err := fmt.Sscanf(string(r), "%v-%v", &v.Start, &v.End)
if err != nil {
return nil, err
}
return &v, nil
}
type Representation struct {
adaptation_set *adaptation_set
Bandwidth int64 `xml:"bandwidth,attr"`
ID string `xml:"id,attr"`
// this might not exist
BaseURL string
// this might not exist, or might be under AdaptationSet
Codecs string `xml:"codecs,attr"`
// this might be under AdaptationSet
ContentProtection []ContentProtection
// this might not exist
Height int64 `xml:"height,attr"`
// this might be under AdaptationSet
MimeType string `xml:"mimeType,attr"`
// this might not exist
SegmentBase *struct {
Initialization struct {
Range RawRange `xml:"range,attr"`
}
IndexRange RawRange `xml:"indexRange,attr"`
}
// this might not exist, or might be under AdaptationSet
SegmentTemplate *SegmentTemplate
// this might not exist
Width int64 `xml:"width,attr"`
}