Commit Graph

492 Commits

Author SHA1 Message Date
KongQun Yang 03889e6465 Move hex string out of packager.h
Also added validation failure tests in packager_test.py.

Change-Id: I6697a3138d57889110250404205536dd5cd53cd0
2017-06-20 22:33:47 +00:00
KongQun Yang abbd495ad4 KEYFORMATVERSION should be 1 for HLS Widevine key system
Change-Id: I59c7852727b803bcdb1e49d33e36fca7f51e507c
2017-06-20 22:33:03 +00:00
Aaron Vaage 7c48cc4800 Group MediaPlaylists in AddMediaPlaylist
Resolving TODO in packager/hls/base/master_playlist.cc that asked for
media playlists to be grouped when they are added.

Change-Id: I01c7687400bc74ce45f271d0242d1c3bf3610cf2
2017-06-20 14:35:52 +00:00
Haoming Chen 78f4fd9d3f Fix an issue in NalUnitToByteStreamConverter.
- 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
2017-06-19 20:19:11 +00:00
KongQun Yang 096c22ee63 Rename shaka::ShakaPackager to shaka::Packager
Change-Id: I493d3a6cf4c27615d1515de7c43dc3c5b8e3224e
2017-06-16 23:08:06 +00:00
Aaron Vaage 26d39db0e7 Moved Timestamp Parsing For Easier Testing
Moved all the timestamp parsing code into its own class with its
own unit tests. This is to make testing easier.

Change-Id: I624472baba51dfa1254a9f4bae55ebb79e310855
2017-06-16 18:26:16 +00:00
Aaron Vaage 0caab0a4b4 Add resolution to HLS manifests
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
2017-06-16 01:28:55 +00:00
KongQun Yang 1aeedd102e Use free-form strings for stream labels (track types)
Change-Id: I38489acbdfaf4bb491635fdc7f6b0cab77a53574
2017-06-13 15:04:00 -07:00
KongQun Yang 05a5a41969 Support generation of libpackager.so (shared_library)
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
2017-06-13 20:42:32 +00:00
KongQun Yang 2816a7262e Integrate packager top level library
Change-Id: Ic2e2ef79d2f5db5aab6565835aaaf6cb1c7e44bb
2017-06-13 13:40:26 -07:00
KongQun Yang db45711750 Implement top level API: packager.cc/h
Change-Id: I2b4fbc0b9f6df5617e9f59173e144c7be1b01d2b
2017-06-13 19:23:34 +00:00
Aaron Vaage 2d2825290c Added TextSample
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
2017-06-09 16:03:34 -07:00
KongQun Yang d28b19788d Remove misleading frame duration message in live mode
frame_duration is not available when the VideoInfo is created, but
it will become available when a media segment arrives.

Change-Id: I2c24852fca4ff77c2b86ff78dbf0963ad0a0afa6
2017-06-08 22:32:06 +00:00
KongQun Yang a251208a75 Report an error on encrypted stream without decryption
Change-Id: I784af57ca79aeb8a12245bd130f413ea6e3d04f1
2017-06-07 21:49:46 +00:00
KongQun Yang a0bd3dd565 The retired availability_time_offset flag should have value 0
Change-Id: I6a34c362c0c5252853f0883b54c19c434bd1d8b8
2017-06-01 14:55:16 -07:00
KongQun Yang 5ad40df810 Fix misleading error messages in WebM output
Issue #239

Change-Id: I4e6e6aafbeb0e9613769e05bd81353409576876d
2017-05-30 16:29:47 -07:00
KongQun Yang 19be04ecce Fix git not found on some Windows setups
Change-Id: I0403212f383e60ef75b426170783933f4d73b211
2017-05-26 13:52:42 -07:00
Haoming Chen 32b088c4bc Add sample usage for trick play in README.md.
Change-Id: I1c1f4af37b3573ffdbcc4368826417f1d07da437
2017-05-23 18:33:33 +00:00
KongQun Yang 18cdbd4121 Deprecate availability_time_offset MPD flag
'availability_time_offset' is not an attribute in MPD specification,
but used to calculate availability_start_time to adjust segment
availability time. A similar effect can be achieved with standard
blessed suggested_presentation_delay flag.

