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

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

Issue 2398463003: 16 bit capture and GPU&CPU memory buffer support.
Patch Set: fixes. Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/capture/video/video_capture_utils.h ('k') | media/capture/video/win/sink_input_pin_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/capture/video/video_capture_utils.cc
diff --git a/media/capture/video/blob_utils.cc b/media/capture/video/video_capture_utils.cc
similarity index 79%
rename from media/capture/video/blob_utils.cc
rename to media/capture/video/video_capture_utils.cc
index 54b622476c32055611c614c8c9960e8ed75faa23..2dacbb175f8c3b0715ca69d339aae25ccb25d75c 100644
--- a/media/capture/video/blob_utils.cc
+++ b/media/capture/video/video_capture_utils.cc
@@ -2,16 +2,26 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "media/capture/video/blob_utils.h"
+#include "media/capture/video/video_capture_utils.h"
+#include "base/big_endian.h"
#include "media/base/video_capture_types.h"
#include "media/base/video_frame.h"
#include "third_party/libyuv/include/libyuv.h"
#include "third_party/skia/include/core/SkImage.h"
#include "ui/gfx/codec/png_codec.h"
+#define FourCcMacro(f, o, u, r) \
+ static_cast<unsigned>((static_cast<unsigned>(f) << 0)) | \
+ (static_cast<unsigned>(o) << 8) | (static_cast<unsigned>(u) << 16) | \
+ (static_cast<unsigned>(r) << 24)
+
namespace media {
+static const unsigned kFourCcZ16 = FourCcMacro('Z', '1', '6', ' ');
+static const unsigned kFourCcINVZ = FourCcMacro('I', 'N', 'V', 'Z');
+static const unsigned kFourCcY16 = FourCcMacro('Y', '1', '6', ' ');
+
mojom::BlobPtr Blobify(const uint8_t* buffer,
const uint32_t bytesused,
const VideoCaptureFormat& capture_format) {
@@ -66,4 +76,8 @@ mojom::BlobPtr Blobify(const uint8_t* buffer,
return blob;
}
+bool IsY16FormatFourCc(unsigned four) {
+ return four == kFourCcZ16 || four == kFourCcINVZ || four == kFourCcY16;
+}
+
} // namespace media
« no previous file with comments | « media/capture/video/video_capture_utils.h ('k') | media/capture/video/win/sink_input_pin_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698