Commit Graph

1008 Commits

Author SHA1 Message Date
KongQun Yang 2af92f67d2 More fix for issues on 32-bit OS
Somehow it worked fine on 32-bit Ubuntu but not on 32-bit Redhat.

Change-Id: Icfa4ec651dedd74edadf5a65f997f649c2693115
2014-06-26 23:45:22 +00:00
Rintaro Kuroiwa b2a10d478d Custom map compare function for better debug logging
When running mpd unit tests, add --logging -v=2 to see verbose logs and -v=3
for more verbose logs

Change-Id: I5484f3fd9be4c9e7527d86fa71205e8f025d102a
2014-06-25 03:38:49 +00:00
KongQun Yang 5d5750b405 Update gyp_packager to support earlier version of python
"{} {}" formatting in python is introduced in version 2.7. Replaced
with "{0} {1}" to support python 2.6 and below.

Change-Id: Ic20fdc5fce554a5a5cb57383d5587581f70de598
2014-06-23 15:25:51 -07:00
KongQun Yang 4519dda07c Fix a race condition in WidevineEncryptionKeySource
The race condition could cause incorrect progress in current crypto
period index.

Change-Id: I76a1a3be16e2266fd07b5bbf73cb9470eafaac4b
2014-06-23 15:22:11 -07:00
KongQun Yang 0f49af6cc1 Fix problems on 32-bit fresh linux box
There are two different problems:

1. int64/uint64 formatting: %lu formats unsigned long. However, the
definition of long is different on 32-bit machine and 64-bit machine.
We need to use a macro to format int64/uint64 correctly.

2. The packager target is dependent on openssl.

Change-Id: I5d51a500c3cb8bcd4b4049ab7ec5a985ac486a76
2014-06-23 13:48:41 -07:00
KongQun Yang 895989b4b0 Merge "Retire single_packager" 2014-06-23 17:14:23 +00:00
Rintaro Kuroiwa 4668770093 Respect MPD@timeShiftBufferDepth
- Only Segments with end time in range [NOW - timeShiftBufferDepth, NOW] get
  listed as S elements under TemplateTimeline element. Any old segments
  do not get listed.
- Also adding tests

Change-Id: I52df9acaec107610757d809ac6c9cb13592d6f37
2014-06-23 12:13:11 -07:00
KongQun Yang 956f483528 Retire single_packager
Packager has all the capabilities of single_packager, so we don't need
single_packager any more.

Change-Id: I3e4dad86eaaa7e798cc3b6cd54838328cd1b45c9
2014-06-23 11:23:25 -07:00
KongQun Yang 1927109818 Adjust WidevineEncryptionKeySource to handle timeout
Change-Id: Iac4a86acae2e522c6cfc84ce02ae7ec1dd30c47e
2014-06-20 21:32:23 +00:00
KongQun Yang 419d463eaa Modify HttpFetcher to use libcurl
With libcurl, HttpFetcher now supports timeout and https.

Two additional changes:
1. Remove happyhttp which is no longer needed;
2. Add README.packager for curl

Bug: 13658515
Bug: 14301830

Change-Id: I13c2835e7feca9abf36e5bb8f7bc35a7db9ec94c
2014-06-20 10:36:24 -07:00
KongQun Yang b3f6015ccd Add curl in third_party
Change-Id: I93d45d306a5ade6248596d7e230e65788e55e5ba
2014-06-18 01:56:00 +00:00
KongQun Yang b0c880e03f Check InitializeFragments status in segmenter
Change-Id: I203c9befcaba389958d789fa3c716349636d5b8c
2014-06-17 21:10:01 +00:00
KongQun Yang 8cb3be74b1 Support mpd generation in packager app
Change-Id: I9dfa8ca254d3d3e0210feeecc7389f360ab4b6a7
2014-06-11 17:03:22 -07:00
Kongqun Yang df64029e47 Update MpdNotifier due to MpdBuilder change
Change-Id: I7bb391d6f6776c2355d76a90157b1fe9153f5474
2014-06-11 16:15:02 -07:00
Rintaro Kuroiwa 8951894f13 Build fix
Clang built ok but GCC didn't like it.
Add missing header.
Remove extended initializer.

Change-Id: I1abbfdc49c94d8e6a39491a1b1e8c698ee2c0b88
2014-06-11 13:04:18 -07:00
Rintaro Kuroiwa 4a0193a816 MpdBuilder Live profile
Add BandwidthEstimator to estimate the required bandwidth for the
segments.
Also includes unit test for the change.

