summaryrefslogtreecommitdiffstats
path: root/libvo/vo_corevideo.m
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-04-05 13:11:06 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-04-05 13:11:06 +0000
commita55acacbdadd513f00bcf2985256dde68c379885 (patch)
tree3240163d70a260c452ce9bb8f2ab29f500c962cc /libvo/vo_corevideo.m
parentc0b8b92d99b1425944048f949e54b83aec68ea69 (diff)
downloadmpv-a55acacbdadd513f00bcf2985256dde68c379885.tar.bz2
mpv-a55acacbdadd513f00bcf2985256dde68c379885.tar.xz
Fix RGB support for corevideo: corevideo can only support
ARGB and BGRA, which depending on endianness matches only one of RGB32 and BGR32. Also add RGB24 support which works independent of endianness, git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31016 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_corevideo.m')
-rw-r--r--libvo/vo_corevideo.m30
1 files changed, 22 insertions, 8 deletions
diff --git a/libvo/vo_corevideo.m b/libvo/vo_corevideo.m
index 49f472c630..94bd1964b1 100644
--- a/libvo/vo_corevideo.m
+++ b/libvo/vo_corevideo.m
@@ -104,8 +104,11 @@ static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src, unsigne
{
switch (image_format)
{
- case IMGFMT_BGR32:
- case IMGFMT_RGB32:
+ case IMGFMT_RGB24:
+ vo_draw_alpha_rgb24(w,h,src,srca,stride,image_data+3*(y0*image_width+x0),3*image_width);
+ break;
+ case IMGFMT_ARGB:
+ case IMGFMT_BGRA:
vo_draw_alpha_rgb32(w,h,src,srca,stride,image_data+4*(y0*image_width+x0),4*image_width);
break;
case IMGFMT_YUY2:
@@ -171,8 +174,11 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_
image_height = height;
switch (image_format)
{
- case IMGFMT_BGR32:
- case IMGFMT_RGB32:
+ case IMGFMT_RGB24:
+ image_depth = 24;
+ break;
+ case IMGFMT_ARGB:
+ case IMGFMT_BGRA:
image_depth = 32;
break;
case IMGFMT_YUY2:
@@ -300,18 +306,26 @@ static uint32_t draw_image(mp_image_t *mpi)
static int query_format(uint32_t format)
{
+ const int supportflags = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_OSD | VFCAP_HWSCALE_UP | VFCAP_HWSCALE_DOWN;
image_format = format;
switch(format)
{
case IMGFMT_YUY2:
pixelFormat = kYUVSPixelFormat;
- return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_OSD | VFCAP_HWSCALE_UP | VFCAP_HWSCALE_DOWN;
+ return supportflags;
- case IMGFMT_RGB32:
- case IMGFMT_BGR32:
+ case IMGFMT_RGB24:
+ pixelFormat = k24RGBPixelFormat;
+ return supportflags;
+
+ case IMGFMT_ARGB:
pixelFormat = k32ARGBPixelFormat;
- return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_OSD | VFCAP_HWSCALE_UP | VFCAP_HWSCALE_DOWN;
+ return supportflags;
+
+ case IMGFMT_BGRA:
+ pixelFormat = k32BGRAPixelFormat;
+ return supportflags;
}
return 0;
}