Commit Graph

33 Commits

Author SHA1 Message Date
KongQun Yang 299bb97490 Read enough bytes before detecting the container type
The input source may produce inputs with very small sizes. Demuxer
needs to accumulate enough bytes before trying to detect the container
type.

Issue: https://github.com/google/edash-packager/issues/11
Change-Id: Ie25339832a826e78f39b3b25abb98c1ad89e3021
2015-03-20 11:45:49 -07:00
Thomas Inskip f494f1f760 Fix for build break with clang.
Change-Id: I7af0b6b787324aa478c654f9a20e9008823a6378
2015-03-18 14:35:25 -07:00
Thomas Inskip 055ccde14f Added implementation and tests of IoCache (thread-safe circular memory buffer).
Change-Id: Id057b641e4eb6f61d18ec3e0565580b23d1e4297
2015-03-18 19:24:57 +00:00
Matt Brannock 6a7c6a3f7a Use bytes_read == 0 instead of EoF()
Due to various libraries' inconsistencies with using EoF, this change
will instead continue to read a file until the number of bytes read is
0. It considers bytes_read == 0 to mean end of file.

Change-Id: I90a592d6ae2b9879fe21bd0c4f9e1c9cbc680afe
2015-03-18 16:38:53 +00:00
Thomas Inskip a82bab9f3f Added File::Delete as well as deletion of temporary files created by SingleSegmentSegmenter.
Change-Id: Id0aec2f83955f81d2a059c2d077e8381ec7ec1f7
2015-03-11 15:23:19 -07:00
KongQun Yang daac38db98 Fix DCHECK failure for UDP streams
Change-Id: I45816058bcf01b9db26a1fd1a88131303ff1623e
2015-02-09 16:14:07 -08:00
Matt Brannock 26a4969ea2 Increase packager input/output file buffers to 2MB
Increases the read/write buffers for packager input and output files to
2MB from 256KB, which helps throughput when using network file systems.

Change-Id: Iff5d1b796ba4648f1436e0559c0ca2d353b6c4b5
2015-02-09 15:04:31 -08:00
Thomas Inskip cf0a1878f7 Added ability to cancel a Demuxer or Muxer run.
Change-Id: Ic4c040ef5084c4ec48206403b6abf8ca3d367ad3
2015-02-09 12:56:52 -08:00
KongQun Yang e76b20a282 Replace CreateTemporaryFileInDir with a custom implementation
CreateTemporaryFileInDir uses mkstemp which works only on local files.
This change enables the use of other types of files, like network file
as temporary directory.

Bug: 19246995

Change-Id: Ic752725e56b65eec2cd10a4e5d760c6f76ba4f18
2015-02-06 20:37:35 +00:00
Joey Parrish 3cc86c62b5 Add a stream descriptor field for language.
If a stream has no language metadata, or has the wrong metadata, this
field allows the user to override this on the command-line.

This also maps all specified languages on the command-line to ISO-639-2
tags as required by the MP4 muxer, so that ISO-639-1 tags specified on
the command-line do not cause a DCHECK to fail.

b/18613148

Change-Id: I473baeecbb3d388db5e06d080179ec6a332b4794
2015-02-04 13:36:04 -08:00
KongQun Yang 80db1c7bbf Handle non-MSE compliant fmp4 properly
MSE requires 'base-data-offset-present' not to be set, but FFmpeg may
generate fmp4 files with this flag though it actually uses moof as base.
Log a warning instead of failing directly in this case.

FFmpeg may also generates fmp4 files without tfdt box
(TrackFragmentDecodeTime) box, which is again non-MSE compliant. Handle
this scenario properly.

Bug: 18613712

Also fixes a test failure in SegmentTemplateTest introduced in an earlier
change.

Bug: 19235748

Change-Id: I4bcbb675b22a832a88cd33ee64c3e99a1c6e3a63
2015-02-03 13:19:19 -08:00
KongQun Yang 5462b350ae Optimize BitReader::SkipBits for large skips
Change-Id: Ic3a383a7112f21602755d6caa6b24b2857d62ebf
2015-01-31 00:56:14 +00:00
Ramji Chandramouli a99af5a015 Modify WVM media parser to support encrypted media sample.
Change-Id: I8e696527a09fcec22b6c9713e0d1d3096720ce9c
2015-01-14 00:30:14 +00:00
KongQun Yang 50c3f3a52e Bug fix for VodMediaInfoDumpMuxerListener::OnNewSegment
Change-Id: Ied43a7b71a551d093db11fd5b99e023d57dfa46a
2015-01-13 09:45:23 -08:00
KongQun Yang 7f510be3bc Call MuxerListener::OnNewSegment in SingleSegmentSegmenter as well
Needed for progress reporting.

