Implemented E-AC3 MPEG-2 Stream Encryption Format for HTTP Live
Streaming specified in https://goo.gl/1sgcwY
Issue #279
Change-Id: I36c1a05e3d0529ff810eaf52bdca45414baa93eb
Audio samples per frame for AC3 was not specified correctly earlier.
Also the number of channels is not correct if LFE channel is on.
Issue #165
Change-Id: Ibf20aa4c7aec43c07ec7cd394d631c537cb387dd
Implemented MPEG-2 Stream Encryption Format for HTTP Live Streaming
specified in https://goo.gl/N7Tvqi.
This change also moved ProgramMapTableWriter creation from TsWriter
to TsSegment.
Issue #165
Change-Id: Ia89dd16a5e6405706dd3d85ec6b6de580f7b13a7
The keys can be specified in --keys option, with the form of
label=<label>:key_id=<32-digit hex string>:key=<32-digit hex string>,label=...
There can be multiple "label=..." block. The DRM label can be one
of "AUDIO, SD, HD, UHD1, UHD2" or a custom label.
Mark --key and --key_id as deprecated. We can achieve the same result
with --keys=label=:key_id=<key_id>:key=<key>.
Also add a new optional field in stream descriptor: drm_label, which
is used to overwrite the internally generated DRM label for the stream.
If not provided, the DRM label is generated automatically based on
audio/video information, e.g. resolution.
Code changes:
- Merged RawKeyEncryptionParams and RawKeyDecryptionParams into
RawKeyParams.
- Make FixedKeySource accepts RawKeyParams as input.
Change-Id: Ic8c2f071cc71188e13f14bc6396fc2b3ffa5cac6
Problem occurs when the media playlists are in a sub-directory under
master playlist. If base_url is not set, segment URL should be
relative to the media playlist.
This only affects fMP4 as TS does not have init segment.
Fixes#253
Change-Id: Icddd9ed500d0a705e8b3260bfd4e916ecbba3f28
To help isolate the differences between audio/video and text in
preparation for adding the better text support, this change moves
all audio/video job creation and text job creation into their
own functions.
Change-Id: Ia71cf82ac147672b70c69123eeabdfc6b41c4a3d
This fixes shared_library not able to compile problem.
Also removed StreamDescriptorList and replaced with expicit
comparison to make the code clearer.
Also removed an out-dated DCHECK that mpd_notifier and hls_notifier
does not co-exist.
Change-Id: I3d04b8880741fecf0931a764cc12e50aa5e392b9
Use std::shared_ptr<const uint8_t> with a custom deleter to
represent MediaSample::data_ instead of std::vector<uint8_t>.
MediaSample::data_ can be shared by multiple MediaSamples and it is
immutable. A new data instance must be created if the clients want to
modify the underlying data. The new data instance can be transferred
to MediaSample using provided MediaSample::TransferData function.
This avoids unnecessary data copying.
Change-Id: Ib59785a9e19d0abb3283179b12eb6779ee922f79
Took the test structure for trick play and made a common test
structure that can be used for new tests. The next tests to
use this structure will be the new WebVtt pipeline.
Change-Id: I5faca306b8a2bd16b9f945d1ff5c336aed82bc35
This change create some matchers and text functions that
will be used by the upcoming webvtt work.
Change-Id: I2d7931d1bdabd761f74e8aee7524d5ecfb7cfdc4
Before the trick play handler would have one input and multiple
outputs. The normal media handler API for adding handlers had to
be ignored when setting-up the trick play handler.
This changes the trick play handler to have one input and one output.
It uses the standard AddHandler method calls. When initialized, the
trick play factor must be provided.
This included a run of 'clang-format' over all edited files.
Change-Id: I7b3cdf0a2472e2f89ab194867c4b984e26f18f24
To allow more tests to use the MediaHandlerTestBase and get access to the
helpful creation methods, this change moves the use of FakeMediaHandler
and setting up the graph to a sub class.
Change-Id: I90dd151e3c96d8fbe4bd02a1d6b11e66a279d95b
Created media handlers that make testing a handler easier by providing
methods to send messages from upstream and check messages downstream.
Change-Id: I7b3ba3a51bcf0d73bcaacd46b2dcbc16f87d8694
Moved build instructions and docker instructions to separate docs.
Removed command samples which are no longer needed as we have better
tutorials now.
Change-Id: I340c5653a6553158325970dd86d76fa11e69bcbd
In prep for changes to Trick Play, we want to make all messages
copy on write so that if the same message is sent to multiple
handlers, it is not possible for one handler to change the data
another handler is using.
Change-Id: I554166ca11c532412e4dfced5603972ca24dc2bb
Problem occurs when the media playlists are in a sub-directory under
master playlist. If base_url is not set, media segment URL should be
relative to the media playlist instead of the master playlist.
Also make sure the path separator is "/" in URL instead of "\" on
Windows.
Fixes#253
Change-Id: I8e933750276435d94dd01bfa53ee2bc050dfd193
Previously packaging completes successfully without any error
or warning.
With the fix, an error will be reported if write fails. It may
appear as "Cannot close file error" as we use threaded IO, which
could delay the error reporting until Close() call, so the user
of the File API needs to make sure Close() returns successfully.
Also fixed a deadlock in threaded_io_file if internal_file->Write
fails.
Fixes#160
Change-Id: I17f945150fb4021d2dcdbe784e557673f53ca583
Doxygen should run under src/ directory:
$ doxygen docs/Doxyfile
Outputs are created in out/doxygen.
Change-Id: I9dd1a9aa158851d37ff9a2e37f701757eb3e577c
To ensure that the style data is formatted correctly, changing the
set_style method to AppendStyle so that joining values will be
done in controlled setting.
Change-Id: Ia88e2d260b11339e6777ff018813e8aeb802a501
There are multiple functions we use to verify input from the user
and must of them would return a boolean expect for the top level
function which would return a Status. Each function would log a
message but to the user the error was not clear. This change makes
each verify function return a status so that the actual problem
will be surfaced easier.
Change-Id: I12ab43f8ca3a4d379b4309336644a70eb8cbbbe0
Implemented the other end of the webvtt timestamp parsing as it will
be needed when we write out WebVtt files. Also changed the name of
the parse function to be more inline with the writing function.
Change-Id: I1f36ddbbf80028732b4cb1b15e871dec17767f63
Inside of CreateRemuxJobs, we would take a status value from another call,
log the message, and return a boolean. The caller of CreateRemuxJobs would
then create status from the boolean.
Now we will pass the status value from the other call directly to the caller
of CreateRemuxJobs. So that failures can be better communicate in our code.
This includes a pass of clang-format over packager/packager.cc.
Change-Id: I071e7bad13f916e963641b9e53699573fe1060ed
Rewrote the RunRemuxJobs function to use waitable events so that we never
get stuck waiting for a job to finish before getting to a thread that
has already exited.
This should allow us to end execution when a job failed rather than
waiting for all jobs before the failed job to finish.
Closes#94
Change-Id: I413f62561a7a4cab83b8905e75986230b6c498bc
Created a handler called OriginHandler that can be used by the Job class
(previously called RemuxJob). Origin handlers represent the start (or
origin) of a pipeline (chain of handlers).
Change-Id: Ibd748ae0a932b6e0ebb879ea292fcb83c548214b
Support generation of fairplay key system tag: "com.apple.streamingkeydelivery" when --pssh
includes fairplay key system id:
// Unofficial fairplay system id extracted from
// https://forums.developer.apple.com/thread/6185.
const uint8_t kFairplaySystemId[] = {0x29, 0x70, 0x1F, 0xE4, 0x3C, 0xC7,
0x4A, 0x34, 0x8C, 0x5B, 0xAE, 0x90,
0xC7, 0x43, 0x9A, 0x47};
Closes#258
ImportantFileWriter::WriteFileAtomically uses mkstemp internally,
which set file permission to 0600, which is not what we want.
Update the code to not use mkstemp instead.
Also updated temporary file name logic to include process id in
the name so it can be unique across processes.
Fixes#259
Change-Id: I2d5a375925cf552bc0db5269f409d7522e63fca5
This avoids interference caused when two sockets are bound to the
same port in different multicast groups.
Fixes#241
Change-Id: Iba1b3300e3850f1f268886b7a49f5a3315d95b80
Derive file size from media ranges instead.
Also fix subsegment range reporting for WebM (internal variable,
no output affected).
Change-Id: I5f8152dff4c2cd5fbae5550992b86a669e278f7b
- The master playlist should have the display resolution instead of the
encoded resolution.
- Changed MediaPlaylist to return display resolution.
Change-Id: I162727d0bdeed0302518286e42a22b69a58fc4a3
- Use byte range format if segment_template is not set in MediaInfo.
- Change HlsNotifier::NotifyNewSegment() to take start byte offset.
- Change HlsNotifyMuxerListener to cache the segment information if
MuxerOptions::segment_template is set.
Change-Id: Ida1b8b9198acc5c43e3a5d9a641c78c81bc9a6ac
- Changed OnMediaEnd() to take (sub)segment ranges.
- Define a structure to pass the ranges.
- This requires muxers to "cache" the segment ranges but in most cases,
they already do it, e.g. 'sidx' for mp4.
Change-Id: I16b974c1f0f54ca658cc6dbe605efff84a3f52eb
In the original manifest updating process, the file was truncated first
before was written with new contents. There is a small chance that
the web server may read back empty file or incomplete file.
The new code makes the update operation atomic (by writing to a temporary
file first then replace the old file with the temporary file).
Fixes#186
Change-Id: I2fd564cb12b922b032c0e9f70d2132a5b12ff098
- Remove the TS key rotation not supported check as there is nothing
to be done for key rotation in TS for SAMPLE-AES.
- Fix IV updated problem in new segments even if crypto period does
not change.
- Avoid duplicate EXT-X-KEY tags if it does not change.
- Make EXT-X-DISCONTINUITY-SEQUENCE match with number of removed
EXT-X-DISCONTINUITY.
- Added end to end test for HLS with key rotation.
Change-Id: I73cb82e9f5575fcdf63ee643228efe78e6766302
Resolving TODO in packager/hls/base/master_playlist.cc that asked for
media playlists to be grouped when they are added.
Change-Id: I01c7687400bc74ce45f271d0242d1c3bf3610cf2
- This fixes the issue when one NAL unit has multiple
subsamples, which is allowed in spec and could happen
when the clear_bytes exceeds 2^16 bytes.
- The new algorithm updates the subsample entries in
following steps:
1) When NaluReader parses a new NAL unit, the
function splits subsamples and align them with the
NAL unit. It also finds the range of subsamples
for that NAL unit.
2) Drop or update subsamples of that NAL unit,
based on the type. Other inserted bytes are treated
as a new all-clear subsample.
3) Merge those subsamples if possible.
- This addresses #237.
Change-Id: I2cab47cd00d90e29ec52b90d4fde057c632193ac
Moved all the timestamp parsing code into its own class with its
own unit tests. This is to make testing easier.
Change-Id: I624472baba51dfa1254a9f4bae55ebb79e310855
The HLS manifests output by the packager did not have the RESOLUTION
attribute on EXT-X-STREAM-INF tags. This change adds the resolution
tag when resolution values are present.
Close#235
Change-Id: I15ca6de47cb34793cf6a940123d593261627baa4
Shared libpackager can be built by setting libpackager_type to
shared_library, e.g.
GYP_DEFINES='libpackager_type=shared_library' gclient runhooks
ninja -C out/Debug
will generate libpackager.so in out/Debug/lib directory.
Here is a few other changes to make shared_library builds and
tests pass:
- Add several test parameters to packager.h, which is needed for
testing.
- Create a protoc.gypi from build/protoc.gypi but depending on
protobuf_full_do_not_use instead of protobuf_lite, since we need
protobuf_full_do_not_use for text parsing and generation of media
info proto. Somehow shared_library build does not allow mixed use
of protobuf_full_do_not_use and protobuf_lite.
- Remove the use of LazyInstance in version/version.cc and use static
variable directly. This is because LazyInstance needs AtExitManager
which may not be easy to setup when calling GetVersion.
- Allow skipping testPackageWvmInputWithoutStrippingParameterSetNalus
with flag --shared_library, which is needed as shared_library build
does not support --strip_parameter_set_nalus flag yet.
Fixes#227
Change-Id: Iff05a50baa28134faa7218664c96114cb9e70329
Added a text sample type that can be passed between media handlers.
This will allow text samples to safely be moved between media
handlers before converting to their final format.
Bug: 36138902
Change-Id: Ic4946f774a7d37c43066b9ea46596d5c5f3c05a8
frame_duration is not available when the VideoInfo is created, but
it will become available when a media segment arrives.
Change-Id: I2c24852fca4ff77c2b86ff78dbf0963ad0a0afa6