mirror of
https://github.com/mpv-player/mpv
synced 2025-01-02 13:02:24 +00:00
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
This commit is contained in:
parent
c0b8b92d99
commit
a55acacbda
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user