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

Unified Diff: media/base/assert_matching_enums.cc

Issue 418193003: Using PROFILE_ANY for vp8 and vp9 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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
Index: media/base/assert_matching_enums.cc
diff --git a/media/base/assert_matching_enums.cc b/media/base/assert_matching_enums.cc
new file mode 100644
index 0000000000000000000000000000000000000000..230e25945023fa046806491dd0bc53b4e80fcd1d
--- /dev/null
+++ b/media/base/assert_matching_enums.cc
@@ -0,0 +1,47 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
amogh.bihani 2014/07/30 10:22:41 This should avoid anyone accidentally changing ent
xhwang 2014/07/30 21:21:41 I think we are doing the conversion explicitly in
amogh.bihani 2014/07/31 05:07:40 Acknowledged. I'll remove this :).
+// found in the LICENSE file.
+
+#include "base/macros.h"
+#include "media/base/video_decoder_config.h"
+#include "ppapi/c/dev/pp_video_dev.h"
+
+namespace {
+
+#define COMPILE_ASSERT_MATCHING_ENUM(expected, actual) \
+ COMPILE_ASSERT(int(expected) == int(actual), mismatching_enums)
+
+// PPAPI contains a "none" H.264 profile that doesn't correspond to any codec
+// profile in H.264
+const int kH264PROFILE_NONE_OFFSET = 1;
+
+// Video codecs
+COMPILE_ASSERT_MATCHING_ENUM(PP_VIDEODECODER_PROFILE_UNKNOWN,
+ media::VIDEO_CODEC_PROFILE_UNKNOWN);
+COMPILE_ASSERT_MATCHING_ENUM(PP_VIDEODECODER_H264PROFILE_BASELINE,
+ media::H264PROFILE_BASELINE + kH264PROFILE_NONE_OFFSET);
+COMPILE_ASSERT_MATCHING_ENUM(PP_VIDEODECODER_H264PROFILE_MAIN,
+ media::H264PROFILE_MAIN + kH264PROFILE_NONE_OFFSET);
+COMPILE_ASSERT_MATCHING_ENUM(PP_VIDEODECODER_H264PROFILE_EXTENDED,
+ media::H264PROFILE_EXTENDED + kH264PROFILE_NONE_OFFSET);
+COMPILE_ASSERT_MATCHING_ENUM(PP_VIDEODECODER_H264PROFILE_HIGH,
+ media::H264PROFILE_HIGH + kH264PROFILE_NONE_OFFSET);
+COMPILE_ASSERT_MATCHING_ENUM(PP_VIDEODECODER_H264PROFILE_HIGH10PROFILE,
+ media::H264PROFILE_HIGH10PROFILE + kH264PROFILE_NONE_OFFSET);
+COMPILE_ASSERT_MATCHING_ENUM(PP_VIDEODECODER_H264PROFILE_HIGH422PROFILE,
+ media::H264PROFILE_HIGH422PROFILE + kH264PROFILE_NONE_OFFSET);
+COMPILE_ASSERT_MATCHING_ENUM(
+ PP_VIDEODECODER_H264PROFILE_HIGH444PREDICTIVEPROFILE,
+ media::H264PROFILE_HIGH444PREDICTIVEPROFILE + kH264PROFILE_NONE_OFFSET);
+COMPILE_ASSERT_MATCHING_ENUM(PP_VIDEODECODER_H264PROFILE_SCALABLEBASELINE,
+ media::H264PROFILE_SCALABLEBASELINE + kH264PROFILE_NONE_OFFSET);
+COMPILE_ASSERT_MATCHING_ENUM(PP_VIDEODECODER_H264PROFILE_SCALABLEHIGH,
+ media::H264PROFILE_SCALABLEHIGH + kH264PROFILE_NONE_OFFSET);
+COMPILE_ASSERT_MATCHING_ENUM(PP_VIDEODECODER_H264PROFILE_STEREOHIGH,
+ media::H264PROFILE_STEREOHIGH + kH264PROFILE_NONE_OFFSET);
+COMPILE_ASSERT_MATCHING_ENUM(PP_VIDEODECODER_H264PROFILE_MULTIVIEWHIGH,
+ media::H264PROFILE_MULTIVIEWHIGH + kH264PROFILE_NONE_OFFSET);
+COMPILE_ASSERT_MATCHING_ENUM(PP_VIDEODECODER_VP8PROFILE_MAIN,
+ media::VP8PROFILE_MAIN + kH264PROFILE_NONE_OFFSET);
+
+} // namespace

Powered by Google App Engine
This is Rietveld 408576698