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

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

Issue 416553002: VideoCaptureFormat: add method to print out pixel format as string (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 | « media/video/capture/video_capture_types.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 fa78f427489154e52784345f34654ed68de15b70..17f2d654c6193e697b8dbc9a188bcaa099d4e74d 100644
--- a/media/video/capture/video_capture_types.cc
+++ b/media/video/capture/video_capture_types.cc
@@ -4,6 +4,7 @@
#include "media/video/capture/video_capture_types.h"
+#include "base/logging.h"
#include "media/base/limits.h"
namespace media {
@@ -29,6 +30,35 @@ bool VideoCaptureFormat::IsValid() const {
(pixel_format < PIXEL_FORMAT_MAX);
}
+std::string VideoCaptureFormat::PixelFormatToString(VideoPixelFormat format) {
+ switch (format) {
+ case PIXEL_FORMAT_UNKNOWN:
+ return "UNKNOWN";
+ case PIXEL_FORMAT_I420:
+ return "I420";
+ case PIXEL_FORMAT_YUY2:
+ return "YUY2";
+ case PIXEL_FORMAT_UYVY:
+ return "UYUY";
+ case PIXEL_FORMAT_RGB24:
+ return "RGB24";
+ case PIXEL_FORMAT_ARGB:
+ return "ARGB";
+ case PIXEL_FORMAT_MJPEG:
+ return "MJPEG";
+ case PIXEL_FORMAT_NV21:
+ return "YV12";
+ case PIXEL_FORMAT_YV12:
+ return "YV12";
+ case PIXEL_FORMAT_TEXTURE:
+ return "TEXTURE";
+ case PIXEL_FORMAT_MAX:
+ break;
+ }
+ NOTREACHED() << "Invalid VideoPixelFormat provided: " << format;
+ return "";
+}
+
VideoCaptureParams::VideoCaptureParams() : allow_resolution_change(false) {}
} // namespace media
« no previous file with comments | « media/video/capture/video_capture_types.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698