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

Unified Diff: webrtc/common_types.h

Issue 2459633002: Add functionality for parsing H264 profile-level-id (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | webrtc/common_types.cc » ('j') | webrtc/common_types.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_types.h
diff --git a/webrtc/common_types.h b/webrtc/common_types.h
index c3e9a84c3cc729b5cb3e1b1287731cc102aa3ba0..ac02a4717c2ad15f104b815c1e8504aa5f96d5c1 100644
--- a/webrtc/common_types.h
+++ b/webrtc/common_types.h
@@ -18,6 +18,7 @@
#include <string>
#include <vector>
+#include "webrtc/base/optional.h"
#include "webrtc/common_video/rotation.h"
#include "webrtc/typedefs.h"
@@ -498,7 +499,45 @@ enum VideoCodecComplexity {
kComplexityMax = 3
};
-enum VideoCodecProfile { kProfileBase = 0x00, kProfileMain = 0x01 };
+enum H264Profile {
hta-webrtc 2016/10/28 09:55:23 Query: Is it really necessary to pollute webrtc/co
magjed_webrtc 2016/10/28 14:59:27 Good point. I moved everything to webrtc/common_vi
+ kProfileConstrainedBaseline,
+ kProfileBaseline,
+ kProfileMain,
+ kProfileConstrainedHigh,
+ kProfileHigh,
+};
+
+// All values are equal to ten times the level number, except level 1b which is
+// special.
+enum H264Level {
+ kH264Level1_b = 0,
+ kH264Level1 = 10,
+ kH264Level1_1 = 11,
+ kH264Level1_2 = 12,
+ kH264Level1_3 = 13,
+ kH264Level2 = 20,
+ kH264Level2_1 = 21,
+ kH264Level2_2 = 22,
+ kH264Level3 = 30,
+ kH264Level3_1 = 31,
+ kH264Level3_2 = 32,
+ kH264Level4 = 40,
+ kH264Level4_1 = 41,
+ kH264Level4_2 = 42,
+ kH264Level5 = 50,
+ kH264Level5_1 = 51,
+ kH264Level5_2 = 52
+};
+
+struct H264ProfileLevelId {
+ H264Profile profile;
+ H264Level level;
+};
+
+// Parse H264 profile level id that is represented as a string of 3 hex bytes.
+// Nothing will be returned if the string is not a recognized H264
+// profile level id.
+rtc::Optional<H264ProfileLevelId> ParseH264ProfileLevelId(const char* str);
enum VP8ResilienceMode {
kResilienceOff, // The stream produced by the encoder requires a
@@ -543,7 +582,7 @@ struct VideoCodecVP9 {
// H264 specific.
struct VideoCodecH264 {
- VideoCodecProfile profile;
+ H264ProfileLevelId profileLevelId;
bool frameDroppingOn;
int keyFrameInterval;
// These are NULL/0 if not externally negotiated.
« no previous file with comments | « no previous file | webrtc/common_types.cc » ('j') | webrtc/common_types.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698