Commit Graph

28 Commits

Author SHA1 Message Date
Kongqun Yang 644629c616 Replace scoped_ptr with std::unique_ptr
Change-Id: I1ed18bf876b6154d08a1f7913aa7e76c525451f9
2016-08-18 17:12:36 -07:00
Kongqun Yang d501b457d0 Fix WebM keyframe detection in BlockGroup
The right way to detect the presence of a keyframe in a BlockGroup
is to look for the absence of the ReferenceBlock element [1].

Closes b/30433206

[1] https://matroska.org/technical/specs/index.html#ReferenceBlock

Change-Id: I2b3c8704cbabcd5cbee38448e5528425865561a4
2016-08-18 23:20:40 +00:00
Thomas Inskip db92c9a22b Implemented WebM VP9 subsample encryption and decryption.
Change-Id: I98f02c05ec8bcc976e01ff41478e92b8809c0076
2016-08-18 13:55:36 -07:00
Thomas Inskip 336ea5cb34 Windows build working
Change-Id: I6d9cfa0a310c4c6125c839e4d6a085903e981c9c
2016-08-18 08:30:26 -07:00
Kongqun Yang 4f9c8ea781 Rename top level namespace to shaka
Issue #103

Change-Id: I67945c8ec6d2c178494d3b5400e5ec0170e9d115
2016-05-24 21:55:55 +00:00
Kongqun Yang 26cb91e29b Handle preroll and codec_delay when tranmuxing opus
Closes Issue #102

Change-Id: I26aa56a63c17c85298311cc17963dd26f26e501e
2016-05-16 14:51:51 -07:00
Jacob Trimble 86369efc30 Add support for H.265 in MPEG2-TS demuxer.
This also changes the H.264 parser to correctly determine access
units.

Closes #46
Issue #47

Change-Id: I69a8c47ebf4fe35cef0592997460158b3131084e
2016-05-03 15:08:04 -07:00
Kongqun Yang 2abc7c60b7 Add end to end test for transport stream
- Also replaces resolution to 640x360, to reduce file size.

Change-Id: I030ceaa0c67c2b8f060d1864e2c3150f5d28b612
2016-04-29 17:21:08 -07:00
Jacob Trimble 404660cbdb Add H.265 byte to unit stream converter.
Also renames NaluReader::NaluType to CodecType.

Issue #46

Change-Id: I37d21fcb1109659f14baf43308a94c5e2d9ac2d1
2016-04-13 10:21:52 -07:00
KongQun Yang 2ac57bf9b9 Use FOURCC as protection scheme parameter
- Remove EncryptionMode enums
- Remove AesEncryptor::InitializeWithRandomIv, replaced with
  a static function AesCryptor::GenerateRandomIv, which should
  be called to generate the iv if the iv is empty.

This change is to prepare support for CBCS and CENS pattern-based
protection schemes.

Issue #77

Change-Id: Icba35089d6e451cbea7ebbf5dd5674079f206390
2016-04-12 16:06:49 -07:00
Jacob Trimble d5cdd00ba1 Move fixed key encryption code to new FixedKeySource.
KeySource is now an abstract class that is implemented in two
types WidevineKeySource and FixedKeySource.  This also updates
fixed key encryption to use v1 PSSH boxes with the common system
ID.

This also updates the --pssh argument.  Now it accepts full PSSH
boxes rather than data.  Multiple PSSH boxes can be concatenated
together.

Issue #88

Change-Id: I4bd0290f6d8b965f7d118f075c96e0f267d7e831
2016-03-21 10:30:47 -07:00
Bei Li e39c3572af Add support for "AES 128-bit Cipher Block Chaining (CBC-128) Encryption"
- Part 1.

- Add packager command line argument "protection_scheme" to specify
  protection scheme. Plumb through packager code to enable CBC
  encryption/decryption.
- Add scheme type "cbc1" to sinf.
- Refactor AES encryptor and decryptor.
- Need more work in the subsample handling.

Issue #77

Change-Id: I3a9304d89adf5efbfb226b6e805a3077b6cb8c68
2016-03-17 16:51:04 -07:00
Joey Parrish b6718a37c5 Accept language subtags
When normalizing language tags to their shortest form, we need to
split off subtags and treat them as separate components that do not
get changed.

Furthermore, MP4 can only store language tags without subtags.  So
only store the main language in MP4 output.

Fixes b/27533973

Change-Id: I96049e274aae9841e321c53039ef6464a2e61574
2016-03-09 23:23:12 +00:00
KongQun Yang 91b43773fd Update hevc test file to have more than one key frames
This is needed to test encryption in end to end test since the video
is segmented in gop boundary by default. Due to the existence of clear
lead, the first segment is always left in clear.

