shaka-packager/packager/media/base
KongQun Yang 40ea1286b9 Add support for EditLists in ISO-BMFF
- EditLists in input files are parsed and applied to sample timestamps.
- An EditList will be inserted in the ISO-BMFF output if
  - There is an offset between the initial presentation timestamp (pts)
    and decoding timestamp (dts). Chrome, as of M67, still uses dts in
    buffered range API [1], which creates various problems when buffered
    range by pts does not align with buffered range by dts. There is
    another bug in Chrome that applies EditList to pts only [2]. This
    means that we can insert an EditList to align pts range and dts range.
  - MediaSamples have negative timestamps (e.g. for Audio Priming).

You may notice the below change on some contents:
- Some media duration is reduced by one or two frames. This is because
  EditList in the input file was ignored in the previous code, so video
  streams start with a zero dts and a non-zero pts; the smaller of dts
  and pts was used as the starting timestamp (related to the earlier
  workaround for Chrome's dts bug), so the calculated duration was
  actually a bit larger than the actual duration. Now with EditList
  applied, the initial pts is reduced to zero, so the media duration is
  also reduced to reflect the actual and correct media duration.

It may also result in negative timestamps in TS/HLS Packed Audio, which
will be addressed in a follow up CL.

Fixes #112.
Partially address b/110782437.

[1] https://crbug.com/718641, fixed but behind MseBufferByPts.
[2] https://crbug.com/354518. Chrome is planning to enable the fix for
    [1] before addressing this bug, so we are safe.

Change-Id: I59317740ad3807ca66fa74b3a18fdf7f32c96aeb
2018-07-26 23:20:21 +00:00
..
test Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
aes_cryptor.cc Deprecate STLDeleter and string_as_array 2016-09-01 17:39:11 +00:00
aes_cryptor.h Fix SAMPLE-AES EC3 encryption 2018-01-24 03:02:49 +00:00
aes_cryptor_unittest.cc Address gcc build failures in some platforms 2017-12-07 11:45:26 -08:00
aes_decryptor.cc Add appveyor config for Windows CI 2016-08-23 12:24:34 -07:00
aes_decryptor.h Rename top level namespace to shaka 2016-05-24 21:55:55 +00:00
aes_encryptor.cc Rename top level namespace to shaka 2016-05-24 21:55:55 +00:00
aes_encryptor.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
aes_pattern_cryptor.cc Improve support for decryption of full sample encrypted cbcs 2016-10-14 00:07:46 +00:00
aes_pattern_cryptor.h Improve support for decryption of full sample encrypted cbcs 2016-10-14 00:07:46 +00:00
aes_pattern_cryptor_unittest.cc Address gcc build failures in some platforms 2017-12-07 11:45:26 -08:00
audio_stream_info.cc Add support for FLAC codec 2018-05-02 00:16:51 +00:00
audio_stream_info.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
audio_timestamp_helper.cc Rename top level namespace to shaka 2016-05-24 21:55:55 +00:00
audio_timestamp_helper.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
audio_timestamp_helper_unittest.cc Rename top level namespace to shaka 2016-05-24 21:55:55 +00:00
bit_reader.cc Support AAC with program_config_element() 2018-05-02 23:21:17 +00:00
bit_reader.h Support AAC with program_config_element() 2018-05-02 23:21:17 +00:00
bit_reader_unittest.cc Support AAC with program_config_element() 2018-05-02 23:21:17 +00:00
bit_writer.cc Implement BitWriter 2017-10-25 16:19:12 -07:00
bit_writer.h Implement BitWriter 2017-10-25 16:19:12 -07:00
bit_writer_unittest.cc Implement BitWriter 2017-10-25 16:19:12 -07:00
buffer_reader.cc Rename top level namespace to shaka 2016-05-24 21:55:55 +00:00
buffer_reader.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
buffer_writer.cc Add BufferWriter::AppendString 2018-05-08 21:25:01 +00:00
buffer_writer.h Add BufferWriter::AppendString 2018-05-08 21:25:01 +00:00
buffer_writer_unittest.cc Add BufferWriter::AppendString 2018-05-08 21:25:01 +00:00
byte_queue.cc Replace scoped_ptr with std::unique_ptr 2016-08-18 17:12:36 -07:00
byte_queue.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
closure_thread.cc Rename top level namespace to shaka 2016-05-24 21:55:55 +00:00
closure_thread.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
closure_thread_unittest.cc Update DEPS to fix mac build failure 2016-08-19 13:49:41 -07:00
container_names.cc Integrate PackedAudioWriter 2018-05-16 18:12:42 -07:00
container_names.h Share chunkers from the same input except for WVM 2018-01-22 17:43:25 -08:00
container_names_unittest.cc Recognize m4s as a valid extension for mp4 2018-03-02 23:22:45 +00:00
decrypt_config.cc Implement EncryptionHandler 2017-02-11 01:21:28 +00:00
decrypt_config.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
decryptor_source.cc Update MediaSample to avoid redundent copying 2017-09-28 14:01:30 -07:00
decryptor_source.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
decryptor_source_unittest.cc Rename fixed_key to raw_key 2017-10-24 21:52:01 +00:00
encryption_config.h Update EncryptionHandler to support key rotation and SampleAes 2017-03-21 23:50:53 +00:00
fourccs.h Add support for FLAC codec 2018-05-02 00:16:51 +00:00
http_key_fetcher.cc Set Widevine key request content-type to JSON 2018-04-13 21:13:32 +00:00
http_key_fetcher.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
http_key_fetcher_unittest.cc Move status.h under packager/ 2017-06-30 11:35:18 -07:00
id3_tag.cc Implemented Id3Tag class to handle ID3 tag 2018-05-16 01:04:02 +00:00
id3_tag.h Implemented PackedAudioSegmenter 2018-05-16 21:52:11 +00:00
id3_tag_unittest.cc Implemented Id3Tag class to handle ID3 tag 2018-05-16 01:04:02 +00:00
key_fetcher.cc Rename top level namespace to shaka 2016-05-24 21:55:55 +00:00
key_fetcher.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
key_source.cc Implement multi DRM support. (Part 1) 2018-03-03 01:39:16 +00:00
key_source.h Implement multi DRM support. (Part 1) 2018-03-03 01:39:16 +00:00
language_utils.cc Add HLS audio language support 2017-03-10 16:14:14 -08:00
language_utils.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
limits.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
macros.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
media_base.gyp Implemented Id3Tag class to handle ID3 tag 2018-05-16 01:04:02 +00:00
media_handler.cc Move ChainHandlers to MediaHandler 2018-06-21 09:52:04 -07:00
media_handler.h Update "One to many" example in Media Handler 2018-06-21 18:26:42 +00:00
media_handler_test_base.cc Added IsVideoStreamInfo Test Matcher 2018-06-19 19:48:10 +00:00
media_handler_test_base.h Fixed Copy and Assign in MediaHandlerGraphTestBase 2018-06-20 16:28:47 -07:00
media_parser.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
media_sample.cc Change MediaSample::CopyFrom to MediaSample::Clone 2017-09-29 09:58:39 -07:00
media_sample.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
muxer.cc Add support for EditLists in ISO-BMFF 2018-07-26 23:20:21 +00:00
muxer.h [Ad Insertion] Avoid adjusting EPT except for the first file 2018-06-01 15:53:02 -07:00
muxer_options.cc Update cmd flags to support static mpd with live profile 2017-01-13 20:00:10 +00:00
muxer_options.h Add support for EditLists in ISO-BMFF 2018-07-26 23:20:21 +00:00
muxer_util.cc Made Verify Functions Return Status 2017-09-06 22:22:55 +00:00
muxer_util.h Support removing segments outside of live window in DASH 2018-04-13 14:15:58 -07:00
muxer_util_unittest.cc Made Verify Functions Return Status 2017-09-06 22:22:55 +00:00
network_util.cc Rename top level namespace to shaka 2016-05-24 21:55:55 +00:00
network_util.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
offset_byte_queue.cc Rename top level namespace to shaka 2016-05-24 21:55:55 +00:00
offset_byte_queue.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
offset_byte_queue_unittest.cc Replace scoped_ptr with std::unique_ptr 2016-08-18 17:12:36 -07:00
playready_key_source.cc Refactor ProtectionSystemSpecificInfo class to struct 2018-05-11 00:10:07 +00:00
playready_key_source.h Implement multi DRM support. (Part 3) 2018-04-26 18:14:22 +00:00
playready_pssh_generator.cc Implement multi DRM support. (Part 3) 2018-04-26 18:14:22 +00:00
playready_pssh_generator.h Implement multi DRM support. (Part 3) 2018-04-26 18:14:22 +00:00
producer_consumer_queue.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
producer_consumer_queue_unittest.cc Address flakiness in ProducerConsumerQueueTest 2017-12-05 22:56:22 +00:00
protection_system_specific_info.cc Support entitlement license with Widevine key server 2018-05-17 21:03:05 +00:00
protection_system_specific_info.h Refactor ProtectionSystemSpecificInfo class to struct 2018-05-11 00:10:07 +00:00
protection_system_specific_info_unittest.cc Support entitlement license with Widevine key server 2018-05-17 21:03:05 +00:00
proto_json_util.cc Remove the usage of JsonWriter in SimpleHlsNotifier 2018-05-15 20:06:54 +00:00
proto_json_util.h Remove the usage of JsonWriter in SimpleHlsNotifier 2018-05-15 20:06:54 +00:00
pssh_generator.cc Refactor ProtectionSystemSpecificInfo class to struct 2018-05-11 00:10:07 +00:00
pssh_generator.h Implement multi DRM support. (Part 1) 2018-03-03 01:39:16 +00:00
pssh_generator_unittest.cc Refactor ProtectionSystemSpecificInfo class to struct 2018-05-11 00:10:07 +00:00
pssh_generator_util.cc Implement multi DRM support. (Part 1) 2018-03-03 01:39:16 +00:00
pssh_generator_util.h Implement multi DRM support. (Part 1) 2018-03-03 01:39:16 +00:00
range.h Change MuxerListener::OnMediaEnd to take ranges 2017-07-11 15:59:16 -07:00
raw_key_pssh_generator.cc Implement multi DRM support. (Part 1) 2018-03-03 01:39:16 +00:00
raw_key_pssh_generator.h Implement multi DRM support. (Part 1) 2018-03-03 01:39:16 +00:00
raw_key_source.cc Rewrite RawKeySource::GetCryptoPeriodKey 2018-05-09 00:00:15 +00:00
raw_key_source.h Implement multi DRM support. (Part 2) 2018-03-26 20:18:22 +00:00
raw_key_source_unittest.cc Refactor ProtectionSystemSpecificInfo class to struct 2018-05-11 00:10:07 +00:00
rcheck.h Move fourccs.h and rcheck.h to media/base 2016-04-12 21:28:37 +00:00
request_signer.cc Move hex string out of packager.h 2017-06-20 22:33:47 +00:00
request_signer.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
rsa_key.cc Deprecate STLDeleter and string_as_array 2016-09-01 17:39:11 +00:00
rsa_key.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
rsa_key_unittest.cc Address gcc build failures in some platforms 2017-12-07 11:45:26 -08:00
status_test_util_unittest.cc Move status.h under packager/ 2017-06-30 11:35:18 -07:00
stream_info.cc Added StreamTypeToString 2018-06-19 10:12:47 -07:00
stream_info.h Added StreamTypeToString 2018-06-19 10:12:47 -07:00
text_sample.cc Change Text Sample to Use int64_t 2018-03-26 20:46:58 +00:00
text_sample.h Change Text Sample to Use int64_t 2018-03-26 20:46:58 +00:00
text_stream_info.cc Made StreamData Have Const Pointers 2017-09-19 21:06:29 +00:00
text_stream_info.h Made StreamData Have Const Pointers 2017-09-19 21:06:29 +00:00
text_track.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
text_track_config.cc Rename top level namespace to shaka 2016-05-24 21:55:55 +00:00
text_track_config.h Rename top level namespace to shaka 2016-05-24 21:55:55 +00:00
timestamp.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
video_stream_info.cc Made StreamData Have Const Pointers 2017-09-19 21:06:29 +00:00
video_stream_info.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
widevine_common_encryption.proto Add Widevine CommonEncryption proto 2018-05-10 23:16:34 +00:00
widevine_key_source.cc Support entitlement license with Widevine key server 2018-05-17 21:03:05 +00:00
widevine_key_source.h Support entitlement license with Widevine key server 2018-05-17 21:03:05 +00:00
widevine_key_source_unittest.cc Support entitlement license with Widevine key server 2018-05-17 21:03:05 +00:00
widevine_pssh_data.proto Remove the usage of JsonWriter in SimpleHlsNotifier 2018-05-15 20:06:54 +00:00
widevine_pssh_generator.cc Implement multi DRM support. (Part 1) 2018-03-03 01:39:16 +00:00
widevine_pssh_generator.h Implement multi DRM support. (Part 1) 2018-03-03 01:39:16 +00:00