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

Unified Diff: ppapi/shared_impl/media_stream_video_track_shared.cc

Issue 150403006: [PPAPI][MediaStream] Support configure for video input. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build errors Created 6 years, 10 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
« no previous file with comments | « ppapi/shared_impl/media_stream_video_track_shared.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/media_stream_video_track_shared.cc
diff --git a/ppapi/shared_impl/media_stream_video_track_shared.cc b/ppapi/shared_impl/media_stream_video_track_shared.cc
new file mode 100644
index 0000000000000000000000000000000000000000..0ca894af62c2191ad5eca3827ca4a984e2b35807
--- /dev/null
+++ b/ppapi/shared_impl/media_stream_video_track_shared.cc
@@ -0,0 +1,40 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ppapi/shared_impl/media_stream_video_track_shared.h"
+
+#include "base/logging.h"
+
+namespace {
+
+const int32_t kMaxWidth = 4096;
+const int32_t kMaxHeight = 4096;
+
+} // namespace
+
+namespace ppapi {
+
+// static
+bool MediaStreamVideoTrackShared::VerifyAttributes(
+ const Attributes& attributes) {
+ if (attributes.buffers < 0)
+ return false;
+ if (attributes.format < PP_VIDEOFRAME_FORMAT_UNKNOWN ||
+ attributes.format > PP_VIDEOFRAME_FORMAT_LAST) {
+ return false;
+ }
+ if (attributes.width < 0 ||
+ attributes.width > kMaxWidth ||
+ attributes.width & 0x3) {
+ return false;
+ }
+ if (attributes.height < 0 ||
+ attributes.height > kMaxHeight ||
+ attributes.height & 0x3) {
+ return false;
+ }
+ return true;
+}
+
+} // namespace ppapi
« no previous file with comments | « ppapi/shared_impl/media_stream_video_track_shared.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698