Change-Id: I936a9f4bad99bfa38fdf995fcc8c2f44d990fa00
2015-01-12 16:48:38 -08:00
KongQun Yang f66ebe82bb Fix packager crash with corrupted media file
The corrupted media file contains an invalid chunk offset box.

Bug: 18411271

Change-Id: I3d7f51c3647134bd7d0846d0992e10e398784475
2014-12-23 14:29:59 -08:00
KongQun Yang 7798a1b845 move mpd_options to its own file
Also always generates sidx box for segments for now.

Change-Id: I61f71ebd281195b737902b57557a345c8e0b0c66
2014-12-15 19:04:40 +00:00
Thomas Inskip 2d3927e7cb Support WVM indexes which span multiple PES packets.
Change-Id: Iffb68e97f2613ebbc4e12d4226bed388bc444e76
2014-12-03 15:34:59 -08:00
Thomas Inskip fedf9b4233 Fix for video frame corruption which occurred when PES packet payloads
are not a size multiple of 16 bytes.

Change-Id: I6e7f524ef17177a1e293cb22e52afa59abacd0de
2014-11-25 13:50:55 -08:00
KongQun Yang fe9c4201f3 Remove the restriction that key response contains all keys
Also set fragment_duration in mvex.

Change-Id: I9584c17569b2eb9b75d060284288c44f64b76821
2014-11-06 15:24:38 -08:00
KongQun Yang f5e71b62b5 Fix two packager crash bug with invalid arguments
Fix b/18005827 Packager crashes in debug mode with widevine decryption
enabled given a non-existing file.

Fix b/18005632 Packager crashes with invalid fixed_key_encryption
parameters.

Also cleans up some code.

Change-Id: I097f5c8dc113eb6d33b42b19a4bf5de125c47c30
2014-10-16 12:40:31 -07:00
Ramji Chandramouli 0be4815edc Use only the first 16 bytes of the asset key.
Bug: 18003864

Change-Id: I65b08c4766a4c2ab08b09660b1540630387ab36c
2014-10-16 10:50:00 -07:00
KongQun Yang 8336801ffc Refactor WidevineKeySource to pass signer in setter instead
Since signer is now optional, it makes more sense to pass it in setter
function.

Also fix a problem in command line that if a signer or key source is
not specified correctly, the program should return immediately.

Change-Id: I3be6a4e2ba7bf7b8d5589ac8268390a0fe08a626
2014-10-14 19:50:14 -07:00
KongQun Yang b270e9fe0c Allow query stream info without decryption
Also fixes packager_test script due to path change and adding unittests.

Bug: 17977484

Change-Id: I57d1eb9f8ae8039dc5320ffa4141299d42b0e603
2014-10-15 01:32:40 +00:00
KongQun Yang e72d12c54f Make RequestSigner optional for WidevineKeySource
Change-Id: I4298d5c5ba1d8539c5cd28130266b1a988308f0b
2014-10-10 15:55:39 -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
Ramji Chandramouli 8cc29520b0 KeyFetcher interface and HTTP impl to retrieve keys from the Widevine
License Service.

Change-Id: Icb1af3fd26a5243293dd089888d4b396539fd768
2014-10-09 18:19:22 -07:00
Thomas Inskip e7e86d684a Fixed various bugs:
- 17932674 Packager crashes when an incorrect key is provided to wvm.

- 17932293 Packager crashes if no key source is provided for wvm input.

- 17932868 StreamInfo is cast to AudioStreamInfo unconditionally and corrupts memory in wvm_media_parser

- 17932033 input: wvm --enable_fixed_key_decryption Segmentation Fault.

Change-Id: I7fc774c87a33314a4c92bc907f06c17f0c269a16
2014-10-09 14:23:57 -07:00
KongQun Yang 9158f4a543 Remove (D)CHECK_OK and usage of MemoryMappedFile
Change-Id: Ifb46a0fe063dfe8fdd770d830f9fb7bf2cf31901
2014-10-08 16:19:31 -07:00
KongQun Yang 8ffb41df76 Fix various errors discovered during integration
Change-Id: I927ba02bbe99bf6e6c9877968a4554ad949cf07f
2014-10-06 12:44:54 -07:00
Ramji Chandramouli 6a1805129d Enabled WVM test with mocks for WidevineKeySource.
Change-Id: I4b9f8acacca6a334087e10d47b96be15fc3cafec
2014-10-03 13:46:07 -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