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

Unified Diff: webrtc/common_video/libyuv/webrtc_libyuv.cc

Issue 2535643002: Replace some asserts with DCHECKs (Closed)
Patch Set: Don't use the enum hack Created 4 years, 1 month 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 | « webrtc/common_types.h ('k') | webrtc/common_video/video_render_frames.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_video/libyuv/webrtc_libyuv.cc
diff --git a/webrtc/common_video/libyuv/webrtc_libyuv.cc b/webrtc/common_video/libyuv/webrtc_libyuv.cc
index dd5863dac66ba963adde40bc5e6324e02d99cde6..6bfb1799ee12d5d6ff567ff0ea83f3301982d304 100644
--- a/webrtc/common_video/libyuv/webrtc_libyuv.cc
+++ b/webrtc/common_video/libyuv/webrtc_libyuv.cc
@@ -10,9 +10,10 @@
#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
-#include <assert.h>
#include <string.h>
+#include "webrtc/base/checks.h"
+
// NOTE(ajm): Path provided by gyp.
#include "libyuv.h" // NOLINT
@@ -49,14 +50,14 @@ VideoType RawVideoTypeToCommonVideoVideoType(RawVideoType type) {
case kVideoMJPEG:
return kMJPG;
default:
- assert(false);
+ RTC_NOTREACHED();
}
return kUnknown;
}
size_t CalcBufferSize(VideoType type, int width, int height) {
- assert(width >= 0);
- assert(height >= 0);
+ RTC_DCHECK_GE(width, 0);
+ RTC_DCHECK_GE(height, 0);
size_t buffer_size = 0;
switch (type) {
case kI420:
@@ -84,7 +85,7 @@ size_t CalcBufferSize(VideoType type, int width, int height) {
buffer_size = width * height * 4;
break;
default:
- assert(false);
+ RTC_NOTREACHED();
break;
}
return buffer_size;
@@ -135,7 +136,7 @@ int PrintVideoFrame(const VideoFrame& frame, FILE* file) {
int ExtractBuffer(const rtc::scoped_refptr<VideoFrameBuffer>& input_frame,
size_t size,
uint8_t* buffer) {
- assert(buffer);
+ RTC_DCHECK(buffer);
if (!input_frame)
return -1;
int width = input_frame->width();
@@ -200,7 +201,7 @@ libyuv::RotationMode ConvertRotationMode(VideoRotation rotation) {
case kVideoRotation_270:
return libyuv::kRotate270;
}
- assert(false);
+ RTC_NOTREACHED();
return libyuv::kRotate0;
}
@@ -238,7 +239,7 @@ int ConvertVideoType(VideoType video_type) {
case kARGB1555:
return libyuv::FOURCC_RGBO;
}
- assert(false);
+ RTC_NOTREACHED();
return libyuv::FOURCC_ANY;
}
« no previous file with comments | « webrtc/common_types.h ('k') | webrtc/common_video/video_render_frames.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698