summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;
}