summaryrefslogtreecommitdiff
path: root/chromium/media/video/h264_parser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/media/video/h264_parser.cc')
-rw-r--r--chromium/media/video/h264_parser.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/chromium/media/video/h264_parser.cc b/chromium/media/video/h264_parser.cc
index 04f0b85c906..461501de9ba 100644
--- a/chromium/media/video/h264_parser.cc
+++ b/chromium/media/video/h264_parser.cc
@@ -195,6 +195,23 @@ VideoColorSpace H264SPS::GetColorSpace() const {
}
}
+VideoChromaSampling H264SPS::GetChromaSampling() const {
+ // Spec section 6.2
+ switch (chroma_format_idc) {
+ case 0:
+ return VideoChromaSampling::k400;
+ case 1:
+ return VideoChromaSampling::k420;
+ case 2:
+ return VideoChromaSampling::k422;
+ case 3:
+ return VideoChromaSampling::k444;
+ default:
+ DVLOG(1) << "Unknown chroma subsampling format.";
+ return VideoChromaSampling::kUnknown;
+ }
+}
+
uint8_t H264SPS::GetIndicatedLevel() const {
// Spec A.3.1 and A.3.2
// For Baseline, Constrained Baseline and Main profile, the indicated level is