This is part of the effort to support Opus in iso-bmff #83.
Changes in this CL:
- Add support for multiple SampleGroupDescription and SampleToGroup
boxes in TrackFragment box;
- Add support for SampleGroupDescription and SampleToGroup boxes
in SampleTable box;
- Add support for AudioRollRecoveryEntry in Sample Group and 'roll'
sample grouping type;
- Also fix a bug that default length was not set correctly in
SampleGroupDescription when constant iv is used.
Change-Id: I7e31386ea6cd17a8ee5e1dca4c1a90937d51368f
- For encrypted segments, PMT specified by SAMPLE-AES specification is
generated.
- Remove time_scale_ field from TsWriter. It is not used.
- Move ContinuityCounter to a separate file.
- Add ProgramMapTableWriter and implementations.
- continuity_counter is incremented for PAT and PMT.
Change-Id: If0dd0990203cb6990f39a6832048bdc3ff08decd
This add several unit tests for EsParserH26x to test the various
NAL unit orders and access unit contents. Some tests are disabled
and will be fixed in another patch.
Change-Id: Id5e3291e22f1fe17ada2c03c42e2cdfe226abcb2
- BytesOfProtectedData in 'cens' SHALL also be 16-byte aligned
- Fix an incorrect box definition bug w.r.t to 'cbcs' and 'cens'
- Also add various protection scheme tests
Close#77Close#78
Change-Id: I63c8d8b01ce16ed60affa97ec95fc62bc2da06df
- These warning messages are not useful since the code needs to
loop through various container types to find a matching one.
Change-Id: I1d8eca563faf24e485ac71cce32e09515c174bf2
Replaces the InitializeFromH264 and InitializeFromH265 methods with
a single Initialize method that accepts a CodecType. Also moves the
CodecType enum from NaluReader to Nalu.
Change-Id: Ie33aa9c0d772a7f3c6a2e9c867e25be3edfe7828
- CBC cryptors should accept IV of size 8 bytes - it will be zero
extended to 16 bytes.
- Fixed iv() not updated problem in AesPatternCryptor.
- Replace kChainAcrossCalls with ConstantIvFlag enum flags.
Change-Id: I3fb4de0e8abbe891e6271e779373ba53f8df660d
- Sample duration wasn't scaled in TsSegmenter to calculate the current
segment's length. So segmenting length did not always respect
segment_duration.
Change-Id: I1ef4747dbd12bde7852ffcbceb971f2775aa18b3
Parsing vui_parameters in the SPS is required to be able to extract
the resolution of the video. This also adds a method to extract
the resolution to the H.265 parser.
Issue #46
Change-Id: Idf498d2afdb36a689490151a4ae6baef0b6b73f6
Now Finalize() will close all the files used by the segmenters. This
is important to allow WebMMuxer::FireOnMediaEndEvent to get the
correct size of the media file.
This also changes the WebM muxer to use 64-bit numbers for the init
and index ranges to correctly support >4GB files.
b/28194272
Change-Id: Ia84e4a4b0756f89644efea99a1a51968b22a1338
- Add hls_name and hls_group_id fields to MuxerOptions. This is used to
pass the NAME and GROUP-ID values for EXT-X-MEDIA tag to
MuxerListener.
- Change MuxerListener::OnEncryptionInfoReady() to take an
initialization vector.
- Change MuxerListener::OnNewSegment() to take segment name.
- Reworded and formatted MuxerListener comments to Doxygen style.
Issue #85
Change-Id: Iea06e68552a56ae180177ffd6ca315a7cf39456c
- crypt_byte_block and skip_byte_block for pattern-based encryption.
- constant_iv for constant iv (used by 'cbcs' protection scheme).
- Also renamed iv_size to per_sample_iv_size.
- Also changed "bool is_encrypted" to "uint8_t is_protected" to align
with CENC spec.
Issue #78
Change-Id: I2878a91e0ebe536a08a3e3109daf157fe4440e27
- 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
- FOURCC is not a mp4 only concept. It is also used elsewhere.
- RCHECK has been used outside formats/mp4.
Also updated the FOURCC enum names to match the actual fourcc code, e.g.
FOURCC_mdat for "mdat".
Change-Id: I5be02f12695882c0fb41d359305fb8ec01303a06
- Create AesCryptor class as the common base
- AesCryptor::Crypt function will serve as an Encrypt function for
encryptor and a Decrypt function for Decryptor.
Change-Id: Ie91fb14964b5091786705bf510656f40d73af160
- Simple implementation of MPEG2 TS muxer.
- This does not take MuxerListener so a manifest cannot be generated.
- Encryption is not supported.
Issue #84
Change-Id: I117b772dbbce5437398defbd564883ad758916d5
- Segmenter should not finish a segment unless the next sample is a key
frame.
- Renamed PesPacketGenerator::Finalize() to Flush().
- Use duration from the sample instead of the one copied to PesPacket.
- Remove duration field from PesPacket.
Issue #84
Change-Id: Icd90e65fd63fdeb955e7abac3473b0b54db6ac4a
- Multi-file segmenter implementation.
- The samples are passed to PesPacketGenerator to generate PesPackets.
PesPackets are passed to TsWriter to write them to file.
Issue #84
Change-Id: Ia4cae2abe2e7df46016dcdb791baaab2818aea03
The positions in the SeekHead element should be relative to the
Segment payload, not the start of the file. Also added entries for
Tracks and SegmentInfo.
Change-Id: Id692da25fffc27d78e9f1a06d061431aeb6f1e7c
- Optimize and clean up encryption and decryption code.
- Consolidate various CBC encryption/decryption schemes into a
common class.
- Make it a constructor argument whether cipher block chain is
continuous across Encrypt/Decrypt calls.
- Also align protected region size as required in CENC spec.
Issue #77
Change-Id: I533d92ada3cd80933b532b9c3a1cca105ba66f8e
Another feature that the mac build does not support. It incorrectly
uses a copy-constructor when creating new values in a std::map. This
is incorrect and should use an in-place constructor with C++11.
Change-Id: I1e822747e97eb4ae01596d63ea05058cc383cb49
This adds a preliminary H.265 parser. The parser only support
reading the slice header. This also attaches the H.265 parser to the
VideoSliceHeaderReader so H.265 frames can have unencrypted headers.
Issue #46Closes#40
Change-Id: I8b98e1f8bb04e359d9bf896fd5b2939c326b196b
The flag --include_common_pssh will add another PSSH box in addition
to the Widevine one which will contain the key IDs of all the keys.
Closes#88
Change-Id: Ic719b19747530f0e4856cfb36471a644d572a734
The new algorithm will parse NAL unit header and only starts a new
NAL unit if it is valid, otherwise it will be considered part of
the previous NAL unit.
Closes#96
Change-Id: I45f2a0f37d51841ee8345d6d0d38fcda57e0a009
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
- 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