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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #ifndef WEBRTC_COMMON_VIDEO_H264_PROFILE_LEVEL_ID_H_ 11 #ifndef WEBRTC_COMMON_VIDEO_H264_PROFILE_LEVEL_ID_H_
12 #define WEBRTC_COMMON_VIDEO_H264_PROFILE_LEVEL_ID_H_ 12 #define WEBRTC_COMMON_VIDEO_H264_PROFILE_LEVEL_ID_H_
13 13
14 #include <string>
15
14 #include "webrtc/base/optional.h" 16 #include "webrtc/base/optional.h"
15 17
16 namespace webrtc { 18 namespace webrtc {
17 namespace H264 { 19 namespace H264 {
18 20
19 enum Profile { 21 enum Profile {
20 kProfileConstrainedBaseline, 22 kProfileConstrainedBaseline,
21 kProfileBaseline, 23 kProfileBaseline,
22 kProfileMain, 24 kProfileMain,
23 kProfileConstrainedHigh, 25 kProfileConstrainedHigh,
(...skipping 16 matching lines...) Expand all
40 kLevel3_2 = 32, 42 kLevel3_2 = 32,
41 kLevel4 = 40, 43 kLevel4 = 40,
42 kLevel4_1 = 41, 44 kLevel4_1 = 41,
43 kLevel4_2 = 42, 45 kLevel4_2 = 42,
44 kLevel5 = 50, 46 kLevel5 = 50,
45 kLevel5_1 = 51, 47 kLevel5_1 = 51,
46 kLevel5_2 = 52 48 kLevel5_2 = 52
47 }; 49 };
48 50
49 struct ProfileLevelId { 51 struct ProfileLevelId {
52 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
53 ProfileLevelId(Profile profile, Level level)
54 : profile(profile), level(level) {}
50 Profile profile; 55 Profile profile;
51 Level level; 56 Level level;
52 }; 57 };
53 58
54 // Parse profile level id that is represented as a string of 3 hex bytes. 59 // Parse profile level id that is represented as a string of 3 hex bytes.
55 // Nothing will be returned if the string is not a recognized H264 60 // Nothing will be returned if the string is not a recognized H264
56 // profile level id. 61 // profile level id.
57 rtc::Optional<ProfileLevelId> ParseProfileLevelId(const char* str); 62 rtc::Optional<ProfileLevelId> ParseProfileLevelId(const char* str);
58 63
64 // Returns canonical string representation as three hex bytes of the profile
65 // level id, or returns empty string for invalid profile level id.
66 std::string ProfileLevelIdToString(const ProfileLevelId& profile_level_id);
67
59 } // namespace H264 68 } // namespace H264
60 } // namespace webrtc 69 } // namespace webrtc
61 70
62 #endif // WEBRTC_COMMON_VIDEO_H264_PROFILE_LEVEL_ID_H_ 71 #endif // WEBRTC_COMMON_VIDEO_H264_PROFILE_LEVEL_ID_H_
OLDNEW
« 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