Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Patch for mplayer 2012-05-05 for st2205u and dpf (ax206)

By: a guest on May 6th, 2012  |  syntax: Diff  |  size: 11.73 KB  |  views: 282  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. diff -Nuar -x '*.d' -x '*.xml' -x '*.xsl' mplayer-export-2012-05-05//configure mplayer-dpf//configure
  2. --- mplayer-export-2012-05-05//configure        2012-04-29 23:54:20.000000000 +0800
  3. +++ mplayer-dpf//configure      2012-05-06 10:00:19.598708948 +0800
  4. @@ -873,6 +873,8 @@
  5.  def_priority="#undef CONFIG_PRIORITY"
  6.  def_pthread_cache="#undef PTHREAD_CACHE"
  7.  shmem=no
  8. +_st2205u=auto
  9. +_dpf=auto
  10.  for ac_option do
  11.    case "$ac_option" in
  12.    --help|-help|-h)
  13. @@ -4341,6 +4343,49 @@
  14.  fi
  15.  echores "$_xv"
  16.  
  17. +echocheck "st2205u"
  18. +if test "$_st2205u" = auto ; then
  19. +  cat > $TMPC <<EOF
  20. +#include <st2205.h>
  21. +int main(void) {
  22. +  (void) st2205_open("");
  23. +  return 0; }
  24. +EOF
  25. +  _st2205u=no
  26. +  cc_check -lst2205 && _st2205u=yes
  27. +fi
  28. +
  29. +if test "$_st2205u" = yes ; then
  30. +  def_xv='#define CONFIG_ST2205U 1'
  31. +  libs_mplayer="$libs_mplayer -lst2205"
  32. +  vomodules="st2205u $vomodules"
  33. +else
  34. +  def_xv='#undef CONFIG_ST2205U'
  35. +  novomodules="st2205u $_novomodules"
  36. +fi
  37. +echores "$_st2205u"
  38. +
  39. +echocheck "dpf"
  40. +if test "$_dpf" = auto ; then
  41. +  cat > $TMPC <<EOF
  42. +#include <dpf.h>
  43. +int main(void) {
  44. +  dpf_open("",NULL);
  45. +  return 0; }
  46. +EOF
  47. +  _dpf=no
  48. +  cc_check -ldpf && _dpf=yes
  49. +fi
  50. +
  51. +if test "$_dpf" = yes ; then
  52. +  def_xv='#define CONFIG_DPF 1'
  53. +  libs_mplayer="$libs_mplayer -ldpf"
  54. +  vomodules="dpf $vomodules"
  55. +else
  56. +  def_xv='#undef CONFIG_DPF'
  57. +  novomodules="dpf $_novomodules"
  58. +fi
  59. +echores "$_dpf"
  60.  
  61.  echocheck "XvMC"
  62.  if test "$_xvmc" != no  && test "$_xv" = yes ; then
  63. @@ -8035,6 +8080,7 @@
  64.  COREAUDIO = $_coreaudio
  65.  COREVIDEO = $_corevideo
  66.  DART = $_dart
  67. +DPF = $_dpf
  68.  DGA = $_dga
  69.  DIRECT3D = $_direct3d
  70.  DIRECTFB = $_directfb
  71. @@ -8123,6 +8169,7 @@
  72.  S3FB = $_s3fb
  73.  SDL = $_sdl
  74.  SPEEX = $_speex
  75. +ST2205U = $_st2205u
  76.  STREAM_CACHE = $_stream_cache
  77.  SGIAUDIO = $_sgiaudio
  78.  SUNAUDIO = $_sunaudio
  79. diff -Nuar -x '*.d' -x '*.xml' -x '*.xsl' mplayer-export-2012-05-05//libvo/video_out.c mplayer-dpf//libvo/video_out.c
  80. --- mplayer-export-2012-05-05//libvo/video_out.c        2012-04-01 05:03:45.000000000 +0800
  81. +++ mplayer-dpf//libvo/video_out.c      2012-05-06 09:50:55.454160335 +0800
  82. @@ -136,7 +136,8 @@
  83.  extern const vo_functions_t video_out_pnm;
  84.  extern const vo_functions_t video_out_md5sum;
  85.  extern const vo_functions_t video_out_mng;
  86. -
  87. +extern const vo_functions_t video_out_st2205u;
  88. +extern const vo_functions_t video_out_dpf;
  89.  /* The following declarations are _not_ const because functions pointers
  90.   * get overloaded during (re)initialization. */
  91.  extern vo_functions_t video_out_cvidix;
  92. @@ -149,6 +150,9 @@
  93.  
  94.  const vo_functions_t* const video_out_drivers[] =
  95.  {
  96. +#ifdef CONFIG_DPF
  97. +       &video_out_dpf,
  98. +#endif
  99.  #ifdef CONFIG_XVR100
  100.          &video_out_xvr100,
  101.  #endif
  102. diff -Nuar -x '*.d' -x '*.xml' -x '*.xsl' mplayer-export-2012-05-05//libvo/vo_dpf.c mplayer-dpf//libvo/vo_dpf.c
  103. --- mplayer-export-2012-05-05//libvo/vo_dpf.c   1970-01-01 07:30:00.000000000 +0730
  104. +++ mplayer-dpf//libvo/vo_dpf.c 2012-05-06 18:25:23.082129967 +0800
  105. @@ -0,0 +1,169 @@
  106. +/*
  107. + * Video driver for dpf_U
  108. + * Copyright 2008 Sprite_tm <picframe@spritesmods.com>
  109. + * For more info, please visit http://spritesmods.com/?art=picframe
  110. + */
  111. +
  112. +#include <stdio.h>
  113. +#include <stdlib.h>
  114. +#include <string.h>
  115. +#include <unistd.h>
  116. +#include <errno.h>
  117. +
  118. +#include <sys/mman.h>
  119. +#include <sys/ioctl.h>
  120. +#include <linux/fb.h>
  121. +
  122. +#include "config.h"
  123. +#include "video_out.h"
  124. +#include "video_out_internal.h"
  125. +#include "fastmemcpy.h"
  126. +#include "sub/sub.h"
  127. +#include "mp_msg.h"
  128. +
  129. +#include <dpf.h>
  130. +
  131. +
  132. +static vo_info_t info = {
  133. +       "ax206 device",
  134. +       "dpf",
  135. +       "ax206term@forum.doozan.com",
  136. +       ""
  137. +};
  138. +
  139. +LIBVO_EXTERN(dpf)
  140. +
  141. +static char *dpf_dev_name = NULL; // such as /dev/sda
  142. +static DPFHANDLE dpf_h; // handle for dpf_dev_name
  143. +static unsigned char *dpf_imagebuff;
  144. +static short rect[4];
  145. +
  146. +static int dpf_preinit(int reset)
  147. +{
  148. +       static int dpf_preinit_done = 0;
  149. +       static int dpf_err = -1;
  150. +       int result;
  151. +
  152. +       if (reset) {
  153. +               dpf_preinit_done = 0;
  154. +               return 0;
  155. +       }
  156. +      
  157. +       if (dpf_preinit_done)
  158. +               return dpf_err;
  159. +              
  160. +       dpf_preinit_done = 1;
  161. +       printf("dpf_: preinit\n");
  162. +       if (!dpf_dev_name)
  163. +               dpf_dev_name = strdup("usb0");
  164. +
  165. +       mp_msg(MSGT_VO, MSGL_V, "[dpf_u] Using device %s\n", dpf_dev_name);
  166. +
  167. +       result=dpf_open(dpf_dev_name,&dpf_h);
  168. +       if (dpf_h==NULL) {
  169. +               mp_msg(MSGT_VO, MSGL_ERR, "[dpf_u] Can't open %s: %s\n", dpf_dev_name, strerror(errno));
  170. +               goto err_out;
  171. +       }
  172. +       dpf_imagebuff=malloc(dpf_h->height*dpf_h->width*2);
  173. +       rect[0]=0;
  174. +       rect[1]=0;
  175. +       rect[2]=dpf_h->width;
  176. +       rect[3]=dpf_h->height;
  177. +       dpf_err = 0;
  178. +       printf("[dpf_u] %s opened successfully.\n", dpf_dev_name);
  179. +       return 0;
  180. +err_out:
  181. +       dpf_err = -1;
  182. +       return -1;
  183. +}
  184. +
  185. +static int preinit(const char *subdevice)
  186. +{
  187. +       if (subdevice)
  188. +       {
  189. +           if (dpf_dev_name) free(dpf_dev_name);
  190. +           dpf_dev_name = strdup(subdevice);
  191. +       }
  192. +       return dpf_preinit(0);
  193. +}
  194. +
  195. +static void draw_osd(void) {
  196. +    return;    
  197. +}
  198. +
  199. +static int config(uint32_t width, uint32_t height, uint32_t d_width,
  200. +               uint32_t d_height, uint32_t flags, char *title,
  201. +               uint32_t format)
  202. +{
  203. +       return 0;
  204. +}
  205. +
  206. +static int query_format(uint32_t format)
  207. +{
  208. +  if (dpf_preinit(0)) return 0;
  209. +  switch(format) {
  210. +  case IMGFMT_BGR16:
  211. +    return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_HWSCALE_UP | VFCAP_HWSCALE_DOWN | VFCAP_ACCEPT_STRIDE;
  212. +    return 0;
  213. +  }
  214. +  return 0;
  215. +}
  216. +
  217. +
  218. +// all csp support stride
  219. +static int draw_frame(uint8_t *src[]) {
  220. +      
  221. +       return 1;
  222. +
  223. +}
  224. +
  225. +static int draw_slice(uint8_t *src[], int stride[], int w, int h, int x, int y)
  226. +{
  227. +       char *imagebuff;
  228. +       uint8_t *in = src[0];
  229. +       uint8_t *dest = dpf_imagebuff + (dpf_h->width * y + x) * 2;
  230. +       int next = dpf_h->width * 2;
  231. +       int i,j;
  232. +
  233. +       //make sure we won't cross the boundaries of dest
  234. +       if (x>319) return 0;
  235. +       if (y>239) return 0;
  236. +       if (w+x>dpf_h->width) w=dpf_h->width-x;
  237. +       if (h+x>dpf_h->height) h=dpf_h->height-x;
  238. +
  239. +       for (i = 0; i < h; i++) {
  240. +               //manually do a memcpy because the bytes
  241. +               //should be flipped first :X
  242. +               for (j=0; j<w; j++) {
  243. +                   dest[j*2]=in[j*2+1];
  244. +                   dest[j*2+1]=in[j*2];
  245. +               }
  246. +               dest += next;
  247. +               in += stride[0];
  248. +       }
  249. +       return 0;
  250. +}
  251. +
  252. +static void check_events(void)
  253. +{
  254. +}
  255. +
  256. +static void flip_page(void)
  257. +{
  258. +    //write dest to device
  259. +    dpf_screen_blit(dpf_h,dpf_imagebuff,rect);
  260. +}
  261. +
  262. +static void uninit(void)
  263. +{
  264. +       dpf_preinit(1); // so that later calls to preinit don't fail
  265. +}
  266. +
  267. +static int control(uint32_t request, void *data)
  268. +{
  269. +  switch (request) {
  270. +  case VOCTRL_QUERY_FORMAT:
  271. +    return query_format(*((uint32_t*)data));
  272. +  }
  273. +  return VO_NOTIMPL;
  274. +}
  275. diff -Nuar -x '*.d' -x '*.xml' -x '*.xsl' mplayer-export-2012-05-05//libvo/vo_st2205u.c mplayer-dpf//libvo/vo_st2205u.c
  276. --- mplayer-export-2012-05-05//libvo/vo_st2205u.c       1970-01-01 07:30:00.000000000 +0730
  277. +++ mplayer-dpf//libvo/vo_st2205u.c     2012-05-05 22:11:14.545322227 +0800
  278. @@ -0,0 +1,158 @@
  279. +/*
  280. + * Video driver for ST2205U
  281. + * Copyright 2008 Sprite_tm <picframe@spritesmods.com>
  282. + * For more info, please visit http://spritesmods.com/?art=picframe
  283. + */
  284. +
  285. +#include <stdio.h>
  286. +#include <stdlib.h>
  287. +#include <string.h>
  288. +#include <unistd.h>
  289. +#include <errno.h>
  290. +
  291. +#include <sys/mman.h>
  292. +#include <sys/ioctl.h>
  293. +#include <linux/fb.h>
  294. +
  295. +#include "config.h"
  296. +#include "video_out.h"
  297. +#include "video_out_internal.h"
  298. +#include "fastmemcpy.h"
  299. +#include "sub/sub.h"
  300. +#include "mp_msg.h"
  301. +
  302. +#include <st2205.h>
  303. +
  304. +
  305. +static vo_info_t info = {
  306. +       "st2205u device",
  307. +       "st2205u",
  308. +       "Jeroen Domburg <picframe@spritesmods.com>",
  309. +       ""
  310. +};
  311. +
  312. +LIBVO_EXTERN(st2205u)
  313. +
  314. +static char *st_dev_name = NULL; // such as /dev/sda
  315. +static st2205_handle *st_h; // handle for st_dev_name
  316. +static char *st_imagebuff;
  317. +
  318. +static int st_preinit(int reset)
  319. +{
  320. +       static int st_preinit_done = 0;
  321. +       static int st_err = -1;
  322. +
  323. +       if (reset) {
  324. +               st_preinit_done = 0;
  325. +               return 0;
  326. +       }
  327. +      
  328. +       if (st_preinit_done)
  329. +               return st_err;
  330. +              
  331. +       st_preinit_done = 1;
  332. +       printf("st2205: preinit\n");
  333. +       if (!st_dev_name)
  334. +               st_dev_name = strdup("/dev/sda");
  335. +
  336. +       mp_msg(MSGT_VO, MSGL_V, "[st2205u] Using device %s\n", st_dev_name);
  337. +
  338. +       st_h=st2205_open(st_dev_name);
  339. +       if (st_h==NULL) {
  340. +               mp_msg(MSGT_VO, MSGL_ERR, "[st2205u] Can't open %s: %s\n", st_dev_name, strerror(errno));
  341. +               goto err_out;
  342. +       }
  343. +       st_imagebuff=malloc(st_h->height*st_h->width*3);
  344. +       st_err = 0;
  345. +       printf("[st2205u] %s opened successfully.\n", st_dev_name);
  346. +       return 0;
  347. +err_out:
  348. +       st_err = -1;
  349. +       return -1;
  350. +}
  351. +
  352. +static int preinit(const char *subdevice)
  353. +{
  354. +       if (subdevice)
  355. +       {
  356. +           if (st_dev_name) free(st_dev_name);
  357. +           st_dev_name = strdup(subdevice);
  358. +       }
  359. +       return st_preinit(0);
  360. +}
  361. +
  362. +static void draw_osd(void) {
  363. +    return;    
  364. +}
  365. +
  366. +static int config(uint32_t width, uint32_t height, uint32_t d_width,
  367. +               uint32_t d_height, uint32_t flags, char *title,
  368. +               uint32_t format)
  369. +{
  370. +       return 0;
  371. +}
  372. +
  373. +static int query_format(uint32_t format)
  374. +{
  375. +       if (st_preinit(0)) return 0;
  376. +       if ((format & IMGFMT_RGB_MASK) == IMGFMT_RGB) {
  377. +               if ((format & 0xff)==24) return VFCAP_CSP_SUPPORTED|VFCAP_CSP_SUPPORTED_BY_HW|VFCAP_ACCEPT_STRIDE;
  378. +       }
  379. +       return 0;
  380. +}
  381. +
  382. +
  383. +// all csp support stride
  384. +static int draw_frame(uint8_t *src[]) { return 1; }
  385. +
  386. +static int draw_slice(uint8_t *src[], int stride[], int w, int h, int x, int y)
  387. +{
  388. +       char *imagebuff;
  389. +       uint8_t *in = src[0];
  390. +       uint8_t *dest = st_imagebuff + (st_h->width * y + x) * 3;
  391. +       int next = st_h->width * 3;
  392. +       int i,j;
  393. +
  394. +       //make sure we won't cross the boundaries of dest
  395. +       if (x>127) return 0;
  396. +       if (y>127) return 0;
  397. +       if (w+x>st_h->width) w=st_h->width-x;
  398. +       if (h+x>st_h->height) h=st_h->height-x;
  399. +
  400. +       for (i = 0; i < h; i++) {
  401. +               //manually do a memcpy because the bytes
  402. +               //should be flipped first :X
  403. +               for (j=0; j<w; j++) {
  404. +                   dest[j*3]=in[j*3];
  405. +                   dest[j*3+1]=in[j*3+1];
  406. +                   dest[j*3+2]=in[j*3+2];
  407. +               }
  408. +               dest += next;
  409. +               in += stride[0];
  410. +       }
  411. +       return 0;
  412. +}
  413. +
  414. +static void check_events(void)
  415. +{
  416. +}
  417. +
  418. +static void flip_page(void)
  419. +{
  420. +    //write dest to device
  421. +    st2205_send_data(st_h,st_imagebuff);
  422. +}
  423. +
  424. +static void uninit(void)
  425. +{
  426. +       st_preinit(1); // so that later calls to preinit don't fail
  427. +}
  428. +
  429. +static int control(uint32_t request, void *data)
  430. +{
  431. +  switch (request) {
  432. +  case VOCTRL_QUERY_FORMAT:
  433. +    return query_format(*((uint32_t*)data));
  434. +  }
  435. +  return VO_NOTIMPL;
  436. +}
  437. diff -Nuar -x '*.d' -x '*.xml' -x '*.xsl' mplayer-export-2012-05-05//Makefile mplayer-dpf//Makefile
  438. --- mplayer-export-2012-05-05//Makefile 2012-04-01 05:03:45.000000000 +0800
  439. +++ mplayer-dpf//Makefile       2012-05-06 09:38:43.926092789 +0800
  440. @@ -509,6 +509,7 @@
  441.  SRCS_MPLAYER-$(DIRECT3D)     += libvo/vo_direct3d.c libvo/w32_common.c
  442.  SRCS_MPLAYER-$(DIRECTFB)     += libvo/vo_directfb2.c libvo/vo_dfbmga.c
  443.  SRCS_MPLAYER-$(DIRECTX)      += libao2/ao_dsound.c libvo/vo_directx.c
  444. +SRCS_MPLAYER-$(DPF)         += libvo/vo_dpf.c
  445.  SRCS_MPLAYER-$(DXR2)         += libao2/ao_dxr2.c libvo/vo_dxr2.c
  446.  SRCS_MPLAYER-$(DXR3)         += libvo/vo_dxr3.c
  447.  SRCS_MPLAYER-$(ESD)          += libao2/ao_esd.c
  448. @@ -592,6 +593,7 @@
  449.  SRCS_MPLAYER-$(S3FB)          += libvo/vo_s3fb.c
  450.  SRCS_MPLAYER-$(SDL)           += libao2/ao_sdl.c libvo/vo_sdl.c libvo/sdl_common.c
  451.  SRCS_MPLAYER-$(SGIAUDIO)      += libao2/ao_sgi.c
  452. +SRCS_MPLAYER-$(ST2205U)       += libvo/vo_st2205u.c
  453.  SRCS_MPLAYER-$(SUNAUDIO)      += libao2/ao_sun.c
  454.  SRCS_MPLAYER-$(SVGA)          += libvo/vo_svga.c
  455.  SRCS_MPLAYER-$(TDFXFB)        += libvo/vo_tdfxfb.c
  456. diff -Nuar -x '*.d' -x '*.xml' -x '*.xsl' mplayer-export-2012-05-05//version.h mplayer-dpf//version.h
  457. --- mplayer-export-2012-05-05//version.h        1970-01-01 07:30:00.000000000 +0730
  458. +++ mplayer-dpf//version.h      2012-05-05 22:20:58.989984779 +0800
  459. @@ -0,0 +1,2 @@
  460. +#define VERSION "SVN-r34885-snapshot-4.4.5"
  461. +#define MP_TITLE "%s "VERSION" (C) 2000-2012 MPlayer Team\n"
clone this paste RAW Paste Data