If suggested_presentation_delay is not set, player is expected to
choose a suitable value.

Change-Id: I1d540bd4347b4f04b6cc5ec0778e1a5392009b09
2017-05-22 23:14:16 +00:00
sylt bfe302bd5c Add support for skip_encryption stream descriptor (#219)
This option makes it possible to control encryption for specific streams,
e.g. for audio and video separately.
2017-05-22 10:17:58 -07:00
KongQun Yang 3443048e80 Fix WebM timestamp overflow if longer than 2.5 hours
Fixes #233

Change-Id: I3431f8e68bfb1de222b8ab967c9cac6a821b4f53
2017-05-17 17:00:44 -07:00
Haoming Chen 27abb208aa Remove the trick_play_factor in media_info.proto.
- Use the playback_rate instead.

Change-Id: I341c39de1c28aacebab5b31aa013bcbbcc2fa9d0
2017-05-17 22:10:49 +00:00
Haoming Chen da8877d8a2 Rename trick play rate to trick play factor.
- Add a "tpf" abbreviation in stream descriptor for
  trick_play_factor.

Change-Id: Ia09313bb9778456b53bdb0a8cc46d2ba8caa2ac2
2017-05-17 21:51:34 +00:00
Kongqun Yang 5fc6e540f3 Include protection_scheme in Widevine CENC request
Widevine license server added support for protection_schemes recently;
If CENC request includes protection_scheme in the CENC request, server
will return with a PSSH with protection_scheme filled in.

Change-Id: I6dcac498b5e039503d6ac0f6e057737f7c53efaf
2017-05-16 01:18:39 +00:00
KongQun Yang d9e7e2f1d0 Generate two sample entries only if there is clear lead
This addresses playready broken with clear lead = 0.

clear lead != 0 is still broken with playready on Edge. We think it is
likely an Edge bug, which does not support multiple sample entry boxes,
thus does not support clear lead.

b/37913785

Change-Id: I7adb77a913dccf669153b03b31b4a1e1c98d1cb0
2017-05-15 14:13:52 -07:00
Haoming Chen 4ba5bec660 Integrate trick play.
- Add trick play adaptation in mpd. This addresses #178.

Change-Id: Id6cc08c788eda074c261d0274768051837b84541
2017-05-09 13:33:11 -07:00
KongQun Yang 1e2da22c88 Add support for WebM colour element
Change-Id: I359cde97171118d3b928a9dd6650d11fade8f4a9
2017-05-02 20:22:17 +00:00
KongQun Yang 84ff940e22 Add init_segment name in --help
Closes #228

Change-Id: I596ae7519632f269e8d3e9cfcf0e96564b248d01
2017-05-02 10:25:31 -07:00
Kongqun Yang 4a47268f3d Fix avc3 codec string problem
- Added wvm decryption and demuxing test
- Added avc3 test (not strip parameter set nal units)

Change-Id: I28ff4d7f9ef539eafe45cfadfc0912cd11c72b05
2017-04-28 19:24:11 +00:00
KongQun Yang 59f393779c Support v1 vp9 in iso-bmff
- Implemented according to v1.0 spec @ https://www.webmproject.org/vp9/mp4/
- v0 is no longer supported

Change-Id: I189c813d788400beda797eea7da943a83dfa7d79
2017-04-27 19:37:14 +00:00
KongQun Yang 4d81979b16 Add -v and --vmodule flags in test script
The flags will be propagated to packager binary if set.

Change-Id: I38aa9f4fb8e23f7a802d4114b5507035ef0cc583
2017-04-26 10:25:28 -07:00
Kongqun Yang fb0790e1d5 Refactor KeySource::FetchKeys to use EME init data types
Change-Id: I517ea992a8868d7382988a8837f4f05df9f974d7
2017-04-20 20:21:29 +00:00
Rintaro Kuroiwa 9d101f85e3 Print the failing command if subprocess.call() fails
Change-Id: Ib640b590e259a1a9bd44030ae13611cd359721e0
2017-04-18 16:33:35 -07:00
Kongqun Yang 75a4b55b34 Fix AAC-HE not correctly signaled in codec string
- Also fixed a bug with dts audio in esds.

Closes #225

Change-Id: I50ca731ac81bedfec37b0e2d577c51d643b7a839
2017-04-13 23:40:23 +00:00
Zajcev Evgeny a24444cc1b [fix] kAdtsNumChannelsTable: Standard specifies 3 channels (#226)
CHANNEL_LAYOUT_SURROUND = Front L + Front R + Front C
2017-04-11 10:23:32 -07:00
Rintaro Kuroiwa a3b5e7d01a Widevine HLS new key format manifest side
- This changes the manifest side for the new key format.

Change-Id: I329f3c84605e5d2180e219643cb17282152f687b
2017-04-10 19:05:23 +00:00
Rintaro Kuroiwa c2e019ed31 Output command line when packager tests fail
- Changed python packaging test to output the command line it ran for
  tests that failed.

Change-Id: I52c06bcec725c9dce7f845ab138cfab29b582201
2017-04-05 20:05:01 +00:00
Rintaro Kuroiwa f3e91301c2 Widevine HLS new key format media event side
- This change has the muxer listener side changes.
- Also changed SetContentProtectionFields() to take vector for
  default_key_id so that MuxerListener subclasses don't need to convert
  it to string.

Change-Id: I8832848a0c7e34b84e2b4e6baeba364861900ff1
2017-04-05 11:12:57 -07:00
Kongqun Yang 437d48f041 Fix Windows 64 break (#222)
Change-Id: I88bfdee9020a6abb96d6d38397263c08773501df
2017-03-31 14:37:02 -07:00
Kongqun Yang d007ddf20b [MP4] Make outputs CMAF compatible
- Added flag --mp4_include_pssh_in_stream, default to true. If it is
  set to false, the encrypted mp4 stream will not include pssh.
- Align BytesOfProtectedData to multiple of 16 bytes for cenc.
- Set TrackHeader flag to kTrackEnabled | kTrackInMovie |
                          kTrackInPreview
- Move mvex to after trak, required by HLS
- Add cmfc/cmfs compatible brands except for avc3/hev1, where CMAF
  requires single initialization switching set which is not supported.
- Set duration to 0 in tkhd, mdhd, mvhd.

Also updated major_brand and compatible brands:
- Set major_brand to isom (iso-bmff media file format) and made dash
  a compatible brand
- Replaced compatible brand iso6 with iso8 since we use sthd for text
  tracks

Fixes b/36278260

Change-Id: I3cc5dd5aa1621714d517fe02fe3841d19a1a07f6
2017-03-30 15:33:39 -07:00
Kongqun Yang 5d71d8cc9f Move demuxer.cc/h to packager/media/demuxer
- Also fix the misleading error if an invalid input is provided
  The command line app now correctly reports that the file is not
  found instead of stream not available.

Change-Id: I8cfccb62d7a50de57766666f126cf061e3df5ded
2017-03-30 14:35:34 -07:00
Kongqun Yang 1af8f04e40 Rename webm_subsample_encryption flag to vp9_subsample_encryption
This is what webm_subsample_encryption flag actually does.

- Fixes the flag not working problem introduced by previous CLs.
- Also mark flag webm_subsample_encryption as deprecated.

Closes #220

Change-Id: I03ff843786572a91c01b8bd346a3ce50b129118f
2017-03-30 20:36:43 +00:00
Rintaro Kuroiwa 92280bf214 Full vtt in mp4 path
Change-Id: I7f49dbfed188ff7a451b0b4fbd6947590e8935d1
2017-03-29 18:52:25 +00:00
Kongqun Yang ec904f3f79 Add a new test to exercise emulation prevention after encryption
Also added a few more command line flags for end to end test:
- no-remove_temp_files_after_test: do not remove test artifacts after
  test
- encryption_key, encryption_iv: allow injecting encryption key/iv from
  command line

Change-Id: I62084790e10fe6a385b90cb96d9515d8436b2a49
2017-03-28 13:18:33 -07:00
Haoming Chen 6347b29ad7 Fix Windows build for trick play handler. (#221) 2017-03-27 23:04:29 -07:00
Rintaro Kuroiwa 4891d9a6bf HLS with fragmented MP4
- Add EXT-X-MAP tag for init segment.
- Do not set output field on stream descriptor if not specified on
  command line. If it's set (internally) then it gets copied to
  MediaInfo that gets passed to the manifest generators.

b/36279481

Change-Id: I762c55b255699ec691817dc4806b0dee2f7504b8
2017-03-27 13:20:03 -07:00
Haoming Chen cc04698460 Implement trick play handler.
Change-Id: I3d288dc7c4b77fd3aca1bad2ce96ad733384bcc8
2017-03-24 18:34:42 -07:00
Rintaro Kuroiwa 0a3ef49c11 Change {luma,chrome}_weight_flag to arrays
- The flags were overwritten in a loop and therefore only stored the
  last value of the flag.
- Change the fields into arrays so that the flags are not overwritten.

Change-Id: I59762d7c84bc3d81bf3b0b5e85ffe689260d970a
2017-03-24 21:14:18 +00:00
sylt 81beb8aeb2 Don't do timeshift SlideWindow() logic for static MPD (#218)
This is a fix for issue #216 where the Representation::SlideWindow() logic was
still active even though a static MPD was being asked to be generated (using
the option -generate_static_mpd). This could cause static streams longer than
1800 seconds to start playing at (end-position-for-stream - 1800 seconds).

This change is in compliance with the current usage documentation for the
shaka-packager, which suggests that -time_shift_buffer_depth only is relevant
for dynamic media presentations.
2017-03-24 10:37:13 -07:00
Kongqun Yang bc4c511ad4 Fix Windows build break (#217)
Change-Id: Id0a00c01077adb97f294c68357b629441321e6c7
2017-03-24 10:21:05 -07:00
Kongqun Yang 277c5b23c0 Allow generating avc3 / hev1 from TS and Wvm files
Added a flag --strip_parameter_set_nalus. When enabled, parameter
set NAL units, SPS/PPS for H264 and SPS/PPS/VPS for H265, are stripped
from frames when converting NAL byte stream (AnnexB stream) to NAL
unit stream, which generates avc1/hvc1; otherwise they are not
stripped, and avc3/hev1 is generated.

Parameter set NAL units should not be stripped if they are varying
in the frames otherwise the frames may fail to be decoded.

The flag is enabled by default as we don't usually see varying
SPS/PPS/VPS and it is more space efficient with them stripped.

Set --strip_parameter_set_nalus=false to disable the flag if there
are varying SPS/PPS/VPS in the frames. This addresses #206.

Change-Id: I34bde6f33069f9f77d51a510b39f58a0f0e141aa
2017-03-23 13:53:14 -07:00
KongQun Yang 3d7635d5de Integrate EncryptionHandler
Change-Id: I639e5707994a6601ee02078cd6f77cb38b481585
2017-03-23 18:25:59 +00:00
KongQun Yang 16615095f0 Update NalUnitToByteStreamConvert to support escaping encrypted NAL only
- Also fixed a bug if nalu_length_size != 4.

Change-Id: Ia8c67c4b1ff08a6b64fa1e309b5ecd8f5c8ea421
2017-03-23 18:21:24 +00:00
sylt d2c9a88ec5 Fix possible integer overflow in WebM duration
The issue could lead to the MPD attribute mediaPresentationDuration being
wrongly generated for WebM streams with a duration longer than INT32_MAX.

The root-cause was that StreamInfo::set_duration() accepted an int instead of a
uint64_t. This seems like a pure typo, since StreamInfo already uses a uint64_t
internally for representing duration.
2017-03-23 09:38:51 -07:00
Kongqun Yang d323d4f091 Fix break in Windows (#213) 2017-03-22 09:57:18 -07:00
KongQun Yang b09c8f6521 Update EncryptionHandler to support key rotation and SampleAes
This CL also removes EncryptionConfig stream data type and merges it
into StreamInfo/SegmentInfo instead.

Change-Id: Idb70ce503e61d3c951225cc78b6b15c084e16dcd
2017-03-21 23:50:53 +00:00
Kongqun Yang b891e0271e Make CENC behavior of VP8/9 in ISO-BMFF the same as in WebM
- Disable subsample encryption for VP8 in ISO-BMFF
- Apply block alignment to all subsamples for VP9 in ISO-BMFF,
  instead of just superframes.

Change-Id: I8dd31cc16e87abc4d538330eaff9acb0509497df
2017-03-21 23:12:57 +00:00
Kongqun Yang 0cb0f79c33 Fix build break in Windows (#211)
Change-Id: I0ed7a712fd02ea4dddd9c20541c2df653dc456cb
2017-03-17 12:45:28 -07:00
Kongqun Yang 0c3fb49eeb [WebM] Fix output truncated if using the same file name for I/O
Open output file in DoFinalize() to ensure that the input file has been
closed already.

Fixes #210

Change-Id: I935941b31c667e49be030c8da9f953d8387c7a9d
2017-03-17 01:07:49 +00:00
Rintaro Kuroiwa 15fd745fa7 Remove redundant flags in H264SliceHeader
- luma_weight_l0_flag, luma_weight_l1_flag,
  chroma_weight_l0_flag, chroma_weight_l1_flag were there but not set.
- The user should use the values in pred_weight_table_l0 and
  pred_weight_table_l1 instead which are set.

Change-Id: Ic9c44fb113717346938a339faf074daa32d4c2d2
2017-03-17 00:05:36 +00:00
Kongqun Yang 8806f78655 Use size_t as the type of stream_index
Change-Id: Ica8ffeccc45c1adf5def6fe9b2edde5708d6b432
2017-03-16 20:54:48 +00:00
Kongqun Yang 160700b452 Integrate ChunkingHandler
Also moved MediaHandler output validation to Initialize instead.

This CL also addresses #122 with consistent chunking.

Change-Id: I60c0da6d1b33421d7828bcb827d18899e71884ce
2017-03-16 20:54:36 +00:00
Rintaro Kuroiwa a3ce51785a Make WebVttMediaParser use WebVttSampleConverter
- WebVttMediaParser uses WebVttSampleConverter to generate non
  overlapping media samples.
- The media samples contains ISO BMFF boxes.
- Add kCodecWebVtt to signal that the media is webvtt and
  the samples will be in ISO BMFF boxes.

Change-Id: I639902cdba7b04af75428bc20622e26b8203cfb2
2017-03-15 20:44:36 +00:00
Joey Parrish 924d6d4693 Add HLS audio language support
Before this, HLS output did not contain language information.
Now, media playlists are properly tagged with a language in the
master playlist.

b/36134267

Change-Id: I172e946dbedd096a44cb2f917b007cc004756228
2017-03-10 16:14:14 -08:00
Kongqun Yang c6cbd73465 Rename FlushStream to OnFlushRequest; add FlushOutput
Change-Id: I2b37030b0c35aa34e9c72e43825f157924034227
2017-03-08 11:21:19 -08:00
KongQun Yang 8f2cd6da91 Implements Demuxer and Muxer media handlers
- Also sets up the packaging and verify it works.

Some of the changes are temporary to get the integration going.

Change-Id: I0cf6c379d185e157808acabb9ef58ff93d4a39ae
2017-03-08 19:11:52 +00:00
Kongqun Yang 12c61d6792 Fix pssh README to avoid confusion
Change-Id: I1ac1c4fbb75c2db6d1d960b1681afea0bac61bb8
2017-03-03 16:13:25 -08:00
Kongqun Yang 24ba12c18e Remove escape parameter in NalUnitToByteStreamConverter
The spec actually requires all NAL units to be escaped, so there
is no need to escape it again.

NAL byte stream is one demarcation method; NAL unit stream is another
demarcation method. Regardless of the demarcation method used, the
requirement for NAL unit is the same. See the last paragraph of
7.4.1 NAL unit semantics on the requirement on emulation prevention bytes.

Change-Id: Icc63fcc5cf965632e331f5af5f673164c7c1663a
2017-03-02 23:01:53 +00:00
Kongqun Yang c223bc9144 Keep slice data partition NALs in clear
CENCv3 recommends only encrypting video data in slice NALs. Slice
data partition NALs should not be encrypted.

In the code, differentiate is_vcl and is_video_slice. They are the
same for H265; for H264, vcl NALs include slice data partition NALs
but video_slice NALs do not.

Change-Id: I91f4bdd76d25f0eac50e39aed350ebce3f667121
2017-02-28 18:10:30 -08:00
Rintaro Kuroiwa 5c07ff6b1c Move and rename webvtt fragmenter to webvtt sample converter
- The class should be used to generate samples from the demuxer.

Change-Id: If7f245e5809de8773c0b1cf08673ae62dfeffe09
2017-02-14 16:33:18 -08:00
Rintaro Kuroiwa 593f513c83 Fix windows build
Change-Id: Ie23ebd9f18bf2151e52550bff62e2b043ac65ac2
2017-02-14 11:21:52 -08:00
Rintaro Kuroiwa 1879bca4bb Fragmenter for WebVTT
- Logic for splitting up WebVTT cues into MP4 samples.
- For any cue intervals that overlap, a new sample must be created.

Change-Id: Icf7478f42d8c5790bf6f404d512c1251dd34c405
2017-02-13 13:33:36 -08:00
Kongqun Yang 50787c605d Fix build break in win64
Also updated appveyor to build x64 first.

Change-Id: I1970e39bad559b3105ea31fb82375406d95f4a8b
2017-02-10 22:57:35 -08:00
Kongqun Yang 5f6e4a1dc1 Using std::shared_ptr instead of std::unique_ptr in stream data entry
Change-Id: Ib8c6f97c2329ba5b9431c301d85c1d61f89fc3d8
2017-02-11 02:41:49 +00:00
Kongqun Yang 9990524f98 Implement ChunkingHandler
This handler is a multi-in multi-out handler. If more than one input is
provided, there should be one and only one video stream; also, all inputs
should come from the same thread and are synchronized.
There can be multiple chunking handler running in different threads or even
different processes, we use the "consistent chunking algorithm" to make sure
the chunks in different streams are aligned without explicit communcating
with each other - which is not efficient and often difficult.

Consistent Chunking Algorithm:
 1. Find the consistent chunkable boundary
 Let the timestamps for video frames be (t1, t2, t3, ...). Then a
 consistent chunkable boundary is simply the first chunkable boundary after
 (tk / N) != (tk-1 / N), where '/' denotes integer division, and N is the
 intended chunk duration.
 2. Chunk only at the consistent chunkable boundary

This algorithm will make sure the chunks from different video streams are
aligned if they have aligned GoPs. However, this algorithm will only work
for video streams. To be able to chunk non video streams at similar
positions as video streams, ChunkingHandler is designed to accept one video
input and multiple non video inputs, the non video inputs are chunked when
the video input is chunked. If the inputs are synchronized - which is true
if the inputs come from the same demuxer, the video and non video chunks
are aligned.

Change-Id: Id3bad51ab14f311efdb8713b6cd36d36cf9e4639
2017-02-11 02:41:34 +00:00
Kongqun Yang 7a90ee70ab Implement EncryptionHandler
Change-Id: Iabedf3b02057d6124d5393ae9618490e5595ad89
2017-02-11 01:21:28 +00:00
Kongqun Yang 6235352bf4 Fix mpd duration not set in static live manifest
Closes #201

Change-Id: Ie9ab58ec58e1b135931a6576fb46145454b0f049
2017-02-11 00:52:32 +00:00
Kongqun Yang d592217761 Add a warning message when seeing unsupported stream type
Issue #202

Change-Id: If16fe7ccec5dfd869070dfbbb711240a89b2295b
2017-02-09 12:38:49 -08:00
Kongqun Yang bee59bc2fc Enable generate_dash_if_iop_compliant_mpd by default
This will move ContentProtection element from Representation
to AdaptationSet.

Shaka Player already supports AdaptationSet switching
urn:mpeg:dash:adaptation-set-switching:2016;

ExoPlayer does not support it yet. Filed
https://github.com/google/ExoPlayer/issues/2431 to track the issue.

(ExoPlayer does not like having ContentProtection in Representation
anyway)

Closes b/34691105

Change-Id: I69d0a4d0e15a912a35c8b2686620419a28e4cc99
2017-02-09 11:12:21 -08:00
Kongqun Yang 64c6821dc8 MediaHandler implementation
MediaHandler is the basic processing unit in shaka-packager 2.0.

Change-Id: I5f8d744e39adfff5cfebe0c50a29ead4d717cca4
2017-01-26 03:34:18 +00:00
Kongqun Yang 97fbaaa567 Replace scoped_refptr with std::shared_ptr
Change-Id: Ie8ea66e78c42c7387a97bb1abc331c636be11aa4
2017-01-26 02:20:47 +00:00
Yohann Connell 24b0e3031a Adding PlayReady support to Shaka packager
PlayReady Header Object Spec (PSSH Data VOD)
http://download.microsoft.com/download/2/3/8/238F67D9-1B8B-48D3-AB83-9C00112268B2/PlayReady%20Header%20Object%202015-08-13-FINAL-CL.PDF

PlayReady Live Streaming Spec (Consult Appendix for package acquisition information)
http://download.microsoft.com/download/2/D/D/2DD6B4E8-CABF-4DE9-8F61-895BE8F1ED33/ProtectingLiveTVServicesWithPlayReady_March2015.pdf

Issue #128
Change-Id: Ic5c0d6c642ceba3bdf9e8e413934f0fbcba242e6
2017-01-24 13:36:47 -08:00
Kongqun Yang 80c54a533a Update cmd flags to support static mpd with live profile
- Deprecated command line flags --profile and --single_segment.
  'segment_template' in stream descriptors implies live profile
  and non-single segment.
- Added flag --generate_static_mpd_for_live_profile to generate
  static mpd for live profile; if not set, dynamic mpd will be
  generated.

Close #142

Change-Id: I78879297ed118f0f246c4753a16ad125bd6b5e4f
2017-01-13 20:00:10 +00:00
Kongqun Yang 5aaae303e8 Part one of supporting live profile with static mpd
- Added two new fields in MpdOptions: dash_profile and mpd_type
- Updated MpdBuilder to support LiveProfile with static mpd
- Command line arguments will be updated in the next CL

Issue #142

Change-Id: Ibd35e5c9e1b1ef98043392e3f04a0af4700135c1
2017-01-13 19:59:49 +00:00
Chun-da Chen ce23fbacc4 Add support for udp_file in Windows. (#185)
Add support for udp_file in Windows
2017-01-10 10:05:28 -08:00
Haoming Chen 15dacf6288 Fix signed/unsigned mismatch on Windows.
Issue #168
2017-01-06 17:29:53 -08:00
Haoming Chen 93fe5457bf Fix x64 build on Windows.
- Fix integer conversion warnings.
- Fix #168.

Change-Id: Ie9aadea86a293b49e0854d6549800083143c79df
2017-01-05 14:19:35 -08:00
Rintaro Kuroiwa 655fe7b699 Add gitignores for msvs files
- Add MSVS related patterns to gitignore.
- Removed encryption_modes.h from media_base.gyp. It doesn't exist.

Change-Id: I44bc86ff7e79daf6f7bc61c21a558937530d8e66
2016-12-19 21:26:26 +00:00
Kongqun Yang af0904e428 Fix AdaptationSet switching signaling
Current mechanism of using AdaptationSet @group is not spec compliant.

The spec compliant mechanism is to use supplemental descriptor with
schemeIdUri: urn:mpeg:dash:adaptation-set-switching:2016 as specified
in ISO/IEC 23009-1:2014/Amd.4:2016.

Fixes #156

Change-Id: I4d97648547a23315ba9c09dcadb14e18c99a45fc
2016-12-19 20:12:27 +00:00
Rintaro Kuroiwa 7a4a40acb8 Change values for slice header attributes
- nalu_data points to the beginning of the nalu, instead of
  beginning of the slice header which excluded the nalu
  header.
- nalu_size is the size of the whole nalu.
- header_bit_size calculation is corrected. The size used to exclude
  emulation prevention bytes.

Change-Id: Ic00f42caeddf7b4701f3948e6ef8a3537fd7f770
2016-12-15 17:07:17 -08:00
Kyle Alexander 0c2ee4c844 Add support for 4K and 8K content.
Adds UHD1 and UHD2 track types to support 4K and 8K content.

Bug: Closes #163
Change-Id: I8fd893725cae88e9944244a48607cbaab591b401
2016-12-13 19:24:22 +00:00
Kongqun Yang d8d94da250 Fix packager_test break in Windows
Change-Id: Id43e4bd0e2067fd9ad74f8c5c60df7ddba75e840
2016-12-09 19:11:04 -08:00
Kongqun Yang c8ffa54d35 Fix --version in drive programs
Fixes #176

Change-Id: Ib092f81e1af49dfee43f7b01c0008a1b40c9098b
2016-12-08 14:45:05 -08:00
Kongqun Yang eab7910029 Fix crash when seeing unsupported es descriptor data
Addresses #175

Change-Id: Ia9c2f0c7a8c17a6614db0fe478892bd3c5efd5b0
2016-11-29 23:27:22 +00:00
Haoming Chen 9ed8303a06 Use Windows native ssl instead of openssl.
Fixes #147

Change-Id: I41193adbab5cd979ca958131cd4f148dde5e1f2e
2016-11-09 14:08:52 -08:00
Rintaro Kuroiwa e7c0dbf09d Ensure some method calls NotifyEncryptionStart()
- If OnEncryptionStart() is called OnMediaStart(), someone should be
  calling NotifyEncrytionStart().

Fixes #169

Change-Id: I597f317d2ddeb3091b7e9d238eb9695b4cc9c69d
2016-11-08 15:56:28 -08:00
Kongqun Yang 458fadc6a8 Add udp options support
Three options are supported right now:
- reuse=1|0
  Allow or disallow reusing UDP sockets. Default 0.
- interface=a.b.c.d
  Address of the interface over which to receive UDP multicast
  streams.
- timeout=microseconds
  Timeout in microseconds. Default to unlimited.

A UDP url should be of the form udp://ip:port[?options], here
is an example:
  udp://224.1.2.30:88?reuse=1&interface=10.11.12.13&timeout=12345

Also deprecate --udp_interface_address flag in favor udp options.

Closes #133

Change-Id: I962d35bfedc1779d67ba20ed910207c66b7c1a15
2016-10-31 18:40:40 +00:00
Kongqun Yang 4c6e5f4fa6 Improve support for decryption of full sample encrypted cbcs
1. Allow encryption pattern of 0:0, which is treated as 1:0;
2. Remove the special handling of pattern 1:0 in pattern cryptor
   which may not always be correct;
3. Allow senc/saio/saiz boxes to be absent.

Change-Id: I372e61182ec577107e39cb601c3aed80616b036d
2016-10-14 00:07:46 +00:00
Kongqun Yang e7393fcc22 Fix build break in Windows
Change-Id: I49815abdaa360e11e62a3193bc58d4d7d77fc8a8
2016-10-13 15:54:32 -07:00
Kongqun Yang 6dbcf27f82 [WebM] Use system temp directory if temp_dir is not specified
The original code creates temporary file in the current directory,
which may not always be writable.

Change-Id: Icc278dd5db6be6206ae29defbb7423bae39cc978
2016-10-13 21:48:00 +00:00