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 |