Change-Id: Ie8d37a1740f9061515298cb9fb7b58983592cc5b
2016-03-03 17:34:24 -08:00
Anders Hasselqvist 4195c5e505 MacOSX: Fix run_all_unittests target name conflict
There is a target name conflict between packager/base/base.gyp:run_all_unittests and
media_test.gyp:run_all_unittests. Change to media_test.gyp:run_tests_with_atexit_manager to
resolve the conflict.
2016-01-22 18:50:05 -08:00
KongQun Yang 4b111a030e Update end to end test with vpx packaging
Change-Id: I70886693b5ad7d4c52170e57901c2437eba69214
2016-01-13 19:34:50 +00:00
KongQun Yang 098e087459 Implement SampleEncryption box parsing and generation
Issue #41

Change-Id: Ic57436b6e6c8b58fc264037fd81c98627c525932
2016-01-05 01:56:06 +00:00
Rintaro Kuroiwa 29e14a3d6b VOD text support
Change-Id: Ic69169c31d0a54de4895d49ff8b4a758039733a7
2015-11-11 12:26:25 -08:00
KongQun Yang 4c10755d40 Support HEVC in mp4 parser and muxer
Issue #46

Change-Id: I36bf8418a335181ad71509e6e0cccdce210467f0
2015-11-04 17:18:41 -08:00
Kongqun Yang 47c79d08ce Update code to resolve problems due to base updates.
Notably deprecate of OVERRIDE, to be replaced with C++11 override.

Bug: 22463130
Bug: 22664127

Change-Id: I12c82e092e9e8eb0870da4363307c3563a3531b7
2015-10-16 20:09:56 +00:00
Thomas Inskip cb7173d280 Added support for multiple audio & video configurations in WVM parser.
BUG=24614172

Change-Id: I197a0ebdfa6df90abc27358762cae041e4f8fd45
2015-10-13 10:42:49 -07:00
KongQun Yang 93e6c4fc92 Reduce test file sizes and remove unused test files
Change-Id: I7e3b24e92b2a16de857e0424c85232cc31444182
2015-10-12 20:16:03 +00:00
Kongqun Yang e5b6096857 Generate tkhd and pasp boxes properly with non-square pixels
- Width/Height in tkhd box should be display resolution instead of
  coded resolution.
- pasp was not generated earlier.
- Assuming SAR as 1:1 if it failed to be extracted successfully.
- Also update test files for mp4_media_parser_unittest.

This fixes Issue #35.

Change-Id: Iedbe6a44465aac6723b6ea2de30aed180821eccd
2015-08-07 21:46:08 +00:00
Rintaro Kuroiwa c3c971ebd9 Add pixel_{width,height} to VideoStreamInfo
- Added logic to container parsers to extract pixel width and height.
- If the container doesn't contain the pixel width and height of the
  stream and the stream is H264, this parses the SPS to get the
  sar_width and sar_height.
- If extracted sar_width and sar_height are 0s then they imply 1s.
- Add hb2_v_frag.mp4 for test media. This does not have a
  'pasp' box and has sar_width = 8 sar_height = 9.

Change-Id: I4a06ce95582547bec19adb7905e7612c5a1f359e
2015-06-29 11:17:28 -07:00
Thomas Inskip a0dc98c13e Added support for ISO-BMFF files with trailing 'moov' boxes.
Change-Id: Icdc9058179a998617f865566d635ecdbd0e422c5
2015-05-22 14:11:46 -07:00
KongQun Yang e685dd1a73 Move test files in media/base to test directory
Also rename mpd/base/bandwidth_estimator_test.cc to
bandwidth_estimator_unittest.cc for consistency.

And remove mpd/base/simple_vod_mpd_notifier.* as they are not used
anywhere.

Change-Id: Iaeb096aef9259837a4eb356c18d5ca15f08d2376
2014-10-10 10:33:17 -07:00
KongQun Yang 15ae26e12f Modify include headers to have "packager" in the path
This is a follow up to previous CL.

Generated using command:
find {media,app,mpd} -type f -exec sed -r -i 's/#include "(.*)"/#include
"packager\/\1"/' {} \;

common.gypi and mpd.gyp are also modified to take the path change into
consideration.

Change-Id: I1fb102b4eb73ae5fde5f4ab303a12cec09b05c33
2014-10-02 12:53:29 -07:00
KongQun Yang b8126bc9da Move source code into packager directory
Make it easier to be included and integrated into other code.

Change-Id: I609881688cc20f8fac676cbd91fde4753af32ee5
2014-10-02 12:32:14 -07:00