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

Side by Side Diff: talk/app/webrtc/videosource.cc

Issue 1362503003: Use suffixed {uint,int}{8,16,32,64}_t types. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase + revert basictypes.h (to be landed separately just in case of a revert due to unexpected us… Created 5 years, 2 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 | « talk/app/webrtc/test/mockpeerconnectionobservers.h ('k') | talk/app/webrtc/webrtcsdp.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 // default and still meets the contraints. 243 // default and still meets the contraints.
244 const cricket::VideoFormat& GetBestCaptureFormat( 244 const cricket::VideoFormat& GetBestCaptureFormat(
245 const std::vector<cricket::VideoFormat>& formats) { 245 const std::vector<cricket::VideoFormat>& formats) {
246 ASSERT(formats.size() > 0); 246 ASSERT(formats.size() > 0);
247 247
248 int default_area = kDefaultFormat.width * kDefaultFormat.height; 248 int default_area = kDefaultFormat.width * kDefaultFormat.height;
249 249
250 std::vector<cricket::VideoFormat>::const_iterator it = formats.begin(); 250 std::vector<cricket::VideoFormat>::const_iterator it = formats.begin();
251 std::vector<cricket::VideoFormat>::const_iterator best_it = formats.begin(); 251 std::vector<cricket::VideoFormat>::const_iterator best_it = formats.begin();
252 int best_diff_area = std::abs(default_area - it->width * it->height); 252 int best_diff_area = std::abs(default_area - it->width * it->height);
253 int64 best_diff_interval = kDefaultFormat.interval; 253 int64_t best_diff_interval = kDefaultFormat.interval;
254 for (; it != formats.end(); ++it) { 254 for (; it != formats.end(); ++it) {
255 int diff_area = std::abs(default_area - it->width * it->height); 255 int diff_area = std::abs(default_area - it->width * it->height);
256 int64 diff_interval = std::abs(kDefaultFormat.interval - it->interval); 256 int64_t diff_interval = std::abs(kDefaultFormat.interval - it->interval);
257 if (diff_area < best_diff_area || 257 if (diff_area < best_diff_area ||
258 (diff_area == best_diff_area && diff_interval < best_diff_interval)) { 258 (diff_area == best_diff_area && diff_interval < best_diff_interval)) {
259 best_diff_area = diff_area; 259 best_diff_area = diff_area;
260 best_diff_interval = diff_interval; 260 best_diff_interval = diff_interval;
261 best_it = it; 261 best_it = it;
262 } 262 }
263 } 263 }
264 return *best_it; 264 return *best_it;
265 } 265 }
266 266
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 } 460 }
461 461
462 void VideoSource::SetState(SourceState new_state) { 462 void VideoSource::SetState(SourceState new_state) {
463 if (VERIFY(state_ != new_state)) { 463 if (VERIFY(state_ != new_state)) {
464 state_ = new_state; 464 state_ = new_state;
465 FireOnChanged(); 465 FireOnChanged();
466 } 466 }
467 } 467 }
468 468
469 } // namespace webrtc 469 } // namespace webrtc
OLDNEW
« no previous file with comments | « talk/app/webrtc/test/mockpeerconnectionobservers.h ('k') | talk/app/webrtc/webrtcsdp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698