summaryrefslogtreecommitdiffstats
path: root/media/formats/mp2t/es_parser_h264.cc
diff options
context:
space:
mode:
authordougsteed <dougsteed@chromium.org>2016-03-11 16:04:30 -0800
committerCommit bot <commit-bot@chromium.org>2016-03-12 00:05:22 +0000
commit8d5275f7bbb6f79c83829a7931f1500128ef3f8f (patch)
tree06d53aa908b22da47f819afbf815aa941f709ef9 /media/formats/mp2t/es_parser_h264.cc
parentc5bf1a9a84aadcf927f94e806f4647d65e3da2c1 (diff)
downloadchromium_src-8d5275f7bbb6f79c83829a7931f1500128ef3f8f.zip
chromium_src-8d5275f7bbb6f79c83829a7931f1500128ef3f8f.tar.gz
chromium_src-8d5275f7bbb6f79c83829a7931f1500128ef3f8f.tar.bz2
media config: expand is_encrypted to a struct.
Provide more complete encryption metadata, rather than just a bool. EncryptionScheme also allows specification of the mode and the pattern, as will be allowed by CENC (ISO's Common Encryption standard), 3rd Edition. BUG=568326 Committed: https://crrev.com/c9d2206c62f65e29b141e08df2b2dcb88f54162f Cr-Commit-Position: refs/heads/master@{#380710} Review URL: https://codereview.chromium.org/1490613005 Cr-Commit-Position: refs/heads/master@{#380791}
Diffstat (limited to 'media/formats/mp2t/es_parser_h264.cc')
-rw-r--r--media/formats/mp2t/es_parser_h264.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/media/formats/mp2t/es_parser_h264.cc b/media/formats/mp2t/es_parser_h264.cc
index dc8315c..3b47fec 100644
--- a/media/formats/mp2t/es_parser_h264.cc
+++ b/media/formats/mp2t/es_parser_h264.cc
@@ -6,6 +6,8 @@
#include "base/logging.h"
#include "base/numerics/safe_conversions.h"
+#include "media/base/encryption_scheme.h"
+#include "media/base/media_util.h"
#include "media/base/stream_parser_buffer.h"
#include "media/base/timestamp_constants.h"
#include "media/base/video_frame.h"
@@ -262,7 +264,7 @@ bool EsParserH264::EmitFrame(int64_t access_unit_pos,
const H264SPS* sps = h264_parser_->GetSPS(pps->seq_parameter_set_id);
if (!sps)
return false;
- RCHECK(UpdateVideoDecoderConfig(sps));
+ RCHECK(UpdateVideoDecoderConfig(sps, Unencrypted()));
}
// Emit a frame.
@@ -287,7 +289,8 @@ bool EsParserH264::EmitFrame(int64_t access_unit_pos,
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;
@@ -314,7 +317,7 @@ bool EsParserH264::UpdateVideoDecoderConfig(const H264SPS* sps) {
VideoDecoderConfig video_decoder_config(
kCodecH264, ProfileIDCToVideoCodecProfile(sps->profile_idc),
PIXEL_FORMAT_YV12, COLOR_SPACE_HD_REC709, coded_size, visible_rect,
- natural_size, std::vector<uint8_t>(), false);
+ natural_size, EmptyExtraData(), scheme);
if (!video_decoder_config.Matches(last_video_decoder_config_)) {
DVLOG(1) << "Profile IDC: " << sps->profile_idc;