Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix ContentProtection and add SubSegmentAlignment #104

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
build:
docker:
- image: circleci/golang
working_directory: "/go/src/github.com/zencoder/go-dash"
working_directory: "/go/src/github.com/garkettleung/go-dash"
steps:
- checkout
- run: make test
2 changes: 1 addition & 1 deletion .whitesource
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"settingsInheritedFrom": "zencoder/whitesource-config@main"
"settingsInheritedFrom": "garkettleung/whitesource-config@main"
}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# go-dash [![godoc](https://godoc.org/github.com/zencoder/go-dash/mpd?status.svg)](http://godoc.org/github.com/zencoder/go-dash/mpd)
# go-dash [![godoc](https://godoc.org/github.com/garkettleung/go-dash/mpd?status.svg)](http://godoc.org/github.com/garkettleung/go-dash/mpd)

A [Go](https://golang.org) library for generating [MPEG-DASH](https://en.wikipedia.org/wiki/Dynamic_Adaptive_Streaming_over_HTTP) manifests.

## Install

```
go get -u github.com/zencoder/go-dash
go get -u github.com/garkettleung/go-dash
```

## Supported Features
Expand All @@ -29,7 +29,7 @@ go get -u github.com/zencoder/go-dash

## Example Usage

See the [examples/](https://github.com/zencoder/go-dash/tree/master/examples) directory.
See the [examples/](https://github.com/garkettleung/go-dash/tree/master/examples) directory.

## Development

Expand All @@ -39,7 +39,7 @@ make test

### CI

[This project builds in Circle CI](https://circleci.com/gh/zencoder/go-dash/)
[This project builds in Circle CI](https://circleci.com/gh/garkettleung/go-dash/)

## License

Expand Down
2 changes: 1 addition & 1 deletion examples/live.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"fmt"

"github.com/zencoder/go-dash/v3/mpd"
"github.com/garkettleung/go-dash/v3/mpd"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion examples/ondemand.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"fmt"

"github.com/zencoder/go-dash/v3/mpd"
"github.com/garkettleung/go-dash/v3/mpd"
)

func exampleOndemand() {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/zencoder/go-dash/v3
module github.com/garkettleung/go-dash/v3

go 1.13
2 changes: 1 addition & 1 deletion helpers/testfixtures/testfixtures.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"os"
"testing"

"github.com/zencoder/go-dash/v3/helpers/require"
"github.com/garkettleung/go-dash/v3/helpers/require"
)

// Load test fixture from path relative to fixtures directory
Expand Down
2 changes: 1 addition & 1 deletion mpd/duration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"
"time"

"github.com/zencoder/go-dash/v3/helpers/require"
"github.com/garkettleung/go-dash/v3/helpers/require"
)

func TestDuration(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions mpd/events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package mpd
import (
"testing"

"github.com/zencoder/go-dash/v3/helpers/ptrs"
"github.com/zencoder/go-dash/v3/helpers/require"
"github.com/zencoder/go-dash/v3/helpers/testfixtures"
"github.com/garkettleung/go-dash/v3/helpers/ptrs"
"github.com/garkettleung/go-dash/v3/helpers/require"
"github.com/garkettleung/go-dash/v3/helpers/testfixtures"
)

const (
Expand Down
95 changes: 48 additions & 47 deletions mpd/mpd.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strings"
"time"

. "github.com/zencoder/go-dash/v3/helpers/ptrs"
. "github.com/garkettleung/go-dash/v3/helpers/ptrs"
)

// Type definition for DASH profiles
Expand Down Expand Up @@ -108,25 +108,25 @@ type DescriptorType struct {

// ISO 23009-1-2014 5.3.7
type CommonAttributesAndElements struct {
Profiles *string `xml:"profiles,attr"`
Width *string `xml:"width,attr"`
Height *string `xml:"height,attr"`
Sar *string `xml:"sar,attr"`
FrameRate *string `xml:"frameRate,attr"`
AudioSamplingRate *string `xml:"audioSamplingRate,attr"`
MimeType *string `xml:"mimeType,attr"`
SegmentProfiles *string `xml:"segmentProfiles,attr"`
Codecs *string `xml:"codecs,attr"`
MaximumSAPPeriod *string `xml:"maximumSAPPeriod,attr"`
StartWithSAP *int64 `xml:"startWithSAP,attr"`
MaxPlayoutRate *string `xml:"maxPlayoutRate,attr"`
ScanType *string `xml:"scanType,attr"`
FramePacking []DescriptorType `xml:"FramePacking,omitempty"`
AudioChannelConfiguration []DescriptorType `xml:"AudioChannelConfiguration,omitempty"`
ContentProtection []ContentProtectioner `xml:"ContentProtection,omitempty"`
EssentialProperty []DescriptorType `xml:"EssentialProperty,omitempty"`
SupplementalProperty []DescriptorType `xml:"SupplementalProperty,omitempty"`
InbandEventStream []DescriptorType `xml:"InbandEventStream,omitempty"`
Profiles *string `xml:"profiles,attr"`
Width *string `xml:"width,attr"`
Height *string `xml:"height,attr"`
Sar *string `xml:"sar,attr"`
FrameRate *string `xml:"frameRate,attr"`
AudioSamplingRate *string `xml:"audioSamplingRate,attr"`
MimeType *string `xml:"mimeType,attr"`
SegmentProfiles *string `xml:"segmentProfiles,attr"`
Codecs *string `xml:"codecs,attr"`
MaximumSAPPeriod *string `xml:"maximumSAPPeriod,attr"`
StartWithSAP *int64 `xml:"startWithSAP,attr"`
MaxPlayoutRate *string `xml:"maxPlayoutRate,attr"`
ScanType *string `xml:"scanType,attr"`
FramePacking []DescriptorType `xml:"FramePacking,omitempty"`
AudioChannelConfiguration []DescriptorType `xml:"AudioChannelConfiguration,omitempty"`
ContentProtection contentProtections `xml:"ContentProtection,omitempty"`
EssentialProperty []DescriptorType `xml:"EssentialProperty,omitempty"`
SupplementalProperty []DescriptorType `xml:"SupplementalProperty,omitempty"`
InbandEventStream []DescriptorType `xml:"InbandEventStream,omitempty"`
}

type contentProtections []ContentProtectioner
Expand Down Expand Up @@ -171,27 +171,28 @@ type dtoAdaptationSet struct {

type AdaptationSet struct {
CommonAttributesAndElements
XMLName xml.Name `xml:"AdaptationSet"`
ID *string `xml:"id,attr"`
SegmentAlignment *bool `xml:"segmentAlignment,attr"`
Lang *string `xml:"lang,attr"`
Group *string `xml:"group,attr"`
PAR *string `xml:"par,attr"`
MinBandwidth *string `xml:"minBandwidth,attr"`
MaxBandwidth *string `xml:"maxBandwidth,attr"`
MinWidth *string `xml:"minWidth,attr"`
MaxWidth *string `xml:"maxWidth,attr"`
MinHeight *string `xml:"minHeight,attr"`
MaxHeight *string `xml:"maxHeight,attr"`
ContentType *string `xml:"contentType,attr"`
Roles []*Role `xml:"Role,omitempty"`
SegmentBase *SegmentBase `xml:"SegmentBase,omitempty"`
SegmentList *SegmentList `xml:"SegmentList,omitempty"`
SegmentTemplate *SegmentTemplate `xml:"SegmentTemplate,omitempty"` // Live Profile Only
Representations []*Representation `xml:"Representation,omitempty"`
AccessibilityElems []*Accessibility `xml:"Accessibility,omitempty"`
Labels []string `xml:"Label,omitempty"`
BaseURL []string `xml:"BaseURL,omitempty"`
XMLName xml.Name `xml:"AdaptationSet"`
ID *string `xml:"id,attr"`
SegmentAlignment *bool `xml:"segmentAlignment,attr"`
SubSegmentAlignment *bool `xml:"subsegmentAlignment,attr"`
Lang *string `xml:"lang,attr"`
Group *string `xml:"group,attr"`
PAR *string `xml:"par,attr"`
MinBandwidth *string `xml:"minBandwidth,attr"`
MaxBandwidth *string `xml:"maxBandwidth,attr"`
MinWidth *string `xml:"minWidth,attr"`
MaxWidth *string `xml:"maxWidth,attr"`
MinHeight *string `xml:"minHeight,attr"`
MaxHeight *string `xml:"maxHeight,attr"`
ContentType *string `xml:"contentType,attr"`
Roles []*Role `xml:"Role,omitempty"`
SegmentBase *SegmentBase `xml:"SegmentBase,omitempty"`
SegmentList *SegmentList `xml:"SegmentList,omitempty"`
SegmentTemplate *SegmentTemplate `xml:"SegmentTemplate,omitempty"` // Live Profile Only
Representations []*Representation `xml:"Representation,omitempty"`
AccessibilityElems []*Accessibility `xml:"Accessibility,omitempty"`
Labels []string `xml:"Label,omitempty"`
BaseURL []string `xml:"BaseURL,omitempty"`
}

func (as *AdaptationSet) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
Expand Down Expand Up @@ -406,9 +407,9 @@ func (m *MPD) SetDolbyXMLNs() {
func NewMPD(profile DashProfile, mediaPresentationDuration, minBufferTime string, attributes ...AttrMPD) *MPD {
period := &Period{}
mpd := &MPD{
XMLNs: Strptr("urn:mpeg:dash:schema:mpd:2011"),
Profiles: Strptr((string)(profile)),
Type: Strptr("static"),
XMLNs: Strptr("urn:mpeg:dash:schema:mpd:2011"),
Profiles: Strptr((string)(profile)),
Type: Strptr("static"),
MediaPresentationDuration: Strptr(mediaPresentationDuration),
MinBufferTime: Strptr(minBufferTime),
period: period,
Expand All @@ -433,9 +434,9 @@ func NewMPD(profile DashProfile, mediaPresentationDuration, minBufferTime string
func NewDynamicMPD(profile DashProfile, availabilityStartTime, minBufferTime string, attributes ...AttrMPD) *MPD {
period := &Period{}
mpd := &MPD{
XMLNs: Strptr("urn:mpeg:dash:schema:mpd:2011"),
Profiles: Strptr((string)(profile)),
Type: Strptr("dynamic"),
XMLNs: Strptr("urn:mpeg:dash:schema:mpd:2011"),
Profiles: Strptr((string)(profile)),
Type: Strptr("dynamic"),
AvailabilityStartTime: Strptr(availabilityStartTime),
MinBufferTime: Strptr(minBufferTime),
period: period,
Expand Down
6 changes: 3 additions & 3 deletions mpd/mpd_read_write_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"testing"
"time"

"github.com/zencoder/go-dash/v3/helpers/ptrs"
"github.com/zencoder/go-dash/v3/helpers/require"
"github.com/zencoder/go-dash/v3/helpers/testfixtures"
"github.com/garkettleung/go-dash/v3/helpers/ptrs"
"github.com/garkettleung/go-dash/v3/helpers/require"
"github.com/garkettleung/go-dash/v3/helpers/testfixtures"
)

func TestReadingManifests(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions mpd/mpd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"strconv"
"testing"

. "github.com/zencoder/go-dash/v3/helpers/ptrs"
"github.com/zencoder/go-dash/v3/helpers/require"
"github.com/zencoder/go-dash/v3/helpers/testfixtures"
. "github.com/garkettleung/go-dash/v3/helpers/ptrs"
"github.com/garkettleung/go-dash/v3/helpers/require"
"github.com/garkettleung/go-dash/v3/helpers/testfixtures"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion mpd/pssh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package mpd
import (
"encoding/base64"
"encoding/hex"
"github.com/zencoder/go-dash/v3/helpers/require"
"github.com/garkettleung/go-dash/v3/helpers/require"
"testing"
)

Expand Down
6 changes: 3 additions & 3 deletions mpd/segment_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package mpd
import (
"testing"

"github.com/zencoder/go-dash/v3/helpers/ptrs"
"github.com/zencoder/go-dash/v3/helpers/require"
"github.com/zencoder/go-dash/v3/helpers/testfixtures"
"github.com/garkettleung/go-dash/v3/helpers/ptrs"
"github.com/garkettleung/go-dash/v3/helpers/require"
"github.com/garkettleung/go-dash/v3/helpers/testfixtures"
)

func TestSegmentListSerialization(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions mpd/segment_timeline_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"testing"
"time"

"github.com/zencoder/go-dash/v3/helpers/ptrs"
"github.com/zencoder/go-dash/v3/helpers/require"
"github.com/zencoder/go-dash/v3/helpers/testfixtures"
"github.com/garkettleung/go-dash/v3/helpers/ptrs"
"github.com/garkettleung/go-dash/v3/helpers/require"
"github.com/garkettleung/go-dash/v3/helpers/testfixtures"
)

func TestSegmentTimelineSerialization(t *testing.T) {
Expand Down