Commit Graph

56 Commits

Author SHA1 Message Date
Kongqun Yang 30cb6948e5 Add MediaParser::Flush to flush the parser
Change-Id: Ic12a045dda47ccd270c8c3e9e83768e04a53ad58
2014-04-29 20:33:04 +00: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
Thomas Inskip 71a425799d Added ADTS header parsing, removal, and conversion to AudioSpecificConfig.
Hooked up mp2t media parser, audio transmux now working.

Change-Id: Idc92a51d25fa6ed2f74627131d53919e52394119
2014-04-22 18:34:36 -07:00
Thomas Inskip cbf4978ffa Modified H.264 elementary stream parsing code to work with remux framework.
Change-Id: I81dfe0952073c4a5cd6f5fcaf14fe21050d26cb6
2014-04-22 12:49:41 -07:00
Kongqun Yang 8df0e1ad0a Fix flaky MultiThreadProducerConsumerQueueStopTest
The main thread may run ahead of the closure thread. In this case,
Stop() could have been called before the first Push() call.

Change-Id: Ib6d94d451a8215fff572ea13f9567ba786d77fa5
2014-04-21 13:59:32 -07:00
Thomas Inskip a7c91ca7dd Modified audio elementary stream parsing to work with packager remux.
Change-Id: Ice95102640e5cbb0382dc4c604c0af013103da99
2014-04-21 19:16:32 +00:00
Thomas Inskip 30b51506c4 Check-in of unmodified audio elementary stream parsing code.
Source of media/base/*:
    http://src.chromium.org/chrome/trunk/src/media/base@262934
Source of media/formats/mpeg/*:
    http://src.chromium.org/chrome/trunk/src/media/formats/mpeg@257932

Change-Id: Icd56b6f496befcd0c9f4eec2460fb2e998ae8bd2
2014-04-21 19:16:09 +00:00
Thomas Inskip 5f99651223 Moved mp4 code to new "formats" directory to match Chromium source tree.
(second attempt due to conflicts).

Change-Id: I2143921bcacdbaa6cfcaf59602713294b4b1f6ee
2014-04-21 12:05:32 -07:00
Kongqun Yang c51c6b2731 Fix ClosureThread unittest crash in release build
The crash happens if the thread is created but never started. An
improper Join triggered the crash. We should not call Join if the thread
is not started.

Change-Id: Icace740889089d3b2e15cf6c76c2b0887eb84535
2014-04-18 18:48:41 -07:00
Kongqun Yang 7fd94950d4 ProducerConsumerQueue unittest
Change-Id: I7cbd830e9bf93e1a5da75870f7a7a596708e5d5d
2014-04-18 18:35:41 -07:00
Kongqun Yang 7e9b8aa5a4 A thread safe producer consumer queue implementation
Change-Id: I827d8959d9c7c398178d083d01fafdb1779805da
2014-04-18 18:28:02 -07:00
Kongqun Yang 3f8b37a377 Implement ClosureThread
ClosureThread runs a Closure in a platform thread. Chromium Thread class
involves message loop, so we choose to implement our own based on the
lower level SimpleThread which wraps PlatformThread.

Change-Id: Ibb759f7debcc027c0764195ca93506f9a202110b
2014-04-19 01:03:29 +00:00
Kongqun Yang 833f27f687 Make Muxer::Initialize and Muxer::Finalize private
User should not need to care about how and when to call these APIs.
Internal code should call them automatically.

Change-Id: Ibc85a709d4e82ecc7b477986cabf09dcfc2e100c
2014-04-10 19:56:35 +00:00
Kongqun Yang b34b997bcb Some more clean ups in media/base
1. Use size_t for MediaSample size;
2. Get rid of stringstream in media_sample.cc and media_stream.cc.

Change-Id: I11fe650305a732ae6a18546ac68692e03ecedae4
2014-04-09 18:39:51 +00:00
Kongqun Yang f9ae38f717 Doxygen documentation for media/base
Change-Id: I6a63bd762e9f32655baf9b40db32ababb6aa3b54
2014-04-07 18:09:23 -07:00
Kongqun Yang 25b1038f5d Enable warnings and warnings-as-errors
The warnings and warnings-as-errors are enabled by set chromium_code to
1. Chromium build disables warnings and warnings-as-errors by default
on external contents.

And fix the errors with them enabled. Mostly defined but not used,
sign-unsign comparison, unsigned string formatting, and return value not
used etc.

Change-Id: I305b63924955a84172e98e0ebfe5aba0f11bdb37
2014-03-28 22:24:49 +00:00
Kongqun Yang 895a4daa4d Update happyhttp to latest revision
Latest rev of happyhttp fixes the bugs so patches are no longer needed.
Also removes http_fetcher_unittest from the build as it performs real
http requests to an external server.
2014-03-28 22:13:03 +00:00
Kongqun Yang 56c203c214 Remove TODOs
Some TODOs remain but are replaced with word NOTE instead. Some TODOs
are turned into bugs.

The patch are prepared using script:
find . -regex ".*/\(app\|media\|mpd\)/.*\.\(cc\|h\|gyp\)" \
  -exec sed -i "/TODO/d" {} \;