Change-Id: I28262424e2ed6ceebdf81e2b11dcd67feba1d68c
2014-06-11 12:36:53 -07:00
KongQun Yang 5b1980651f Support segment template identifier $Time$
Also add support for format tags.

Also change default fragment_duration to 10s, i.e. to have the same
value as --segment_duration. So by default, only one fragment per
(sub)segment is generated.

Change-Id: I21123723c3998b656037a397eb7b58b3d91721bb
2014-06-09 18:09:12 -07:00
Kongqun Yang 72ad649ac4 Move MoreThanOneTrue/AtLeastOneTrue/OnlyOneTrue to mpd util
Change-Id: I28883808a01d9bf8c115990edbd8b3052c673abb
2014-06-09 14:32:50 -07:00
KongQun Yang 1d920a1a4e Media code change to support live mpd
Change-Id: I24ca877ec62e69df5dbf3c9ede54da4df189dbc4
2014-06-06 10:38:48 +08:00
KongQun Yang 6837ac45b7 Implement MpdNotifyMuxerListener
Change-Id: I08742839c2be5e5da104914ec841b8c5dd57f0b7
2014-06-05 18:51:52 +08:00
KongQun Yang 1899d5c3b0 Add back Initialize which starts key fetching thread
The key production thread was started in constructor. The default http
fetcher might have already been used to fetch keys before it is modified
by set_http_fetcher. This could lead to flaky unittest.

Change-Id: I977b6450862d87ffeb5cb219bcd46b33d877e550
2014-06-05 18:21:13 +08:00
KongQun Yang cdf0aa178d Support configurable policy in Widevine encryption
Bug: 13658473
Change-Id: I90bbaa2e34687e7456c9a247d51c64cd91782891
2014-06-05 17:58:19 +08:00
Thomas Inskip fe744f4724 Made video decoder configuration changes into a non-fatal condition.
Issued warning rather than exiting with an error so that playback
may (hopefully) continue. We see this type of situation with the
Envivio encoders, which effect trivial changes in encoding midstream.

Change-Id: Ifa552066f602157adbfa0b882cb75e479b067645
2014-06-04 17:43:33 -07:00
Thomas Inskip d7d307ff56 Implemented multi-stream packager driver program.
Change-Id: I16e1f5f1e8863b09b642c94d4be565e309bdafb6
2014-06-04 17:30:50 -07:00
Rintaro Kuroiwa bbc77362e4 Fix MuxerOptions forward declaration
MuxerOptions is a struct but was forward declared as class.
This fixes the build when using clang.

Change-Id: I3b99252bc86a71ced27cd12aa2ab828e10a025e5
2014-05-28 09:44:33 -07:00
Rintaro Kuroiwa c73c25c1c0 XML compare function
XML compare function for comparing a subset of MPD or the whole MPD.
The children must appear in the same order but the order of attributes
do not matter.
Change existing tests to use XmlEqual() instead of string comparison.

Change-Id: Ib7f80f52b5bed5b5f7c2517620c8955261a4b6a2
2014-05-27 17:46:39 -07:00
Thomas Inskip 7fe5b5171a Renamed packager_main to single_packager.
Did some re-factoring to share code with upcoming (multi stream) packager.

Change-Id: I2b3845e48ba6aa63a95ecc276abcb52c8355d8d5
2014-05-27 15:42:10 -07:00
Rintaro Kuroiwa beaea71946 Add tests that check the 'id' attributes.
Change-Id: I487ec7c658fd5a3a8bae03800e23b37cc44066f4
2014-05-22 14:18:27 -07:00
KongQun Yang b0e26ff297 Implement SimpleMpdNotifier
SimpleMpdNotifier listens to muxer events and generates MPD file.

Change-Id: I19304cdb9eba65fd01328aa0fd5e6d280cc5714e
2014-05-22 10:38:41 -07:00
KongQun Yang f6a54c289f Rename VodMpdNotifyMuxerListener to MpdNotifyMuxerListener
Change-Id: Ia23e127cc840f8b332c76cbac8c610c255c78ce5
2014-05-22 10:29:02 -07:00
KongQun Yang e7fe62763d Add 'pssh' box for clear lead fragments as well
This is to workaround a Chrome limitation that CDM must be initialized
before starting the playback. CDM can only be initialized with a valid
'pssh'.

Change-Id: Ia34e90dac42abbcdf0193fe4e3c971c87debdd42
2014-05-15 10:59:46 -07:00
KongQun Yang b25834a910 Implement EncryptingFragmenter from Fragmenter
Extract encryption related handlings from Fragmenter and move into new
class EncrpytingFragmenter.

