Remove the restriction that key response contains all keys

Also set fragment_duration in mvex.

Change-Id: I9584c17569b2eb9b75d060284288c44f64b76821
This commit is contained in:
KongQun Yang 2014-11-06 15:13:35 -08:00
parent f5e71b62b5
commit fe9c4201f3
5 changed files with 11 additions and 7 deletions

View File

@ -332,7 +332,7 @@ Demux video from the input and generate an encrypted fragmented mp4 using Widevi
packager input=sintel.mp4,stream=video,output=encrypted_sintel.mp4 \ packager input=sintel.mp4,stream=video,output=encrypted_sintel.mp4 \
--enable_widevine_encryption \ --enable_widevine_encryption \
--key_server_url "https://license.uat.widevine.com/cenc/getcontentkey/widevine_test" \ --key_server_url "https://license.uat.widevine.com/cenc/getcontentkey/widevine_test" \
--content_id "content_sintel" \ --content_id "3031323334353637" \
--signer "widevine_test" \ --signer "widevine_test" \
--rsa_signing_key_path "widevine_test_private.der" --rsa_signing_key_path "widevine_test_private.der"
``` ```
@ -342,7 +342,7 @@ The program also supports AES signing. Here is an example with encryption key ro
packager input=sintel.mp4,stream=video,output=encrypted_sintel.mp4 \ packager input=sintel.mp4,stream=video,output=encrypted_sintel.mp4 \
--enable_widevine_encryption \ --enable_widevine_encryption \
--key_server_url "https://license.uat.widevine.com/cenc/getcontentkey/widevine_test" \ --key_server_url "https://license.uat.widevine.com/cenc/getcontentkey/widevine_test" \
--content_id "content_sintel" \ --content_id "3031323334353637" \
--signer "widevine_test" \ --signer "widevine_test" \
--aes_signing_key "1ae8ccd0e7985cc0b6203a55855a1034afc252980e970ca90e5202689f947ab9" \ --aes_signing_key "1ae8ccd0e7985cc0b6203a55855a1034afc252980e970ca90e5202689f947ab9" \
--aes_signing_iv "d58ce954203b7c9a9a9d467f59839249" \ --aes_signing_iv "d58ce954203b7c9a9a9d467f59839249" \
@ -355,7 +355,7 @@ packager input=sintel.wvm,stream=video,output=encrypted_sintel.mp4 \
--enable_widevine_decryption \ --enable_widevine_decryption \
--enable_widevine_encryption \ --enable_widevine_encryption \
--key_server_url "https://license.uat.widevine.com/cenc/getcontentkey/widevine_test" \ --key_server_url "https://license.uat.widevine.com/cenc/getcontentkey/widevine_test" \
--content_id "01020304050607" \ --content_id "3031323334353637" \
--signer "widevine_test" \ --signer "widevine_test" \
--rsa_signing_key_path "widevine_test_private.der" --rsa_signing_key_path "widevine_test_private.der"
``` ```

View File

@ -111,6 +111,8 @@ KeySource::TrackType KeySource::GetTrackTypeFromString(
return TRACK_TYPE_HD; return TRACK_TYPE_HD;
if (track_type_string == "AUDIO") if (track_type_string == "AUDIO")
return TRACK_TYPE_AUDIO; return TRACK_TYPE_AUDIO;
if (track_type_string == "UNSPECIFIED")
return TRACK_TYPE_UNSPECIFIED;
LOG(WARNING) << "Unexpected track type: " << track_type_string; LOG(WARNING) << "Unexpected track type: " << track_type_string;
return TRACK_TYPE_UNKNOWN; return TRACK_TYPE_UNKNOWN;
} }

View File

@ -33,7 +33,8 @@ class KeySource {
TRACK_TYPE_SD = 1, TRACK_TYPE_SD = 1,
TRACK_TYPE_HD = 2, TRACK_TYPE_HD = 2,
TRACK_TYPE_AUDIO = 3, TRACK_TYPE_AUDIO = 3,
NUM_VALID_TRACK_TYPES = 3 TRACK_TYPE_UNSPECIFIED = 4,
NUM_VALID_TRACK_TYPES = 4
}; };
virtual ~KeySource(); virtual ~KeySource();

View File

@ -459,9 +459,9 @@ bool WidevineKeySource::ExtractEncryptionKey(
const base::ListValue* tracks; const base::ListValue* tracks;
RCHECK(license_dict->GetList("tracks", &tracks)); RCHECK(license_dict->GetList("tracks", &tracks));
RCHECK(enable_key_rotation // Should have at least one track per crypto_period.
? tracks->GetSize() >= NUM_VALID_TRACK_TYPES * crypto_period_count_ RCHECK(enable_key_rotation ? tracks->GetSize() >= 1 * crypto_period_count_
: tracks->GetSize() >= NUM_VALID_TRACK_TYPES); : tracks->GetSize() >= 1);
int current_crypto_period_index = first_crypto_period_index_; int current_crypto_period_index = first_crypto_period_index_;

View File

@ -230,6 +230,7 @@ Status Segmenter::Finalize() {
if (track->header.duration > moov_->header.duration) if (track->header.duration > moov_->header.duration)
moov_->header.duration = track->header.duration; moov_->header.duration = track->header.duration;
} }
moov_->extends.header.fragment_duration = moov_->header.duration;
return DoFinalize(); return DoFinalize();
} }