mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-12 21:30:45 +01:00
webrtc_libyuv: Add support for more video types for consistency
Bug: webrtc:14830 Change-Id: I0998fb04a03745131f9f5cca878b0cdb46f3b62b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/291529 Reviewed-by: Erik Språng <sprang@webrtc.org> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> Cr-Commit-Position: refs/heads/main@{#39940}
This commit is contained in:
parent
f9e3bdd2ce
commit
ba41b40461
2 changed files with 8 additions and 0 deletions
|
@ -32,7 +32,9 @@ enum class VideoType {
|
|||
kI420,
|
||||
kIYUV,
|
||||
kRGB24,
|
||||
kBGR24,
|
||||
kARGB,
|
||||
kABGR,
|
||||
kRGB565,
|
||||
kYUY2,
|
||||
kYV12,
|
||||
|
|
|
@ -36,9 +36,11 @@ size_t CalcBufferSize(VideoType type, int width, int height) {
|
|||
case VideoType::kUYVY:
|
||||
return width * height * 2;
|
||||
case VideoType::kRGB24:
|
||||
case VideoType::kBGR24:
|
||||
return width * height * 3;
|
||||
case VideoType::kBGRA:
|
||||
case VideoType::kARGB:
|
||||
case VideoType::kABGR:
|
||||
return width * height * 4;
|
||||
case VideoType::kMJPEG:
|
||||
case VideoType::kUnknown:
|
||||
|
@ -90,6 +92,10 @@ int ConvertVideoType(VideoType video_type) {
|
|||
return libyuv::FOURCC_YV12;
|
||||
case VideoType::kRGB24:
|
||||
return libyuv::FOURCC_24BG;
|
||||
case VideoType::kBGR24:
|
||||
return libyuv::FOURCC_RAW;
|
||||
case VideoType::kABGR:
|
||||
return libyuv::FOURCC_ABGR;
|
||||
case VideoType::kRGB565:
|
||||
return libyuv::FOURCC_RGBP;
|
||||
case VideoType::kYUY2:
|
||||
|
|
Loading…
Reference in a new issue