(remove the line containing TODO) with some post editing.

Change-Id: I6dd3539cce2bbeefee32d6307f78c13aacb94d1b
2014-03-28 14:30:27 -07:00
Kongqun Yang c1a7fd9c4a Change output messages to make it more human readable
Also remove formatting using stream which is not recommended per Google
C++ style guide.

Change-Id: I3930f0a453acc0258876c08c4266dcbb13757ac8
2014-03-19 18:42:27 -07:00
Kongqun Yang 5f3c0f7181 Remove the name after TODO
The change is made using command:
find . -regex ".*/\(app\|media\|mpd\)/.*\.\(cc\|h\|gyp\)" -exec sed -i
's,TODO(\w\+),TODO,g' {} \;

Then scan through the files and reformat them properly.

Change-Id: I13836cde38b9e30daf1fd8a847e203337f883e1b
2014-03-19 18:07:06 -07:00
Kongqun Yang e2b29552e9 Fix flaky packager_test due to timestamp diff
Change muxer interface to allow injection of testing clock. Also added
more packager_tests.

Change-Id: Ie580cbd7e79607a2c2b9df5d5d52ee4be108ff8f
2014-03-20 00:52:53 +00:00
Kongqun Yang d90ca489f9 Widevine encryptor source unittest
Change-Id: I1b56d0a019480472eb462d8a39f81c4eb3c81a0e
2014-03-12 10:56:31 -07:00
Kongqun Yang b9f1996b68 Fix compilation errors after manifest update
Manifest was updated in CL 7debbbe19b158ea7377e229a17ec1d3d9d19d1b8
to point to Chromium LGKR CL 253526.

There are some API refactoring in base, which result in some code
changes in our packager source.

Change-Id: I52bf5a8a4f8fe0ebc566677efcd572332db8f618
2014-03-03 13:26:14 -08:00
Kongqun Yang 58c4473d42 Add copyright information.
The information is generated by Edwin's copyright.py script with some
minor manual modifications.

Chromium's original copyright notice is not replaced.

Also add LICENSE file taken from
https://sites.google.com/a/google.com/ospo/releasing#TOC-BSD-License

Change-Id: I231f09af96a0a611b1ca81e95cab82e12d7f529b
2014-02-18 23:46:01 +00:00
Kongqun Yang 66e8f847e6 Clean up gyp.
Split packager.gyp into multiple smaller gyp definitions.

Change-Id: Icb38bd20f6e11ea41a975332c911d6bde7fc827d
2014-02-18 23:44:53 +00:00
Kongqun Yang 522048b0d9 Add a muxer option to normalize PTS to start from 0
Some players do not like non-zero starting PTS. We need to do PTS
normalization to make it work on those players.

Bug: 12686658

Change-Id: I0958c25395e4ea87d8208db9a5f6c5816827eb99
2014-01-24 22:34:27 +00:00
Kongqun Yang 5b826ec637 Workaround server limitation with client retries.
Change-Id: Ia1c7b20682e50a5931a83be0f464d81acf7c07af
2014-01-23 18:50:54 -08:00
Kongqun Yang 596e59c8be Add RSA signing support in WidevineEncryptorSource
Defines an abstract request signer class and two implementations of the
signer class, AesRequestSigner for AES-CBC signing and RsaRequestSigner
for RSA-PSS signing.

WidevineEncryptorSource now uses Signer for signature generation.

Change-Id: I4528409a9be998535bccde40fdadb412e4bbdaf3
2014-01-21 18:32:08 -08:00
Kongqun Yang e6df0ffb21 Fix asan error in aes_encryptor_unittest.
The error was caused by an incorrectly constructed test case.