Change-Id: Id42493cd321fd7e306f8ce522c7ff04990965256
2014-05-15 16:55:01 +00:00
Thomas Inskip 3f0454eced Merge "Added implementation of UdpFile for UDP unicast/multicast capture." 2014-05-14 22:59:21 +00:00
KongQun Yang 49dd6e49bb Always generate version 1 SampleGroupDescription box
Version 0 is obsoleted. Also fixes unittest typos.

Change-Id: I0e536ba316ac07ce939dae71752e00db19e3db58
2014-05-08 22:34:22 +00:00
KongQun Yang 80a60b7ef2 Support 64 bit mdat box size
Change-Id: I38be77d2d13eceaeeda6f3ff270c8d7cd1d2a300
2014-05-08 21:55:55 +00:00
KongQun Yang 815b90753f Use OpenSSL RAND_bytes for random IV generation
base::RandBytes may not be cryptographically strong.

Bug: 13658504
Change-Id: Id5dcd4e512f05c2f06302654277f2fd11a53f2b7
2014-05-07 17:34:11 -07:00
Kongqun Yang 1f315ba921 Support key rotation in widevine encryption key source
Change-Id: I05ded15fa666119c86a1d3f1c99123b9cda60b49
2014-05-07 18:37:01 +00:00
Thomas Inskip 2eb40fef65 Added implementation of UdpFile for UDP unicast/multicast capture.
Change-Id: Ie11b86821d34f6b93cd8d00c1709572d1a46e72b
2014-05-05 17:44:47 -07:00
Kongqun Yang 1773d08b8d Add new flag max_sd_pixels to determine SD or HD track
Change-Id: If841af98345177cf1832b9e5b91148168b000f44
2014-05-05 11:35:44 -07:00
Kongqun Yang 53287e5fe7 Add m2ts and audio tests in packager_test
Change-Id: I11cc65a2baa69bc5e3bc022027bca6712f810f1a
2014-05-02 22:16:21 +00:00
KongQun Yang e8e83cc37c Fix packager_main crash in Debug mode muxing clear video
Change-Id: I8bef6a2ebbfc47c7f60fbd2f549ba20cb1daf99c
2014-05-01 12:35:24 -07:00
Kongqun Yang 30cb6948e5 Add MediaParser::Flush to flush the parser
Change-Id: Ic12a045dda47ccd270c8c3e9e83768e04a53ad58
2014-04-29 20:33:04 +00:00
Thomas Inskip 77e9302aa9 Cleaned up TODOs from MPEG-2 code. 2014-04-29 11:51:28 -07:00
Thomas Inskip 67bdd89ba2 Implemented H.264 byte stream to unit stream conversion and other components
needed for MPEG-2 TS h.264 video demux and transmux.

Change-Id: I878cdd141140cfd6833d75c7133301b1d65f1da0
2014-04-24 18:27:47 +00:00
Thomas Inskip 4a39a0fc98 Renamed mp2t::MediaParser to mp2t::Mp2tMediaParser, removed filters namespace.
Change-Id: Ib4de2863d5e746b32703d49e721473a2ff6c8de7
2014-04-24 10:17:23 -07:00
Thomas Inskip faa12bd191 Merge "Added ADTS header parsing, removal, and conversion to AudioSpecificConfig. Hooked up mp2t media parser, audio transmux now working." 2014-04-23 20:39:05 +00:00
Kongqun Yang 50ed026751 Support key rotation when generating MP4 fragments
Change-Id: I472e03a2d41ee450c12c0fe3012904628d6893e7
2014-04-23 12:54:40 -07:00
Kongqun Yang 9076411044 Rename EncryptorSource to EncryptionKeySource
Change-Id: I0a3d0e205922bbb4015955e04d51b7a9a4fa86e1
2014-04-23 12:45:18 -07:00
Kongqun Yang f059d926d7 Update client of EncryptorSource due to refactoring
This CL also includes two related changes:
  1. Support serialization of raw PSSH box;
  2. Refactor segmenter interface a bit.

Change-Id: I668aa01a5a5ff524ad6fe74976339a3fd499120a
2014-04-23 12:35:52 -07:00
Kongqun Yang 107145c693 Refactor EncryptorSource to prepare for live support
Remove Initialize() and Add AddKey().

Also remove fixed_encryptor_source.* and move the functionality to
encryptor_source.*.

Change-Id: I4fb61013177874a8b81854f10b2deda83accc683
2014-04-23 12:34:13 -07:00