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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ppapi/shared_impl/media_stream_video_track_shared.h"
6
7 #include "base/logging.h"
8
9 namespace {
10
11 const int32_t kMaxWidth = 4096;
12 const int32_t kMaxHeight = 4096;
13
14 } // namespace
15
16 namespace ppapi {
17
18 // static
19 bool MediaStreamVideoTrackShared::VerifyAttributes(
20 const Attributes& attributes) {
21 if (attributes.buffers < 0)
22 return false;
23 if (attributes.format < PP_VIDEOFRAME_FORMAT_UNKNOWN ||
24 attributes.format > PP_VIDEOFRAME_FORMAT_LAST) {
25 return false;
26 }
27 if (attributes.width < 0 ||
28 attributes.width > kMaxWidth ||
29 attributes.width & 0x3) {
30 return false;
31 }
32 if (attributes.height < 0 ||
33 attributes.height > kMaxHeight ||
34 attributes.height & 0x3) {
35 return false;
36 }
37 return true;
38 }
39
40 } // namespace ppapi
OLDNEW
« 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