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 44292631cb51212c55d86d598d738d9c276c9c8e..0df75bf9b7e85fbe42642014b24ae3ecad30fbb0 100644 |
--- a/webrtc/common_video/h264/profile_level_id.h |
+++ b/webrtc/common_video/h264/profile_level_id.h |
@@ -11,6 +11,7 @@ |
#ifndef WEBRTC_COMMON_VIDEO_H264_PROFILE_LEVEL_ID_H_ |
#define WEBRTC_COMMON_VIDEO_H264_PROFILE_LEVEL_ID_H_ |
+#include <map> |
#include <string> |
#include "webrtc/base/optional.h" |
@@ -18,6 +19,9 @@ |
namespace webrtc { |
namespace H264 { |
+// Map containting SDP codec parameters. |
+typedef std::map<std::string, std::string> CodecParameterMap; |
+ |
enum Profile { |
kProfileConstrainedBaseline, |
kProfileBaseline, |
@@ -60,11 +64,25 @@ struct ProfileLevelId { |
// profile level id. |
rtc::Optional<ProfileLevelId> ParseProfileLevelId(const char* str); |
+// Parse profile level id that is represented as a string of 3 hex bytes |
+// contained in an SDP key-value map. A default profile level id will be |
+// returned if the profile-level-id key is missing. Nothing will be returned if |
+// the key is present but the string is invalid. |
+rtc::Optional<ProfileLevelId> ParseSdpProfileLevelId( |
+ const CodecParameterMap& params); |
+ |
// Returns canonical string representation as three hex bytes of the profile |
// level id, or returns nothing for invalid profile level ids. |
rtc::Optional<std::string> ProfileLevelIdToString( |
const ProfileLevelId& profile_level_id); |
+// Return negotiated profile level id based on local and remote codec |
+// parameters profile-level-id and level-asymmetry-allowed. Return nothing if |
+// the parameters are not compatible. |
+rtc::Optional<ProfileLevelId> NegotiateProfileLevelId( |
+ const CodecParameterMap& local_params, |
+ const CodecParameterMap& remote_params); |
+ |
} // namespace H264 |
} // namespace webrtc |