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

Side by Side Diff: media/base/video_codecs.h

Issue 1677133003: Implemented parsing of HEVC codec ids (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@parse-codec-id
Patch Set: rebase Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_BASE_VIDEO_CODECS_H_ 5 #ifndef MEDIA_BASE_VIDEO_CODECS_H_
6 #define MEDIA_BASE_VIDEO_CODECS_H_ 6 #define MEDIA_BASE_VIDEO_CODECS_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <string> 9 #include <string>
10 #include "media/base/media_export.h" 10 #include "media/base/media_export.h"
11 #include "media/media_features.h"
11 12
12 namespace media { 13 namespace media {
13 14
14 enum VideoCodec { 15 enum VideoCodec {
15 // These values are histogrammed over time; do not change their ordinal 16 // These values are histogrammed over time; do not change their ordinal
16 // values. When deleting a codec replace it with a dummy value; when adding a 17 // values. When deleting a codec replace it with a dummy value; when adding a
17 // codec, do so at the bottom (and update kVideoCodecMax). 18 // codec, do so at the bottom (and update kVideoCodecMax).
18 kUnknownVideoCodec = 0, 19 kUnknownVideoCodec = 0,
19 kCodecH264, 20 kCodecH264,
20 kCodecVC1, 21 kCodecVC1,
21 kCodecMPEG2, 22 kCodecMPEG2,
22 kCodecMPEG4, 23 kCodecMPEG4,
23 kCodecTheora, 24 kCodecTheora,
24 kCodecVP8, 25 kCodecVP8,
25 kCodecVP9, 26 kCodecVP9,
26 kCodecHEVC, 27 kCodecHEVC,
27 // DO NOT ADD RANDOM VIDEO CODECS! 28 // DO NOT ADD RANDOM VIDEO CODECS!
28 // 29 //
29 // The only acceptable time to add a new codec is if there is production code 30 // The only acceptable time to add a new codec is if there is production code
30 // that uses said codec in the same CL. 31 // that uses said codec in the same CL.
31 32
32 kVideoCodecMax = kCodecHEVC // Must equal the last "real" codec above. 33 kVideoCodecMax = kCodecHEVC // Must equal the last "real" codec above.
33 }; 34 };
34 35
35 // Video stream profile. This *must* match PP_VideoDecoder_Profile. 36 // Video codec profiles. Keep in sync with mojo::VideoCodecProfile (see
36 // (enforced in webkit/plugins/ppapi/ppb_video_decoder_impl.cc) and 37 // media/mojo/interfaces/media_types.mojom) and gpu::VideoCodecProfile (see
37 // gpu::VideoCodecProfile. 38 // gpu/config/gpu_info.h), as well as PP_VideoDecoder_Profile (translation is
39 // performed in content/renderer/pepper/ppb_video_decoder_impl.cc).
40 // NOTE: These values are histogrammed over time in UMA so the values must
41 // never ever change (add new values to tools/metrics/histograms/histograms.xml)
sandersd (OOO until July 31) 2016/04/20 18:13:54 FYI: I filed crbug.com/605194 about this situation
servolk 2016/04/20 18:21:11 Acknowledged. Thanks for filing the bug!
38 enum VideoCodecProfile { 42 enum VideoCodecProfile {
39 // Keep the values in this enum unique, as they imply format (h.264 vs. VP8, 43 // Keep the values in this enum unique, as they imply format (h.264 vs. VP8,
40 // for example), and keep the values for a particular format grouped 44 // for example), and keep the values for a particular format grouped
41 // together for clarity. 45 // together for clarity.
42 VIDEO_CODEC_PROFILE_UNKNOWN = -1, 46 VIDEO_CODEC_PROFILE_UNKNOWN = -1,
43 VIDEO_CODEC_PROFILE_MIN = VIDEO_CODEC_PROFILE_UNKNOWN, 47 VIDEO_CODEC_PROFILE_MIN = VIDEO_CODEC_PROFILE_UNKNOWN,
44 H264PROFILE_MIN = 0, 48 H264PROFILE_MIN = 0,
45 H264PROFILE_BASELINE = H264PROFILE_MIN, 49 H264PROFILE_BASELINE = H264PROFILE_MIN,
46 H264PROFILE_MAIN = 1, 50 H264PROFILE_MAIN = 1,
47 H264PROFILE_EXTENDED = 2, 51 H264PROFILE_EXTENDED = 2,
48 H264PROFILE_HIGH = 3, 52 H264PROFILE_HIGH = 3,
49 H264PROFILE_HIGH10PROFILE = 4, 53 H264PROFILE_HIGH10PROFILE = 4,
50 H264PROFILE_HIGH422PROFILE = 5, 54 H264PROFILE_HIGH422PROFILE = 5,
51 H264PROFILE_HIGH444PREDICTIVEPROFILE = 6, 55 H264PROFILE_HIGH444PREDICTIVEPROFILE = 6,
52 H264PROFILE_SCALABLEBASELINE = 7, 56 H264PROFILE_SCALABLEBASELINE = 7,
53 H264PROFILE_SCALABLEHIGH = 8, 57 H264PROFILE_SCALABLEHIGH = 8,
54 H264PROFILE_STEREOHIGH = 9, 58 H264PROFILE_STEREOHIGH = 9,
55 H264PROFILE_MULTIVIEWHIGH = 10, 59 H264PROFILE_MULTIVIEWHIGH = 10,
56 H264PROFILE_MAX = H264PROFILE_MULTIVIEWHIGH, 60 H264PROFILE_MAX = H264PROFILE_MULTIVIEWHIGH,
57 VP8PROFILE_MIN = 11, 61 VP8PROFILE_MIN = 11,
58 VP8PROFILE_ANY = VP8PROFILE_MIN, 62 VP8PROFILE_ANY = VP8PROFILE_MIN,
59 VP8PROFILE_MAX = VP8PROFILE_ANY, 63 VP8PROFILE_MAX = VP8PROFILE_ANY,
60 VP9PROFILE_MIN = 12, 64 VP9PROFILE_MIN = 12,
61 VP9PROFILE_PROFILE0 = VP9PROFILE_MIN, 65 VP9PROFILE_PROFILE0 = VP9PROFILE_MIN,
62 VP9PROFILE_PROFILE1 = 13, 66 VP9PROFILE_PROFILE1 = 13,
63 VP9PROFILE_PROFILE2 = 14, 67 VP9PROFILE_PROFILE2 = 14,
64 VP9PROFILE_PROFILE3 = 15, 68 VP9PROFILE_PROFILE3 = 15,
65 VP9PROFILE_MAX = VP9PROFILE_PROFILE3, 69 VP9PROFILE_MAX = VP9PROFILE_PROFILE3,
66 VIDEO_CODEC_PROFILE_MAX = VP9PROFILE_MAX, 70 HEVCPROFILE_MIN = 16,
71 HEVCPROFILE_MAIN = HEVCPROFILE_MIN,
72 HEVCPROFILE_MAIN10 = 17,
73 HEVCPROFILE_MAIN_STILL_PICTURE = 18,
74 HEVCPROFILE_MAX = HEVCPROFILE_MAIN_STILL_PICTURE,
75 VIDEO_CODEC_PROFILE_MAX = HEVCPROFILE_MAX,
67 }; 76 };
68 77
69 std::string MEDIA_EXPORT GetCodecName(VideoCodec codec); 78 std::string MEDIA_EXPORT GetCodecName(VideoCodec codec);
70 std::string MEDIA_EXPORT GetProfileName(VideoCodecProfile profile); 79 std::string MEDIA_EXPORT GetProfileName(VideoCodecProfile profile);
71 80
72 // Handle parsing AVC/H.264 codec ids as outlined in RFC 6381 and ISO-14496-10. 81 // Handle parsing AVC/H.264 codec ids as outlined in RFC 6381 and ISO-14496-10.
73 MEDIA_EXPORT bool ParseAVCCodecId(const std::string& codec_id, 82 MEDIA_EXPORT bool ParseAVCCodecId(const std::string& codec_id,
74 VideoCodecProfile* profile, 83 VideoCodecProfile* profile,
75 uint8_t* level_idc); 84 uint8_t* level_idc);
76 85
86 #if BUILDFLAG(ENABLE_HEVC_DEMUXING)
87 MEDIA_EXPORT bool ParseHEVCCodecId(const std::string& codec_id,
88 VideoCodecProfile* profile,
89 uint8_t* level_idc);
90 #endif
91
77 } // namespace media 92 } // namespace media
78 93
79 #endif // MEDIA_BASE_VIDEO_CODECS_H_ 94 #endif // MEDIA_BASE_VIDEO_CODECS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698