Commit Graph

1472 Commits

Author SHA1 Message Date
Joey Parrish 2f9065349f
ci: Fix macOS build by downgrading to 10.15 (#1044) 2022-03-08 09:04:49 -08:00
Joey Parrish f577e2a0cf
chore: Update URLs after moving projects (#1042)
Since a project URL is encoded into outputs, this means also updating
the golden output files.

Closes #1043
2022-03-07 11:56:34 -08:00
Shaka Bot 576889eecc
chore: Sync common workflows (#1039)
This is an automated sync of common workflows for this organization.
The upstream source is:
b39597e92d

Co-authored-by: Shaka Bot <shaka-bot@users.noreply.github.com>
2022-02-28 21:14:32 -08:00
Shaka Bot 362a2a5dd1
chore: Sync common workflows (#1037)
This is an automated sync of common workflows for this organization.
The upstream source is:
9517df8f73

Co-authored-by: Shaka Bot <shaka-bot@users.noreply.github.com>
2022-02-25 10:12:44 -08:00
Shaka Bot f68108b1f9
chore: Sync common workflows (#1034)
This is an automated sync of common workflows for this organization.
The upstream source is:
aa5e38eb86

Co-authored-by: Shaka Bot <shaka-bot@users.noreply.github.com>
2022-02-24 14:38:50 -08:00
Joey Parrish 157f8bb060
ci: Add workflow to sync issue labels with central config (#1031) 2022-02-16 08:34:19 -08:00
Joey Parrish 5c6157f67a
ci: Remove kokoro config (#1029)
We are now fully committed to GitHub Actions for CI, and all
contributions will come through public PRs, and not through
Google-internal channels.
2022-02-10 17:52:35 -08:00
Vishal Shah e1b0c7c454
Fix WEBVTT Region parse 100 precent (#1006) 2021-11-15 21:28:15 -08:00
Joey Parrish 634af6591c chore: Release v2.6.1
Change-Id: I9c81738e8ebe4ed6176c5697e90d868ac89a0d6b
2021-10-14 10:35:54 -07:00
Joey Parrish e2d66b33fa fix: Fix crash in static-linked linux builds
The official, static-linked linux builds were crashing in their use of
getaddrinfo, which libcurl was configured to use.  Both getaddrinfo
and all of its alternatives available in glibc fail with static
linking.

We can fix this by configuring libcurl to use libc-ares on Linux
instead.  This allows us to keep the benefits of a statically-linked
Linux binary.

Closes #996

Change-Id: Ib4a9eb939813fd165727788726459ef4adf3fc4d
2021-10-14 10:35:49 -07:00
Joey Parrish 9fc3ee1186 test: Run docker-based Linux distro tests in GitHub Actions
When testing a PR or release, make sure the build still passes on all
supported Linux distros.

Change-Id: Id7046e8eb8fe999965ea22e12dd1ffdce2fa2d63
2021-10-14 10:16:22 -07:00
Joey Parrish 1b96427983 test: Improve debugging ability for docker tests
The script in packager/testing/dockers/test_dockers.sh now outputs
more useful info for debugging, uses unique container names per OS so
that the containers can be debugged, and allows filtering to re-run
specific OSes if a build fails.

Change-Id: I0cace282549c093a643009f5e60e7545a039168c
2021-10-14 10:16:22 -07:00
Joey Parrish 0afda1725c test: Update Dockerfiles
This updates the main Dockerfile and all the docker-based
distro-specific tests.  The base OS versions have been updated to
versions that have not reached end-of-life status yet, and the list of
dependencies required has been updated and pruned.

Change-Id: Ibcff2f60e739fd5d999af100af76c40aa91a75bc
2021-10-13 12:37:16 -07:00
Joey Parrish efbca399c0 fix: Add missing limits header
In many places, we used std::numeric_limits without including the
proper header.  This would build on some Linux distributions, but not
others.

This adds the missing includes, fixing the build on Fedora, among
other distros.

Change-Id: I63e9e37e5973fe23bbdf9868552db51062b1dae4
2021-10-13 12:25:34 -07:00
Joey Parrish d02b960452 test: Pin pylint to a specific version in GitHub Actions
This should prevent us from failing new pylint rules without any code
changes on our part.

Change-Id: If8b8c2a180e921cdfc3b99a9e17a798599ebe19b
2021-10-13 12:25:34 -07:00
Joey Parrish 5181ea1d3f chore: Release v2.6.0
Change-Id: Ic29d982a96930ba5dbe4a253224ee8f6e8ddef11
2021-09-07 08:08:00 -07:00
Joey Parrish 7392d8003e fix: Fix failure fetching encryption keys
In one of the low-latency changes, a change was made to HttpFile that
caused responses to HTTP POST requests to go missing.  This resulted
in failures to fetch encryption keys.

The breaking change was recommended by me in a PR review, and was not
caught by any unit tests.  New tests would be ideal, but I chose to
fix the bug first, rather than leave the repo broken.

This bug was brought to my attention in google/shaka-streamer#87 and
has not appeared in any release versions.

Change-Id: I9eca73d187a8a30f16c4a920fcdb7b4872253858
2021-09-06 21:54:34 -07:00
Caitlin O'Callaghan c87c5bcdef
Fix for gap size warning in Low Latency mode (#985)
## The issue
- With LL-DASH mode enabled, the gap size warning was hit and printed to the console every time a new segment was registered to the manifest.
- This occurred because the first chunk's size and duration were being stored for each segment, rather than the full segment size and duration. Note, only the first chunk's metrics are known at first because in low latency mode, the segment is registered to the manifest before it is finished being processed and written.
- Because of this, the gap size check was comparing the end time of the first chunk in the previous segment to the beginning time of the current segment, causing the check to fail every time.

## The Fix
- Update a low latency segment's duration and size once the segment file has been fully written.
- The full segment size and duration will be used to update the bandwidth estimator and the segment info list. 
- Updating the segment info list to hold the full duration is necessary for satisfying [the gap size check found in Represenation.cc](https://github.com/google/shaka-packager/blob/master/packager/mpd/base/representation.cc#L391).
- NOTE: bandwidth estimation is currently only used in HLS
2021-09-03 09:57:43 -07:00
Joey Parrish f332e42600 CI: update runner labels for self-hosted runners
It was suggested in code review for another project that we update the
runner labels for clarity.  This brings Packager in line with that, so
that we are using the same labels across projects.

The runners have already been updated to register with the new label.

Change-Id: I30b22530225b5bd22b965ba98d276bcd74ade6cf
2021-08-26 14:02:51 -07:00
Joey Parrish bbd0a1afa6 build: Make release binary names more consistent
Now that we have multiple architectures, we should factor both OS and
architecture into the names of release binaries.  This makes the names
more formulaic, as well as consistent with the static-ffmpeg-binaries
repository.  Shaka Streamer will pull binaries from both this repo and
that one, so consistent names would be helpful.

The pssh-box release is actually OS and architecture independent, so
remove the suffix from that and only release one copy of it.

Change-Id: Ief3de49fae267c5267647a8dd4377023777ead37
2021-08-26 20:44:40 +00:00
Joey Parrish 249c83f14b build: Fix additional python2/3 issues
The generate_version_string script was only producing correct results
in python 2, not python 3.  The gyp file that references it explicitly
runs it in python3.  The shebang line of the script has been updated
to match.  The script itself has been updated such that it now works
correctly in both python2 and python3.

Scripts that are only used as modules (not executed directly) have had
their shebang lines removed.

This fixes CI failures on GitHub Actions.

Change-Id: I309bafd2fb05e8fb33f5e092ead179c8c42ea5d3
2021-08-26 12:22:20 -07:00
Caitlin O'Callaghan cd018a71c3
Low latency DASH support (#979)
# LL-DASH Support
These changes add support for LL-DASH streaming. 

**NOTE:** LL-HLS support is still in progress, but it's coming. :) 

## Testing
`./chunking_unittest --gtest_filter="ChunkingHandlerTest.LowLatencyDash"`

`./media_event_unittest --gtest_filter="MpdNotifyMuxerListenerTest.LowLatencyDash"`

`./mpd_unittest --gtest_filter="PeriodTest.LowLatencyDashMpdGetXml"`
`./mpd_unittest --gtest_filter="SimpleMpdNotifierTest.NotifyAvailabilityTimeOffset"`
`./mpd_unittest --gtest_filter="SimpleMpdNotifierTest.NotifySegmentDuration"`
`./mpd_unittest --gtest_filter="LowLatencySegmentTest.LowLatencySegmentTemplate"`

Note, packager_test must be run from the main project directory
`./out/Release/packager_test --gtest_filter="PackagerTest.LowLatencyDashEnabledAndUtcTimingNotSet"`
`./out/Release/packager_test --gtest_filter="PackagerTest.LowLatencyDashEnabledAndUtcTimingNotSet"`
2021-08-25 08:38:05 -07:00
Joey Parrish ac125564b9 build: Fix pylint 2.10 issues, use python3 where possible
The newest pylint release complained about several issues that the
older release did not.  This resolves those issues:

 - removes unneeded "u" prefix from strings
 - adds "encoding" parameter for all open() calls
 - because "encoding" is a python3-only parameter, use python3 in all
   the scripts that we control

Unfortunately, python2 is required for any scripts that import modules
from the ancient Chromium build system we're using (referenced by
DEPS), as well as kokoro scripts.

Change-Id: I2e9f97af508efe58b5a71de21740e59b1528affd
2021-08-24 12:27:03 -07:00
Joey Parrish 6cbc797ccc build: Fix missing target_arch parameter in build action
This was causing failures on arm64, where the build action had an
arm-specific clause that was skipped due to the missing parameter.

Change-Id: I71b7fb15120855c444749dc2216b5f19f0561f6e
2021-08-23 22:14:14 -07:00
Joey Parrish 879e2fef16 build: Add arm64 to the build matrix
This will also allow us to create official arm64 builds starting with
our next release.

Change-Id: Iaca5e8406c5e28883346a7884eb0f30815ad0d19
2021-08-16 19:41:19 +00:00
Joey Parrish e5a0d6aa58 build: Fix builds with CC=clang CXX=clang++
When using CC=clang CXX=clang++, there is a binutils version check
that does not work correctly in common.gypi.  Since we are stuck with
a very old version of chromium/src/build, there is nothing to do but
patch it to remove the check.  Thankfully, this version number does
not control anything critical in the build settings as far as we can
tell.

Change-Id: Id749d97c5898917592f66136538ee0fa5ca78767
2021-08-14 11:07:36 -07:00
Joey Parrish b411af7ed9
ci: Produce static release executables on Linux (#978)
We never produced static release executables on Linux before, but the dynamic libraries they depended on were universal enough that nobody noticed. Now that we have released v2.5 and switched to GitHub Actions for CI builds, the Linux executables depend on libatomic, which is causing issues for some users.

Although we can't create fully-static executables on macOS or Windows, we can at least do so on Linux.

This adds a GYP variable static_link_binaries which can be set to request full-static binaries on Linux. This also exposes the Chromium build variable disable_fatal_linker_warnings, which is necessary when static linking on Linux due to static-link-related warnings generated by libcurl for its use of getaddrinfo. Finally, this enforces the definition of __UCLIBC__ with static linking on Linux, which is the only way to disable malloc hooks in Chromium base. Those hooks cause linker failures when linking statically on Linux.

A new check has been added to the release workflow to ensure that the builds we create are statically linked on Linux.

Closes #965
2021-08-12 20:14:43 -07:00
Joey Parrish 507a731a9a
ci: Use GITHUB_TOKEN instead of SHAKA_BOT_TOKEN (#977)
There is not a good reason to use a long-lived token attached to
shaka-bot.  Instead, use a short-lived, automatic token generated by
GitHub Actions for the workflow run.
2021-08-12 10:50:29 -07:00
Joey Parrish cfbe5c08c2 cleanup: Convert all time parameters to signed
This converts all time parameters to signed, finishing a cleanup that
was started in 2018 in b4256bf0.  This changes the type of:
  - timestamps
    - PTS specifically
  - timestamp offsets
  - timescales
  - durations

This excludes:
  - MP4 box definitions
  - DTS specifically

This is meant to address signed/unsigned conversion issues on arm64
that caused some test cases to fail.

Change-Id: Ic752a20cbc6e31fea6bc0894d1771833171e7cbe
2021-08-05 18:24:15 +00:00
Joey Parrish eba176f032 build: Disable CPU-specific optimizations in libpng
This fixes the Debug build of libpng on arm64 by avoiding CPU-specific
optimizations that are not in our sources list.  The Release build
appears to have been unaffected, possibly due to link-time
optimizations or dead code stripping.

Change-Id: I900e00fe30b9f3748f2587cfea89a636b3a19811
2021-08-04 12:27:10 -07:00
Joey Parrish 68b50f656d build: Stop using hermetic clang, libc++, etc
This brings our default build config more in line with what is
necessary for some platforms anyway: using the system-installed
toolchain and sysroot to build everything.

We will no longer fetch source or binaries for any specific build
tools, such as libc++, clang, gold, binutils, or valgrind.

The main part of this change is the changing of default gyp settings
in gyp_packager.py.  For this, a bug in gyp_packager.py had to be
fixed, in which similar GYP_DEFINE key names (such as clang and
host_clang) would conflict, causing some defaults not to be installed
properly.

In order to enable clang=0 by default, some changes had to be made in
common.gypi:
  - compiler macros added to fix a compatibility issue between
    Chromium's base/mac/ folder and the actual OSX SDK
	- replaced clang_warning_flags variables with standard cflags
	  settings, plus xcode_settings for OSX
  - turned off warnings-as-errors for non-shaka code, rather than
		allow-listing specific warning types, since we can't actually fix
    those warnings on any platform
  - disabled two specific warnings in shaka code, both of which are
    caused by headers from our non-shaka dependencies

Also, one warning (missing "override" keyword) has been fixed in
vod_media_info_dump_muxer_listener.h.

Although these changes were done to make building simpler on a wider
array of platforms (arm64, for example), it seems to make the build a
bit faster, too.  For me, at least, on my main Linux workstation:
  - "gclient sync" now runs 20-30% faster
  - "ninja -C out/Release" now runs 5-13% faster

The following environment variables are no longer required:
  - DEPOT_TOOLS_WIN_TOOLCHAIN
  - MACOSX_DEPLOYMENT_TARGET
Documentation, Dockerfiles, and GitHub Actions workflows have been
updated to reflect this.

The following GYP_DEFINES are no longer required for anyone:
  - clang=0
  - host_clang=0
  - clang_xcode=1
  - use_allocator=none
  - use_experimental_allocator_shim=0
Documentation, Dockerfiles, and GitHub Actions workflows have been
updated to reflect this.

The following repos are no longer dependencies in gclient:
  - binutils
  - clang
  - gold
  - libc++
  - libc++abi
  - valgrind

The following gclient hooks have been removed:
  - clang
  - mac_toolchain
  - sysroot

Change-Id: Ie94ccbeec722ab73c291cb7df897d20761a09a70
2021-07-29 13:54:44 -07:00
nvincen f018c9a9bf
Added MPEG-H support (mha1, mhm1)
Implemented according to `Audio Amendment to Guidelines for Implementation:
DASH-IF Interoperability Points, Version 4.3`
(https://dashif.org/docs/Audio%20Amendment%20to%20DASH%20IOP%204.3.pdf).

Closes #930.
2021-06-29 23:10:53 -07:00
Daniel Cantarín b7ef11fa70
Workaround warning spam using http_file
Fixes #948.
2021-06-22 11:57:51 -07:00
Joey Parrish 9f11077768 Install pylint explicitly in custom linter action
Change-Id: I61891ef6682af209ee94b187b247f5b779e83c8a
2021-06-21 16:37:24 -07:00
Joey Parrish f8816030a1 Release v2.5.1
Change-Id: Id4e1d8f57c3413ae7eba6c3498fa71077c0d9a10
2021-06-21 21:47:08 +00:00
Joey Parrish 56e227267c Fix python linter errors and add linter checks to CI
Internal CI systems and the new GitHub CI system were out of sync,
with the external system not doing any linting.  Further, the internal
system was using an internal-only linter for Python.

This creates a script for Python linting based on the open-source
pylint tool, checks in the Google Style Guide's pylintrc file, creates
a custom action for linting and adds it to the existing workflows,
fixes pre-existing linter errors in Python scripts, and updates pylint
overrides.

b/190743862

Change-Id: Iff1f5d4690b32479af777ded0834c31c2161bd10
2021-06-21 21:46:48 +00:00
Joey Parrish e32b35f3e1 Fix clang-format output during linting
Instead of printing a binary object, treat the output of clang-format
as a utf-8 string.

b/190743862

Change-Id: I596d223792597f8157fdee2d75773131cc858c9a
2021-06-21 21:46:48 +00:00
KongQun Yang c0d68083ac Fix playready_extra_header_data
It should be enclosed in the <DATA> element.

https://docs.microsoft.com/en-us/playready/specifications/playready-header-specification

Fixes #961.
Fixes b/173146719.

Change-Id: I7d235a44afda4a0a301e7231dc8a4e87cce124be
2021-06-18 18:34:24 +00:00
Joey Parrish b07988e4f9
Merge pull request #959 from joeyparrish/master
CI overhaul based on GitHub Actions
2021-06-18 10:40:32 -07:00
Joey Parrish acafc0fd93 Make CI workflows safe when testing in a fork
Testing CI workflows is a pain.  This usually involves forking the
main repo and testing various operations there, where the results will
not break the main repo.

However, some things like NPM and Docker package names were initially
hard-coded.  This meant that a fork would need to customize those in
the workflows to avoid pushing official-looking packages during CI
testing.

This change moves those hard-coded names to GitHub Secrets.  Though
the names are not actually secret, the secret store is per-repo, and
will be independent in a fork.  This makes it easier to avoid
accidentally pushing official-looking releases during testing, even if
the fork has access to the same auth tokens.

Change-Id: Ide8f7aa92a028dd217200fca60881333bf8ae579
2021-06-17 13:36:59 -07:00
Joey Parrish a2e07a901e Refactor actions and workflows
It turns out that workflows were the wrong way to abstract reusable
pieces of work.  This turns common steps into custom actions (build
docs, build packager, test packager) which can be used as encapsulated
steps in multiple workflows.

This is a much more natural way to avoid duplication compared to the
previous approach of triggering one workflow from another.  This also
has the benefit of all of the steps of a release being represented on
GitHub as a single workflow, making it easier to understand what is
happening and what event triggered those steps.

Change-Id: Ife156d60069a39594c7b3bb3bc32080e6453b544
2021-06-17 10:32:24 -07:00
Joey Parrish 53c39ef9ac Address PR feedback
- Document necessary repo secrets
 - Compress build artifacts directly to the arifacts folder
 - Log test commands as they are executed
 - Add comments

Change-Id: I1cc150995d339e2e93bee4570d80263dae362bb9
2021-06-16 14:24:24 -07:00
Joey Parrish 0fdd046a14 Tweak job name in Update Docs workflow
Change-Id: Ifdf4343613921aa4e34a91a76fa241ab85862760
2021-06-16 12:18:01 -07:00
Joey Parrish 0f8749a211 CI overhaul based on GitHub Actions
This replaces Travis (for Linux & Mac) and Appveyor (for Windows) with
GitHub Actions.  In addition to using GitHub Actions to test PRs, this
also expands the automation of releases so that the only manual steps
are:

 1. Create a new CHANGELOG.md entry
 2. Create a release tag

Workflows have been create for building and testing PRs and releases,
for publishing releases to GitHub, NPM, and Docker Hub, and for
updating documentation on GitHub Pages.

When a new PR is created, GitHub Actions will:
 - Build and test on all combinations of OS, release type, and library
   type

Appveyor's workflow took ~2 hours, whereas the new GitHub Actions
workflow takes ~30 minutes.

When a new release tag is created, GitHub Actions will:
 - Create a draft release on GitHub
 - Extract release notes from CHANGELOG.md & attach them to the
   draft release
 - Build and test on all combinations of OS, release type, and library
   type, aborting if any build or test fails
 - Attach release artifacts to the draft release, aborting if any
   one artifact can't be prepared
 - Fully publish the draft release on GitHub
 - Publish the same release to NPM (triggered by GitHub release)
 - Publish the same release to Docker Hub (triggered by GitHub release)
 - Update the docs on GitHub pages

Closes #336 (GitHub Actions workflow to replace Travis and Appveyor)

b/190743862 (internal; tracking replacement of Travis)

Change-Id: Ic53eef60a8587c5d1487769a0cefaa16eb9b46e7
2021-06-16 11:52:02 -07:00
Joey Parrish 032cf2a345 Fix libpackager_type variable undefined by default
In e2efb5d4, I fixed shared_library builds on Windows, but I
introduced another issue in which the libpackager_type variable was
not correctly defined by default.  This meant that the build only
worked with this variable explicitly-defined in GYP_DEFINES when
gclient sync was run.

This fixes the default definition so that libpackager_type does not
need to be defined explicity.

Related to #318 (shared_library builds on Windows)

Issue #336 (progress toward GitHub Actions workflow to replace Travis
  and Appveyor, where we need to build and test shared_library on all
  platforms)

b/190743862 (internal; tracking replacement of Travis)

Change-Id: If353e1d3c312ab0c568d4d4d2b789e922d7216e1
2021-06-16 10:14:04 -07:00
Joey Parrish 098f58a143 Fix shared library test runs on Windows
Shared library builds worked, but failed tests because they were made
with the wrong CRT linker settings.  Strings allocated within the
library could not be freed outside the library because the dynamic CRT
was not used.

This sets necessary gyp variables to link with a dynamic CRT on
Windows, thereby fixing tests running in shared library mode that
otherwise hung in a GitHub Actions environment.

Related to #318 (shared_library builds on Windows)

Issue #336 (progress toward GitHub Actions workflow to replace Travis
  and Appveyor, where we need to build and test shared_library on all
  platforms)

b/190743862 (internal; tracking replacement of Travis)

Change-Id: Iffefd27c2aa4ec479ce1d10b099483e417d2231f
2021-06-15 19:37:32 -07:00
Joey Parrish e2efb5d41c Fix Windows shared_library builds
To make shared_library builds work on Windows with MSVS 2019, this
commit:
 - Silences a useless warning about a private member in dll-exported
   Status class.
 - Exports the File class used by packager.exe
 - Removes the explicit File dependency in packager.exe in favor of
   libpackager, now that File is exported
 - Add missing defines in packager.exe and packager_test.exe that
   instruct the linker to import Status and File from the library

Closes #318 (shared_library builds on Windows)
Issue #336 (progress toward GitHub Actions workflow to replace Travis
  and Appveyor, where we need to build and test shared_library on all
  platforms)
b/190743862 (internal; tracking replacement of Travis)

Change-Id: I091f1655d88d36f353f7df497101eef17729eefe
2021-06-15 13:16:47 -07:00
Joey Parrish 2526c61e9e
Merge pull request #955 from joeyparrish/master
At this point static_library builds are working in MSVS 2019. shared_library builds are still not working.

Closes #867 (MSVS 2019)
Issue #318 (progress toward shared_library support on Windows)
Issue #336 (progress toward replacing Travis & Appveyor with GitHub Actions, which uses MSVS 2019)
b/190743862 (internal; tracking replacement of Travis)
2021-06-14 15:25:39 -07:00
Joey Parrish 60464334c1 Update build instructions for Windows
The build instructions have been updated with necessary environment
variables for newer MSVS versions.

Issue #867 (MSVS 2019)
Issue #336 (progress toward replacing Travis & Appveyor with GitHub
  Actions, which uses MSVS 2019)
b/190743862 (internal; tracking replacement of Travis)

Change-Id: Ic80ba22a750946a508803c52af6b7869964d595b
2021-06-14 12:17:31 -07:00
Joey Parrish 98782c051e Skip clang updates on Windows
We do not use clang to build on Windows, so we should skip trying to
update clang.  This is critical to MSVS 2019 support, since the older
clang tools we depend on do not recognize that newer environment.
Since we don't need clang anyway, skipping the update avoids useless
errors about finding a matching clang version for the environment.

Issue #867 (MSVS 2019)
Issue #336 (progress toward replacing Travis & Appveyor with GitHub
  Actions, which uses MSVS 2019)
b/190743862 (internal; tracking replacement of Travis)

Change-Id: I5600ed809b11e68444034a06cc891403e6bfb5cc
2021-06-14 12:17:28 -07:00