编译运行mplayer播放器bgr不支持的问题
来源:互联网 发布:大数据行业竞争格局 编辑:程序博客网 时间:2024/06/08 14:45
编译运行mplayer显示下面的错误信息:
BGR not supported, please contact the developers
需要给libvo/vo_x11.c打补丁
补丁如下(如果不能用patch,请手工修改vo_x11.c):
-------------- next part --------------
Index: libvo/vo_x11.c
===================================================================
--- libvo/vo_x11.c(revision 20203)
+++ libvo/vo_x11.c(working copy)
@@ -254,6 +254,47 @@
myximage = NULL;
}
+#ifdef WORDS_BIGENDIAN
+#define BO_NATIVE MSBFirst
+#define BO_NONNATIVE LSBFirst
+#else
+#define BO_NATIVE LSBFirst
+#define BO_NONNATIVE MSBFirst
+#endif
+struct fmt2Xfmtentry_s {
+ uint32_t mpfmt;
+ int byte_order;
+ unsigned red_mask;
+ unsigned green_mask;
+ unsigned blue_mask;
+} fmt2Xfmt[] = {
+ {IMGFMT_RGB8, BO_NATIVE, 0x00000007, 0x00000038, 0x000000C0},
+ {IMGFMT_RGB8, BO_NONNATIVE, 0x00000007, 0x00000038, 0x000000C0},
+ {IMGFMT_BGR8, BO_NATIVE, 0x000000E0, 0x0000001C, 0x00000003},
+ {IMGFMT_BGR8, BO_NONNATIVE, 0x000000E0, 0x0000001C, 0x00000003},
+ {IMGFMT_RGB15, BO_NATIVE, 0x0000001F, 0x000003E0, 0x00007C00},
+ {IMGFMT_BGR15, BO_NATIVE, 0x00007C00, 0x000003E0, 0x0000001F},
+ {IMGFMT_RGB16, BO_NATIVE, 0x0000001F, 0x000007E0, 0x0000F800},
+ {IMGFMT_BGR16, BO_NATIVE, 0x0000F800, 0x000007E0, 0x0000001F},
+ {IMGFMT_RGB24, MSBFirst, 0x00FF0000, 0x0000FF00, 0x000000FF},
+ {IMGFMT_RGB24, LSBFirst, 0x000000FF, 0x0000FF00, 0x00FF0000},
+ {IMGFMT_BGR24, MSBFirst, 0x000000FF, 0x0000FF00, 0x00FF0000},
+ {IMGFMT_BGR24, LSBFirst, 0x00FF0000, 0x0000FF00, 0x000000FF},
+ {IMGFMT_RGB32, BO_NATIVE, 0x000000FF, 0x0000FF00, 0x00FF0000},
+ {IMGFMT_RGB32, BO_NONNATIVE, 0xFF000000, 0x00FF0000, 0x0000FF00},
+ {IMGFMT_BGR32, BO_NATIVE, 0x00FF0000, 0x0000FF00, 0x000000FF},
+ {IMGFMT_BGR32, BO_NONNATIVE, 0x0000FF00, 0x00FF0000, 0xFF000000},
+ {IMGFMT_ARGB, MSBFirst, 0x00FF0000, 0x0000FF00, 0x000000FF},
+ {IMGFMT_ARGB, LSBFirst, 0x0000FF00, 0x00FF0000, 0xFF000000},
+ {IMGFMT_ABGR, MSBFirst, 0x000000FF, 0x0000FF00, 0x00FF0000},
+ {IMGFMT_ABGR, LSBFirst, 0xFF000000, 0x00FF0000, 0x0000FF00},
+ {IMGFMT_RGBA, MSBFirst, 0xFF000000, 0x00FF0000, 0x0000FF00},
+ {IMGFMT_RGBA, LSBFirst, 0x000000FF, 0x0000FF00, 0x00FF0000},
+ {IMGFMT_BGRA, MSBFirst, 0x0000FF00, 0x00FF0000, 0xFF000000},
+ {IMGFMT_BGRA, LSBFirst, 0x00FF0000, 0x0000FF00, 0x000000FF},
+ {0, 0, 0, 0, 0}
+};
+
static int config(uint32_t width, uint32_t height, uint32_t d_width,
uint32_t d_height, uint32_t flags, char *title,
uint32_t format)
@@ -269,6 +310,7 @@
Colormap theCmap;
XSetWindowAttributes xswa;
unsigned long xswamask;
+ struct fmt2Xfmtentry_s *fmte = fmt2Xfmt;
#ifdef HAVE_XF86VM
unsigned int modeline_width, modeline_height;
@@ -470,32 +512,35 @@
vo_dheight = vo_screenheight;
}
+ while (fmte->mpfmt) {
+ if (IMGFMT_RGB_DEPTH(fmte->mpfmt) == myximage->bits_per_pixel &&
+ fmte->byte_order == myximage->byte_order &&
+ fmte->red_mask == myximage->red_mask &&
+ fmte->green_mask == myximage->green_mask &&
+ fmte->blue_mask == myximage->blue_mask)
+ break;
+ fmte++;
+ }
+ if (!fmte->mpfmt) {
+ mp_msg(MSGT_VO, MSGL_ERR,
+ "X server image format not supported, please contact the developers/n");
+ return -1;
+ }
+ out_format = fmte->mpfmt;
switch ((bpp = myximage->bits_per_pixel))
{
case 24:
draw_alpha_fnc = draw_alpha_24;
- out_format = IMGFMT_BGR24;
break;
case 32:
draw_alpha_fnc = draw_alpha_32;
- out_format = IMGFMT_BGR32;
break;
case 15:
+ draw_alpha_fnc = draw_alpha_15;
+ break;
case 16:
- if (depth == 15)
- {
- draw_alpha_fnc = draw_alpha_15;
- out_format = IMGFMT_BGR15;
- } else
- {
draw_alpha_fnc = draw_alpha_16;
- out_format = IMGFMT_BGR16;
- }
break;
- case 8:
- draw_alpha_fnc = draw_alpha_null;
- out_format = IMGFMT_BGR8;
- break;
default:
draw_alpha_fnc = draw_alpha_null;
}
@@ -510,35 +555,6 @@
dst_width = width;
//printf( "X11 bpp: %d color mask: R:%lX G:%lX B:%lX/n",bpp,myximage->red_mask,myximage->green_mask,myximage->blue_mask );
- // If we have blue in the lowest bit then obviously RGB
- mode = ((myximage->blue_mask & 0x01) != 0) ? MODE_RGB : MODE_BGR;
-#ifdef WORDS_BIGENDIAN
- if (myximage->byte_order != MSBFirst)
-#else
- if (myximage->byte_order != LSBFirst)
-#endif
- {
- mode = ((myximage->blue_mask & 0x01) != 0) ? MODE_BGR : MODE_RGB;
-// printf( "No support for non-native XImage byte order!/n" );
-// return -1;
- }
-#ifdef WORDS_BIGENDIAN
- if (mode == MODE_BGR && bpp != 32)
- {
- mp_msg(MSGT_VO, MSGL_ERR,
- "BGR%d not supported, please contact the developers/n",
- bpp);
- return -1;
- }
-#else
- if (mode == MODE_BGR)
- {
- mp_msg(MSGT_VO, MSGL_ERR,
- "BGR not supported, please contact the developers/n");
- return -1;
- }
-#endif
-
if (vo_ontop)
vo_x11_setlayer(mDisplay, vo_window, vo_ontop);
- 编译运行mplayer播放器bgr不支持的问题
- Fodora下mplayer播放rmvb的问题
- Mplayer视频播放显示的问题
- mplayer播放问题汇集
- mplayer播放问题汇集
- MPlayer - Linux下的电影播放器
- 基于QT的mplayer播放器
- 基于Mplayer的QT视频播放器
- 基于QT的mplayer播放器 .
- 基于QT的mplayer播放器
- MPlayer播放器安装
- QT MPlayer播放器
- 安装MPlayer播放器
- mplayer 播放rmvb 遇到问题
- 解决mplayer在windows下的简体中文播放问题
- 解决mplayer播放rmvb文件有问题的方法
- ubuntu7.10中mplayer不能播放的问题
- Ubuntu MPlayer播放.flv文件声音图像不同步的问题
- Thread大全---转贴收藏
- VS2005快捷键
- 【转】王林:中国股市能否走出囚徒困境
- 常用控件(TreeView)
- BlackBerry 7290如何传自定义图片
- 编译运行mplayer播放器bgr不支持的问题
- .net 利用 Jmail 发送邮件(实例和Jmail4.3组件下载)以及Jmail参数说明
- 思想整理20081030
- 说说异或运算^和他的一个常用作用 (转载)
- ABAP OBJECTS OVEWVIEW
- Windows Server 2003 IIS6.0不支持.swf格式
- 感受金融危机
- 解决J2EE开发中的乱码问题
- HTTP 的状态代码定义 RFC2616