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

Add SCTE-35 support #106

Merged
merged 9 commits into from
Jan 13, 2025
Merged

Add SCTE-35 support #106

merged 9 commits into from
Jan 13, 2025

Conversation

ferpart
Copy link
Contributor

@ferpart ferpart commented Dec 18, 2024

Description

This pr adds support for SCTE-35 on the go-dash library.

@bc-seceng2
Copy link

bc-seceng2 commented Dec 18, 2024

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

code/snyk check is complete. No issues have been found. (View Details)

actualString, err := m.WriteToString()
require.NoError(t, err)

require.EqualString(t, expectedString, actualString)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than test this here, you should have a hardcoded mpd in in the fixtures/ folder, and compare the actualString to the fixture itself much like the event stream tests https://github.com/zencoder/go-dash/blob/master/mpd/events_test.go#L55

The way you have this assertion implemented can actually hide bugs. If there was a bug in say the xml tags you added such that the xml encoded value of the struct is invalid, you would never catch it here because both the expected and actual are generated by encoding a struct to xml string, both would encode with the same bug. Comparing against a static fixture can catch any encoding bugs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the test to load the fixtures/scte35.mpd file as the expected mpd, and compared it to the generated one here: 3754381

@ferpart ferpart requested a review from mjneil January 7, 2025 22:07
<EventStream schemeIdUri="urn:scte:scte35:2014:xml+bin" timescale="10">
<Event id="1" presentationTime="10000">
<Signal xmlns="urn:scte:scte35:2014:xml+bin">
<Binary xmlns="urn:scte:scte35:2014:xml+bin"></Binary>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it expected to still have a <Binary></Binary> tag if there is no data within it, or should we expect this to be omitted? not sure if it is required by the spec or to satisfy precondition requirements?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, updated the library, to only keep the Event field, as that contains the presentationTime for an event whenever the binary is empty (also updated a bunch of other stuff to better support scte-35).

@ferpart ferpart requested a review from mjneil January 9, 2025 20:21
@ferpart ferpart merged commit dee6c44 into master Jan 13, 2025
4 checks passed
@ferpart ferpart deleted the feature/Add-SCTE35-support branch January 13, 2025 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants