Added HEVC parser for WebRTC

This is part of effort to enable HEVC for WebRTC. Parser added here to support parsing of QP/picture size for bitstream, for dynamic adaptation and stream metadata abstraction.

Bug: webrtc:13485
Change-Id: I2fbdf210e72e77989ca87ce285da174df5bedd5c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298421
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40572}
diff --git a/common_video/BUILD.gn b/common_video/BUILD.gn
index 2ee08cc..4736aa5 100644
--- a/common_video/BUILD.gn
+++ b/common_video/BUILD.gn
@@ -37,6 +37,23 @@
     "video_frame_buffer_pool.cc",
   ]
 
+  if (rtc_use_h265) {
+    sources += [
+      "h265/h265_bitstream_parser.cc",
+      "h265/h265_bitstream_parser.h",
+      "h265/h265_common.cc",
+      "h265/h265_common.h",
+      "h265/h265_inline.cc",
+      "h265/h265_inline.h",
+      "h265/h265_pps_parser.cc",
+      "h265/h265_pps_parser.h",
+      "h265/h265_sps_parser.cc",
+      "h265/h265_sps_parser.h",
+      "h265/h265_vps_parser.cc",
+      "h265/h265_vps_parser.h",
+    ]
+  }
+
   deps = [
     "../api:array_view",
     "../api:make_ref_counted",
@@ -71,6 +88,12 @@
     "../system_wrappers:metrics",
     "//third_party/libyuv",
   ]
+  if (rtc_use_h265) {
+    deps += [
+      "../rtc_base:compile_assert_c",
+      "../rtc_base/containers:flat_map",
+    ]
+  }
   absl_deps = [
     "//third_party/abseil-cpp/absl/numeric:bits",
     "//third_party/abseil-cpp/absl/types:optional",
@@ -110,6 +133,15 @@
       "video_frame_unittest.cc",
     ]
 
+    if (rtc_use_h265) {
+      sources += [
+        "h265/h265_bitstream_parser_unittest.cc",
+        "h265/h265_pps_parser_unittest.cc",
+        "h265/h265_sps_parser_unittest.cc",
+        "h265/h265_vps_parser_unittest.cc",
+      ]
+    }
+
     deps = [
       ":common_video",
       "../api:scoped_refptr",