Adding BGRA as a video type.

This CL is a prerequisite for the capture module update CL. 
Review URL: http://webrtc-codereview.appspot.com/329021

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1317 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
mikhal@webrtc.org 2012-01-03 18:49:15 +00:00
parent 877c54e230
commit c00f91d62d
2 changed files with 6 additions and 0 deletions

View File

@ -433,6 +433,7 @@ enum RawVideoType
kVideoMJPEG = 10, kVideoMJPEG = 10,
kVideoNV12 = 11, kVideoNV12 = 11,
kVideoNV21 = 12, kVideoNV21 = 12,
kVideoBGRA = 13,
kVideoUnknown = 99 kVideoUnknown = 99
}; };

View File

@ -47,6 +47,8 @@ VideoType RawVideoTypeToCommonVideoVideoType(RawVideoType type) {
return kNV21; return kNV21;
case kVideoNV12: case kVideoNV12:
return kNV12; return kNV12;
case kVideoBGRA:
return kBGRA;
default: default:
assert(false); assert(false);
} }
@ -73,6 +75,7 @@ int CalcBufferSize(VideoType type, int width, int height) {
case kRGB24: case kRGB24:
bits_per_pixel = 24; bits_per_pixel = 24;
break; break;
case kBGRA:
case kARGB: case kARGB:
bits_per_pixel = 32; bits_per_pixel = 32;
break; break;
@ -105,6 +108,7 @@ int CalcBufferSize(VideoType src_video_type,
case kRGB24: case kRGB24:
src_bits_per_pixel = 24; src_bits_per_pixel = 24;
break; break;
case kBGRA:
case kARGB: case kARGB:
src_bits_per_pixel = 32; src_bits_per_pixel = 32;
break; break;
@ -130,6 +134,7 @@ int CalcBufferSize(VideoType src_video_type,
case kRGB24: case kRGB24:
dst_bits_per_pixel = 24; dst_bits_per_pixel = 24;
break; break;
case kBGRA:
case kARGB: case kARGB:
dst_bits_per_pixel = 32; dst_bits_per_pixel = 32;
break; break;