Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(550)

Unified Diff: media/formats/mp2t/es_parser_h264.cc

Issue 1633573003: EsParserH264 should set proper video profile (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/h264_parser.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 793e2aa993a88d64957215ca41262c2da8c0a707..b64d4c728e7b11322a7c0e5ac01c23e48bdb2420 100644
--- a/media/formats/mp2t/es_parser_h264.cc
+++ b/media/formats/mp2t/es_parser_h264.cc
@@ -18,6 +18,38 @@
namespace media {
namespace mp2t {
+namespace {
+
+VideoCodecProfile ProfileIDCToVideoCodecProfile(int profile_idc) {
+ switch (profile_idc) {
+ case H264SPS::kProfileIDCBaseline:
+ return H264PROFILE_BASELINE;
+ case H264SPS::kProfileIDCMain:
+ return H264PROFILE_MAIN;
+ case H264SPS::kProfileIDCHigh:
+ return H264PROFILE_HIGH;
+ case H264SPS::kProfileIDHigh10:
+ return H264PROFILE_HIGH10PROFILE;
+ case H264SPS::kProfileIDHigh422:
+ return H264PROFILE_HIGH422PROFILE;
+ case H264SPS::kProfileIDHigh444Predictive:
+ return H264PROFILE_HIGH444PREDICTIVEPROFILE;
+ case H264SPS::kProfileIDScalableBaseline:
+ return H264PROFILE_SCALABLEBASELINE;
+ case H264SPS::kProfileIDScalableHigh:
+ return H264PROFILE_SCALABLEHIGH;
+ case H264SPS::kProfileIDStereoHigh:
+ return H264PROFILE_STEREOHIGH;
+ case H264SPS::kProfileIDSMultiviewHigh:
+ return H264PROFILE_MULTIVIEWHIGH;
+ default:
+ DVLOG(1) << "unknown video profile: " << profile_idc;
+ }
+ return VIDEO_CODEC_PROFILE_UNKNOWN;
xhwang 2016/01/26 17:18:50 nit: Remove the default so that if this list is n
erickung1 2016/01/26 19:44:34 Done.
+}
+
+} // namespace
+
// An AUD NALU is at least 4 bytes:
// 3 bytes for the start code + 1 byte for the NALU type.
const int kMinAUDSize = 4;
@@ -281,9 +313,9 @@ bool EsParserH264::UpdateVideoDecoderConfig(const H264SPS* sps) {
return false;
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);
+ kCodecH264, ProfileIDCToVideoCodecProfile(sps->profile_idc),
+ PIXEL_FORMAT_YV12, COLOR_SPACE_HD_REC709, coded_size, visible_rect,
+ natural_size, std::vector<uint8_t>(), false);
if (!video_decoder_config.Matches(last_video_decoder_config_)) {
DVLOG(1) << "Profile IDC: " << sps->profile_idc;
« no previous file with comments | « media/filters/h264_parser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698