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

Unified Diff: webrtc/common_video/h264/profile_level_id.h

Issue 2472693002: Add to-string function for H264 profile level id (Closed)
Patch Set: Created 4 years, 1 month 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
Index: webrtc/common_video/h264/profile_level_id.h
diff --git a/webrtc/common_video/h264/profile_level_id.h b/webrtc/common_video/h264/profile_level_id.h
index 84f0005785bb04c2394d07d37a3f4b09bb45a81d..c7aeff9f0143e6657883af99ecbf9486f447d84b 100644
--- a/webrtc/common_video/h264/profile_level_id.h
+++ b/webrtc/common_video/h264/profile_level_id.h
@@ -11,6 +11,8 @@
#ifndef WEBRTC_COMMON_VIDEO_H264_PROFILE_LEVEL_ID_H_
#define WEBRTC_COMMON_VIDEO_H264_PROFILE_LEVEL_ID_H_
+#include <string>
+
#include "webrtc/base/optional.h"
namespace webrtc {
@@ -47,6 +49,9 @@ enum Level {
};
struct ProfileLevelId {
+ ProfileLevelId() : profile(kProfileBaseline), level(kLevel1) {}
kthelgason 2016/11/03 09:39:05 I'm not convinced that this default constructor is
magjed_webrtc 2016/11/03 12:31:16 Alright, let's remove the default constructor and
+ ProfileLevelId(Profile profile, Level level)
+ : profile(profile), level(level) {}
Profile profile;
Level level;
};
@@ -56,6 +61,10 @@ struct ProfileLevelId {
// profile level id.
rtc::Optional<ProfileLevelId> ParseProfileLevelId(const char* str);
+// Returns canonical string representation as three hex bytes of the profile
+// level id, or returns empty string for invalid profile level id.
+std::string ProfileLevelIdToString(const ProfileLevelId& profile_level_id);
+
} // namespace H264
} // namespace webrtc
« no previous file with comments | « no previous file | webrtc/common_video/h264/profile_level_id.cc » ('j') | webrtc/common_video/h264/profile_level_id.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698