Change-Id: I86006bd79d85f68d28d623da5c644b9037a12844
2014-01-17 01:42:40 +00:00
Kongqun Yang 8095e21c96 Clean up clang compilation errors.
Clang from Chromium enforces Chromium styles:
http://www.chromium.org/developers/coding-style,
http://www.chromium.org/developers/coding-style/chromium-style-checker-errors.

Change-Id: I8070739489a8109380578d1797801e981d119793
2014-01-17 01:41:45 +00:00
Rintaro Kuroiwa e4d94be0d3 Fire MuxerListener events from MP4Muxer
Implementation only for OnMediaStart and OnMediaEnd.

Change-Id: I58a94c29b7e8cecf29b6202c7018592e5ce620b2
2014-01-14 18:25:07 -08:00
Kongqun Yang 57ca7d2144 Remove EncryptorSource argument from Muxer constructor.
Add a new function Muxer::SetEncryptorSource. Also clean up
packager test.

Change-Id: I5fee46e3d15e0c7a0f138c1d90f980b724887768
2014-01-15 01:48:41 +00:00
Kongqun Yang b6af6ca976 Move encryptor creation out of EncryptorSource::Initialize.
Use EncryptorSource::CreateEncryptor for encryptor creation.
EncryptorSource no longer owns the created encryptor.

Change-Id: I34d1f32262b7692bcb347d3b084fd06cbae7850f
2014-01-15 01:47:47 +00:00
Kongqun Yang e7472c4247 Fix a path conflict due to merging.
Change-Id: Ib84e9628e62d423141fcad5e9763fc87dd666c5e
2014-01-13 18:10:10 +00:00
Kongqun Yang 1eb5236c90 Rsa Key unittest.
Change-Id: I761db06762e594884f339aee66fec171c92b8108
2014-01-11 01:16:40 +00:00
Kongqun Yang c73bfadd0e Move test utilities in media/base to media/test.
Also clean up test_data_util.cc.

Change-Id: Ic6038e072939d55fad7cc739b53ab9888b4251c1
2014-01-10 15:38:40 -08:00
Kongqun Yang ffc4a82460 Implement RsaPrivateKey and RsaPublicKey.
Used for message signing, signature verification, encryption and
decryption using RSA algorithm.

Change-Id: Icacd5a994c532a7bd4179c44e98c3ee9db744e83
2014-01-10 22:28:20 +00:00
Kongqun Yang 1e7080dda6 Implement Widevine encryptor source.
Use AES CBC signing for now. Rsa signing is not implemented yet.

Change-Id: Ife52ac098e9a82d4e40bbe0c0156f435a67c1aac
2014-01-10 14:24:15 -08:00
Kongqun Yang 577f899794 Implement AES CBC encryption/decrytion.
Change-Id: I017b02b5e8fc64c280a8245b72be89e1cf047f26
2014-01-10 21:33:09 +00:00
Kongqun Yang 1b5c3b5316 MP4 Muxer implementation.
Change-Id: I2aeb506e5bf7e2301e855456688273fe5f3988a2
2014-01-07 17:40:37 -08:00
Kongqun Yang 01646837e1 Implement write function for cenc and es_descriptor.
And MP4 code clean ups due to mp4 box changes.

Change-Id: I712b2dceb5038bfefa14097fe2fb2ab1fb913cb5
2014-01-07 16:59:52 -08:00
Kongqun Yang dccb069ffc A simple HTTPFetcher implementation using happyhttp.
Change-Id: I4f64d46ca4873711300ae175c5f5646ca1a7c366
2014-01-06 22:02:36 +00:00
Kongqun Yang e9b77add23 Implemented FixedEncryptorSource.
FixedEncryptorSource takes hardcoded key id and content key.
Implemented an AES Encryptor using OpenSSL.

Change-Id: I59ba9a41fc0f40925d697045dd1b147b7351c2f9
2013-12-10 19:29:48 -08:00
Kongqun Yang 4f1aab5e51 A simple BufferWriter implementation.
The BufferWriter is capable of appending various data types to buffer.
No optimization is done yet. We may consider optimize it for
appending (adding data to the tail) later.

Change-Id: I3b8e749e410c7ea4d4f2fb855e27744131c63cb0
2013-12-03 17:27:19 -08:00