Index: media/formats/mp2t/es_parser_h264.cc |
diff --git a/media/formats/mp2t/es_parser_h264.cc b/media/formats/mp2t/es_parser_h264.cc |
index 8c5911230f053b4526dd6afc4f3df2b938d5d9ee..94b25b4f5157847d06f3a8acc87136bd3d5a3f4a 100644 |
--- a/media/formats/mp2t/es_parser_h264.cc |
+++ b/media/formats/mp2t/es_parser_h264.cc |
@@ -6,6 +6,7 @@ |
#include "base/logging.h" |
#include "base/numerics/safe_conversions.h" |
+#include "media/base/encryption_scheme.h" |
#include "media/base/stream_parser_buffer.h" |
#include "media/base/timestamp_constants.h" |
#include "media/base/video_frame.h" |
@@ -229,7 +230,8 @@ bool EsParserH264::EmitFrame(int64 access_unit_pos, int access_unit_size, |
const H264SPS* sps = h264_parser_->GetSPS(pps->seq_parameter_set_id); |
if (!sps) |
return false; |
- RCHECK(UpdateVideoDecoderConfig(sps)); |
+ EncryptionScheme scheme(false); |
+ RCHECK(UpdateVideoDecoderConfig(sps, scheme)); |
ddorwin
2015/12/10 18:36:01
ditto
dougsteed
2015/12/14 21:19:02
The second CL shows why it's like this.
|
} |
// Emit a frame. |
@@ -251,10 +253,21 @@ bool EsParserH264::EmitFrame(int64 access_unit_pos, int access_unit_size, |
0); |
stream_parser_buffer->SetDecodeTimestamp(current_timing_desc.dts); |
stream_parser_buffer->set_timestamp(current_timing_desc.pts); |
+#ifdef ENABLE_HLS_SAMPLE_AES |
yucliu1
2015/12/10 00:12:19
Remove this block in this CL?
ddorwin
2015/12/10 18:36:01
Agreed.
dougsteed
2015/12/14 21:19:02
Yes, this was an oversight when I split my work in
|
+ if (use_hls_sample_aes_) { |
+ // TODO(dougsteed): temporary place-holders. |
+ const std::string key_id = "XXXXXXXXXXXXXXXX"; |
+ const std::string iv = "IVIVIVIVIVIVIVIV"; |
+ scoped_ptr<DecryptConfig> decrypt_config( |
+ new DecryptConfig(key_id, iv, subsamples)); |
+ stream_parser_buffer->set_decrypt_config(decrypt_config.Pass()); |
+ } |
+#endif |
return es_adapter_.OnNewBuffer(stream_parser_buffer); |
} |
-bool EsParserH264::UpdateVideoDecoderConfig(const H264SPS* sps) { |
+bool EsParserH264::UpdateVideoDecoderConfig(const H264SPS* sps, |
+ const EncryptionScheme& scheme) { |
// Set the SAR to 1 when not specified in the H264 stream. |
int sar_width = (sps->sar_width == 0) ? 1 : sps->sar_width; |
int sar_height = (sps->sar_height == 0) ? 1 : sps->sar_height; |
@@ -281,7 +294,7 @@ bool EsParserH264::UpdateVideoDecoderConfig(const H264SPS* sps) { |
VideoDecoderConfig video_decoder_config( |
kCodecH264, VIDEO_CODEC_PROFILE_UNKNOWN, PIXEL_FORMAT_YV12, |
COLOR_SPACE_HD_REC709, coded_size, visible_rect, natural_size, |
- std::vector<uint8_t>(), false); |
+ std::vector<uint8_t>(), scheme); |
if (!video_decoder_config.Matches(last_video_decoder_config_)) { |
DVLOG(1) << "Profile IDC: " << sps->profile_idc; |