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

Unified Diff: media/video/capture/video_capture_types.cc

Issue 532533002: Add ToString function for media::VideoCaptureFormat (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: compile test Created 6 years, 3 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/video/capture/video_capture_types.cc
diff --git a/media/video/capture/video_capture_types.cc b/media/video/capture/video_capture_types.cc
index 17f2d654c6193e697b8dbc9a188bcaa099d4e74d..066794f61bfe975455ed14099b786ebbe39d4b02 100644
--- a/media/video/capture/video_capture_types.cc
+++ b/media/video/capture/video_capture_types.cc
@@ -5,6 +5,7 @@
#include "media/video/capture/video_capture_types.h"
#include "base/logging.h"
+#include "base/strings/stringprintf.h"
#include "media/base/limits.h"
namespace media {
@@ -30,6 +31,15 @@ bool VideoCaptureFormat::IsValid() const {
(pixel_format < PIXEL_FORMAT_MAX);
}
+#if !defined(NDEBUG)
Sébastien Marchand 2014/09/05 19:23:10 I don't think that this prepocessor check is neces
+std::string VideoCaptureFormat::ToString() const {
+ return base::StringPrintf("resolution: %s, fps: %f, pixel format: %s",
+ frame_size.ToString().c_str(),
+ frame_rate,
+ PixelFormatToString(pixel_format).c_str());
+}
+#endif
+
std::string VideoCaptureFormat::PixelFormatToString(VideoPixelFormat format) {
switch (format) {
case PIXEL_FORMAT_UNKNOWN:

Powered by Google App Engine
This is Rietveld 408576698