/* * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree.
*/
// Common definition for video, including fourcc and VideoFormat.
// 5 Auxiliary YUV variations: 3 with U and V planes are swapped, 1 Alias.
FOURCC_YV12 = CRICKET_FOURCC('Y', 'V', '1', '2'),
FOURCC_YV16 = CRICKET_FOURCC('Y', 'V', '1', '6'),
FOURCC_YV24 = CRICKET_FOURCC('Y', 'V', '2', '4'),
FOURCC_YU12 = CRICKET_FOURCC('Y', 'U', '1', '2'), // Linux version of I420.
FOURCC_J420 = CRICKET_FOURCC('J', '4', '2', '0'),
FOURCC_J400 = CRICKET_FOURCC('J', '4', '0', '0'),
// 14 Auxiliary aliases. CanonicalFourCC() maps these to canonical FOURCC.
FOURCC_IYUV = CRICKET_FOURCC('I', 'Y', 'U', 'V'), // Alias for I420.
FOURCC_YU16 = CRICKET_FOURCC('Y', 'U', '1', '6'), // Alias for I422.
FOURCC_YU24 = CRICKET_FOURCC('Y', 'U', '2', '4'), // Alias for I444.
FOURCC_YUYV = CRICKET_FOURCC('Y', 'U', 'Y', 'V'), // Alias for YUY2.
FOURCC_YUVS = CRICKET_FOURCC('y', 'u', 'v', 's'), // Alias for YUY2 on Mac.
FOURCC_HDYC = CRICKET_FOURCC('H', 'D', 'Y', 'C'), // Alias for UYVY.
FOURCC_2VUY = CRICKET_FOURCC('2', 'v', 'u', 'y'), // Alias for UYVY on Mac.
FOURCC_JPEG = CRICKET_FOURCC('J', 'P', 'E', 'G'), // Alias for MJPG.
FOURCC_DMB1 = CRICKET_FOURCC('d', 'm', 'b', '1'), // Alias for MJPG on Mac.
FOURCC_BA81 = CRICKET_FOURCC('B', 'A', '8', '1'), // Alias for BGGR.
FOURCC_RGB3 = CRICKET_FOURCC('R', 'G', 'B', '3'), // Alias for RAW.
FOURCC_BGR3 = CRICKET_FOURCC('B', 'G', 'R', '3'), // Alias for 24BG.
FOURCC_CM32 = CRICKET_FOURCC(0, 0, 0, 32), // BGRA kCMPixelFormat_32ARGB
FOURCC_CM24 = CRICKET_FOURCC(0, 0, 0, 24), // RAW kCMPixelFormat_24RGB
// 1 Auxiliary compressed YUV format set aside for capturer.
FOURCC_H264 = CRICKET_FOURCC('H', '2', '6', '4'),
};
#undef CRICKET_FOURCC
// Match any fourcc.
// We move this out of the enum because using it in many places caused // the compiler to get grumpy, presumably since the above enum is // backed by an int. staticconst uint32_t FOURCC_ANY = 0xFFFFFFFF;
// Converts fourcc aliases into canonical ones.
uint32_t CanonicalFourCC(uint32_t fourcc);
////////////////////////////////////////////////////////////////////////////// // Definition of VideoFormat. //////////////////////////////////////////////////////////////////////////////
// VideoFormat with Plain Old Data for global variables. struct VideoFormatPod { int width; // Number of pixels. int height; // Number of pixels.
int64_t interval; // Nanoseconds.
uint32_t fourcc; // Color space. FOURCC_ANY means that any color space is OK.
};
int framerate() const { return IntervalToFps(interval); }
// Check if both width and height are 0. bool IsSize0x0() const { return0 == width && 0 == height; }
// Check if this format is less than another one by comparing the resolution // and frame rate. bool IsPixelRateLess(const VideoFormat& format) const { return width * height * framerate() <
format.width * format.height * format.framerate();
}
// Get a string presentation in the form of "fourcc width x height x fps"
std::string ToString() const;
};
// Returns the largest positive integer that divides both `a` and `b`.
ABSL_DEPRECATE_AND_INLINE() int GreatestCommonDivisor(int a, int b);
// Returns the smallest positive integer that is divisible by both `a` and `b`.
ABSL_DEPRECATE_AND_INLINE() int LeastCommonMultiple(int a, int b);
} // namespace cricket
#endif// MEDIA_BASE_VIDEO_COMMON_H_
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.15 Sekunden
(vorverarbeitet am 2026-06-06)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.