Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Sep 19th, 2018 85 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/libvisual.h FroyVisuals/jni/libvisual/libvisual.h
  2. --- libvisual.master/libvisual/libvisual/libvisual.h    2012-03-22 16:52:33.558363930 +0800
  3. +++ FroyVisuals/jni/libvisual/libvisual.h   2012-03-02 22:05:29.427672445 +0800
  4. @@ -24,46 +24,46 @@
  5.  #ifndef LV_LIBVISUAL_H
  6.  #define LV_LIBVISUAL_H
  7.  
  8. -#include <libvisual/lvconfig.h>
  9. +#include "lvconfig.h"
  10.  
  11. -#include <libvisual/lv_bits.h>
  12. -#include <libvisual/lv_time.h>
  13. -#include <libvisual/lv_color.h>
  14. -#include <libvisual/lv_param.h>
  15. -#include <libvisual/lv_config.h>
  16. -#include <libvisual/lv_cpu.h>
  17. -#include <libvisual/lv_bin.h>
  18. -#include <libvisual/lv_event.h>
  19. -#include <libvisual/lv_keysym.h>
  20. -#include <libvisual/lv_actor.h>
  21. -#include <libvisual/lv_input.h>
  22. -#include <libvisual/lv_audio.h>
  23. -#include <libvisual/lv_fourier.h>
  24. -#include <libvisual/lv_list.h>
  25. -#include <libvisual/lv_palette.h>
  26. -#include <libvisual/lv_plugin.h>
  27. -#include <libvisual/lv_video.h>
  28. -#include <libvisual/lv_libvisual.h>
  29. -#include <libvisual/lv_songinfo.h>
  30. -#include <libvisual/lv_morph.h>
  31. -#include <libvisual/lv_transform.h>
  32. -#include <libvisual/lv_bmp.h>
  33. -#include <libvisual/lv_log.h>
  34. -#include <libvisual/lv_random.h>
  35. -#include <libvisual/lv_ui.h>
  36. -#include <libvisual/lv_collection.h>
  37. -#include <libvisual/lv_hashmap.h>
  38. -#include <libvisual/lv_cache.h>
  39. -#include <libvisual/lv_ringbuffer.h>
  40. -#include <libvisual/lv_rectangle.h>
  41. -#include <libvisual/lv_error.h>
  42. -#include <libvisual/lv_thread.h>
  43. -#include <libvisual/lv_object.h>
  44. -#include <libvisual/lv_types.h>
  45. -#include <libvisual/lv_utils.h>
  46. -#include <libvisual/lv_gl.h>
  47. -#include <libvisual/lv_math.h>
  48. -#include <libvisual/lv_os.h>
  49. -#include <libvisual/lv_common.h>
  50. +#include "lv_bits.h"
  51. +#include "lv_time.h"
  52. +#include "lv_color.h"
  53. +#include "lv_param.h"
  54. +#include "lv_config.h"
  55. +#include "lv_cpu.h"
  56. +#include "lv_bin.h"
  57. +#include "lv_event.h"
  58. +#include "lv_keysym.h"
  59. +#include "lv_actor.h"
  60. +#include "lv_input.h"
  61. +#include "lv_audio.h"
  62. +#include "lv_fourier.h"
  63. +#include "lv_list.h"
  64. +#include "lv_palette.h"
  65. +#include "lv_plugin.h"
  66. +#include "lv_video.h"
  67. +#include "lv_libvisual.h"
  68. +#include "lv_songinfo.h"
  69. +#include "lv_morph.h"
  70. +#include "lv_transform.h"
  71. +#include "lv_bmp.h"
  72. +#include "lv_log.h"
  73. +#include "lv_random.h"
  74. +#include "lv_ui.h"
  75. +#include "lv_collection.h"
  76. +#include "lv_hashmap.h"
  77. +#include "lv_cache.h"
  78. +#include "lv_ringbuffer.h"
  79. +#include "lv_rectangle.h"
  80. +#include "lv_error.h"
  81. +#include "lv_thread.h"
  82. +#include "lv_object.h"
  83. +#include "lv_types.h"
  84. +#include "lv_utils.h"
  85. +#include "lv_gl.h"
  86. +#include "lv_math.h"
  87. +#include "lv_os.h"
  88. +#include "lv_common.h"
  89.  
  90.  #endif /* LV_LIBVISUAL_H */
  91. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_actor.c FroyVisuals/jni/libvisual/lv_actor.c
  92. --- libvisual.master/libvisual/libvisual/lv_actor.c 2012-03-22 16:52:33.562363930 +0800
  93. +++ FroyVisuals/jni/libvisual/lv_actor.c    2012-03-02 22:05:29.427672445 +0800
  94. @@ -499,6 +499,7 @@
  95.   */
  96.  int visual_actor_video_negotiate (VisActor *actor, int rundepth, int noevent, int forced)
  97.  {
  98. +visual_log(VISUAL_LOG_INFO, "start negotiate");
  99.     int depthflag;
  100.  
  101.     visual_log_return_val_if_fail (actor != NULL, -VISUAL_ERROR_ACTOR_NULL);
  102. @@ -531,11 +532,15 @@
  103.     /* Set up depth transformation enviroment */
  104.     if (visual_video_depth_is_supported (depthflag, actor->video->depth) != TRUE ||
  105.             (forced == TRUE && actor->video->depth != rundepth))
  106. +   {
  107.         /* When the depth is not supported, or if we only switch the depth and not
  108.          * the size */
  109. +visual_log(VISUAL_LOG_INFO, "negotiate video 1");
  110.         return negotiate_video_with_unsupported_depth (actor, rundepth, noevent, forced);
  111. -   else
  112. +   } else {
  113. +visual_log(VISUAL_LOG_INFO, "negotiate video 2");
  114.         return negotiate_video (actor, noevent);
  115. +   }
  116.  
  117.     return -VISUAL_ERROR_IMPOSSIBLE;
  118.  }
  119. @@ -731,7 +736,7 @@
  120.     }
  121.  
  122.     /* Songinfo handling */
  123. -   if (visual_songinfo_compare (&actor->songcompare, &actplugin->songinfo) == FALSE ||
  124. +   if(0) /*FIXME*/if (visual_songinfo_compare (&actor->songcompare, &actplugin->songinfo) == FALSE ||
  125.          actor->songcompare.elapsed != actplugin->songinfo.elapsed) {
  126.         visual_songinfo_mark (&actplugin->songinfo);
  127.  
  128. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_actor.h FroyVisuals/jni/libvisual/lv_actor.h
  129. --- libvisual.master/libvisual/libvisual/lv_actor.h 2012-03-22 16:52:33.562363930 +0800
  130. +++ FroyVisuals/jni/libvisual/lv_actor.h    2012-03-02 22:05:29.427672445 +0800
  131. @@ -24,12 +24,12 @@
  132.  #ifndef _LV_ACTOR_H
  133.  #define _LV_ACTOR_H
  134.  
  135. -#include <libvisual/lv_audio.h>
  136. -#include <libvisual/lv_video.h>
  137. -#include <libvisual/lv_palette.h>
  138. -#include <libvisual/lv_plugin.h>
  139. -#include <libvisual/lv_songinfo.h>
  140. -#include <libvisual/lv_event.h>
  141. +#include "lv_audio.h"
  142. +#include "lv_video.h"
  143. +#include "lv_palette.h"
  144. +#include "lv_plugin.h"
  145. +#include "lv_songinfo.h"
  146. +#include "lv_event.h"
  147.  
  148.  VISUAL_BEGIN_DECLS
  149.  
  150. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_audio.c FroyVisuals/jni/libvisual/lv_audio.c
  151. --- libvisual.master/libvisual/libvisual/lv_audio.c 2012-03-23 07:27:47.249005996 +0800
  152. +++ FroyVisuals/jni/libvisual/lv_audio.c    2012-03-02 22:05:29.427672445 +0800
  153. @@ -40,8 +40,8 @@
  154.  static int audio_samplepool_channel_dtor (VisObject *object);
  155.  static int audio_sample_dtor (VisObject *object);
  156.  
  157. -static int audio_band_total (VisAudio *audio, int begin, int end);
  158. -static int audio_band_energy (VisAudio *audio, int band, int length);
  159. +//static int audio_band_total (VisAudio *audio, int begin, int end);
  160. +//static int audio_band_energy (VisAudio *audio, int band, int length);
  161.  
  162.  /* Format transform functions */
  163.  static int transform_format_buffer_from_float (VisBuffer *dest, VisBuffer *src, int size, int sign);
  164. @@ -116,10 +116,11 @@
  165.  }
  166.  
  167.  
  168. +/*
  169.  static int audio_band_total (VisAudio *audio, int begin, int end)
  170.  {
  171.     int bpmtotal = 0;
  172. -   int i;
  173. +   //int i;
  174.  
  175.  // for (i = begin; i < end; i++)
  176.  //     bpmtotal += audio->freq[2][i];
  177. @@ -129,11 +130,13 @@
  178.     else
  179.         return 0;
  180.  }
  181. +*/
  182.  
  183. +/*
  184.  static int audio_band_energy (VisAudio *audio, int band, int length)
  185.  {
  186.     int energytotal = 0;
  187. -   int i;
  188. +   //int i;
  189.  
  190.  // for (i = 0; i < length; i++)
  191.  //     energytotal += audio->bpmhistory[i][band];
  192. @@ -143,6 +146,7 @@
  193.     else
  194.         return 0;
  195.  }
  196. +*/
  197.  
  198.  /**
  199.   * @defgroup VisAudio VisAudio
  200. @@ -212,11 +216,11 @@
  201.   */
  202.  int visual_audio_analyze (VisAudio *audio)
  203.  {
  204. -        float temp_out[256];
  205. -   float temp_audio[2][512];
  206. +        //float temp_out[256];
  207. +   //float temp_audio[2][512];
  208.     short pcm[3][1024];
  209. -   double scale;
  210. -   int i, j, y;
  211. +   //double scale;
  212. +   //int i, j, y;
  213.  
  214.     visual_log_return_val_if_fail (audio != NULL, -VISUAL_ERROR_AUDIO_NULL);
  215.  
  216. @@ -561,7 +565,7 @@
  217.     int ret;
  218.     float *data;
  219.     int datasize;
  220. -   int i;
  221. +   //int i;
  222.  
  223.     visual_log_return_val_if_fail (audio != NULL, -VISUAL_ERROR_AUDIO_NULL);
  224.     visual_log_return_val_if_fail (buffer != NULL, -VISUAL_ERROR_BUFFER_NULL);
  225. @@ -603,7 +607,7 @@
  226.     int ret;
  227.     float *data;
  228.     int datasize;
  229. -   int i;
  230. +   //int i;
  231.  
  232.     visual_log_return_val_if_fail (buffer != NULL, -VISUAL_ERROR_BUFFER_NULL);
  233.     visual_log_return_val_if_fail (sample != NULL, -VISUAL_ERROR_BUFFER_NULL);
  234. @@ -1564,7 +1568,7 @@
  235.      visual_log_return_val_if_fail(audio != NULL, -VISUAL_ERROR_AUDIO_NULL);
  236.  
  237.      VisBuffer pcm;
  238. -    float buffer[BEAT_MAX_SIZE], *p;
  239. +    float buffer[BEAT_MAX_SIZE];
  240.      unsigned char visdata[BEAT_MAX_SIZE];
  241.      int i;
  242.  
  243. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_audio.h FroyVisuals/jni/libvisual/lv_audio.h
  244. --- libvisual.master/libvisual/libvisual/lv_audio.h 2012-03-22 16:52:33.562363930 +0800
  245. +++ FroyVisuals/jni/libvisual/lv_audio.h    2012-03-02 22:05:29.427672445 +0800
  246. @@ -24,11 +24,11 @@
  247.  #ifndef _LV_AUDIO_H
  248.  #define _LV_AUDIO_H
  249.  
  250. -#include <libvisual/lv_fourier.h>
  251. -#include <libvisual/lv_time.h>
  252. -#include <libvisual/lv_ringbuffer.h>
  253. -#include <libvisual/lv_hashmap.h>
  254. -#include <libvisual/lv_beat.h>
  255. +#include "lv_fourier.h"
  256. +#include "lv_time.h"
  257. +#include "lv_ringbuffer.h"
  258. +#include "lv_hashmap.h"
  259. +#include "lv_beat.h"
  260.  
  261.  VISUAL_BEGIN_DECLS
  262.  
  263. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_beat.c FroyVisuals/jni/libvisual/lv_beat.c
  264. --- libvisual.master/libvisual/libvisual/lv_beat.c  2012-03-22 16:52:33.562363930 +0800
  265. +++ FroyVisuals/jni/libvisual/lv_beat.c 2012-03-02 22:05:29.427672445 +0800
  266. @@ -5,7 +5,7 @@
  267.   * Authors: Scott Sibley <scott@starlon.net>
  268.   * Adapted from Winamp's AVS plugin. See below.
  269.   *
  270. - * $Id$
  271. + * $Id: lv_beat.c 1548 2011-05-25 13:27:05Z starlon $
  272.   *
  273.   * This program is free software; you can redistribute it and/or modify
  274.   * it under the terms of the GNU Lesser General Public License as
  275. @@ -774,7 +774,6 @@
  276.  {
  277.      visual_log_return_val_if_fail(beat != NULL, FALSE);
  278.  
  279. -    int i=0;
  280.      int offI;
  281.      clock_t thisLen;
  282.      int learning = beat_ready_to_learn(beat);
  283. @@ -878,7 +877,6 @@
  284.      double sc=0;
  285.      int mx=0;
  286.      float et;
  287. -    int smSum=0, smN=0;
  288.      
  289.      if (!beat_ready_to_learn(beat))
  290.          return;
  291. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_beat.h FroyVisuals/jni/libvisual/lv_beat.h
  292. --- libvisual.master/libvisual/libvisual/lv_beat.h  2012-03-22 16:52:33.562363930 +0800
  293. +++ FroyVisuals/jni/libvisual/lv_beat.h 2012-03-02 22:05:29.427672445 +0800
  294. @@ -5,7 +5,7 @@
  295.   * Authors: Scott Sibley <scott@starlon.net>
  296.   * Adapted from Winamp's AVS plugin. See below.
  297.   *
  298. - * $Id$
  299. + * $Id: lv_beat.h 1551 2011-05-26 04:45:10Z starlon $
  300.   *
  301.   * This program is free software; you can redistribute it and/or modify
  302.   * it under the terms of the GNU Lesser General Public License as
  303. @@ -54,7 +54,7 @@
  304.  #ifndef _LV_BEAT_H
  305.  #define _LV_BEAT_H
  306.  
  307. -#include <libvisual/lv_time.h>
  308. +#include "lv_time.h"
  309.  
  310.  VISUAL_BEGIN_DECLS
  311.  
  312. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_bin.c FroyVisuals/jni/libvisual/lv_bin.c
  313. --- libvisual.master/libvisual/libvisual/lv_bin.c   2012-03-22 16:52:33.562363930 +0800
  314. +++ FroyVisuals/jni/libvisual/lv_bin.c  2012-03-02 22:05:29.427672445 +0800
  315. @@ -231,11 +231,34 @@
  316.  
  317.  int visual_bin_connect (VisBin *bin, VisActor *actor, VisInput *input)
  318.  {
  319. +    int depthflag;
  320. +    int depth;
  321. +
  322.     visual_log_return_val_if_fail (bin != NULL, -1);
  323. +    visual_log_return_val_if_fail(actor != NULL, -1);
  324. +    visual_log_return_val_if_fail(input != NULL, -1);
  325.  
  326.     visual_bin_set_actor (bin, actor);
  327.     visual_bin_set_input (bin, input);
  328.  
  329. +    depthflag = visual_actor_get_supported_depth(actor);
  330. +
  331. +    if(depthflag == VISUAL_VIDEO_DEPTH_GL)
  332. +        visual_bin_set_depth(bin, VISUAL_VIDEO_DEPTH_GL);
  333. +    else
  334. +    {
  335. +        depth = bin_get_depth_using_preferred(bin, depthflag);
  336. +        
  337. +        if((bin->depthflag & depth) > 0)
  338. +            visual_bin_set_depth(bin, depth);
  339. +        else {
  340. +            visual_bin_set_depth(bin,
  341. +                visual_video_depth_get_highest_nogl(bin->depthflag));
  342. +        }
  343. +    }
  344. +
  345. +   bin->depthforcedmain = bin->depth;
  346. +
  347.     return 0;
  348.  }
  349.  
  350. @@ -279,7 +302,8 @@
  351.     visual_log_return_val_if_fail (input != NULL, -1);
  352.  
  353.     /* Connect */
  354. -   visual_bin_connect (bin, actor, input);
  355. +   visual_bin_set_actor (bin, actor);
  356. +   visual_bin_set_input (bin, input);
  357.  
  358.     bin->managed = TRUE;
  359.     bin->inputmanaged = TRUE;
  360. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_bin.h FroyVisuals/jni/libvisual/lv_bin.h
  361. --- libvisual.master/libvisual/libvisual/lv_bin.h   2012-03-22 16:52:33.562363930 +0800
  362. +++ FroyVisuals/jni/libvisual/lv_bin.h  2012-03-02 22:05:29.427672445 +0800
  363. @@ -24,11 +24,11 @@
  364.  #ifndef _LV_BIN_H
  365.  #define _LV_BIN_H
  366.  
  367. -#include <libvisual/lv_actor.h>
  368. -#include <libvisual/lv_input.h>
  369. -#include <libvisual/lv_morph.h>
  370. -#include <libvisual/lv_video.h>
  371. -#include <libvisual/lv_time.h>
  372. +#include "lv_actor.h"
  373. +#include "lv_input.h"
  374. +#include "lv_morph.h"
  375. +#include "lv_video.h"
  376. +#include "lv_time.h"
  377.  
  378.  VISUAL_BEGIN_DECLS
  379.  
  380. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_bits.h FroyVisuals/jni/libvisual/lv_bits.h
  381. --- libvisual.master/libvisual/libvisual/lv_bits.h  2012-03-22 16:52:33.562363930 +0800
  382. +++ FroyVisuals/jni/libvisual/lv_bits.h 2012-03-02 22:05:29.431672444 +0800
  383. @@ -24,8 +24,8 @@
  384.  #ifndef _LV_ENDIANESS_H
  385.  #define _LV_ENDIANESS_H
  386.  
  387. -#include <libvisual/lvconfig.h>
  388. -#include <libvisual/lv_defines.h>
  389. +#include "lvconfig.h"
  390. +#include "lv_defines.h"
  391.  
  392.  VISUAL_BEGIN_DECLS
  393.  
  394. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_bmp.c FroyVisuals/jni/libvisual/lv_bmp.c
  395. --- libvisual.master/libvisual/libvisual/lv_bmp.c   2012-03-23 03:52:20.013340280 +0800
  396. +++ FroyVisuals/jni/libvisual/lv_bmp.c  2012-03-02 22:05:29.431672444 +0800
  397. @@ -72,7 +72,7 @@
  398.             while (data > (uint8_t *) visual_video_get_pixels (video)) {
  399.                 /* Unpack 4 bpp pixels aka 2 pixels per byte */
  400.                 uint8_t *col = data - video->pitch;
  401. -               uint8_t *end = (uint8_t *) ((intptr_t)data & ~1);
  402. +               uint8_t *end = (uint8_t *) ((int)data & ~1);
  403.                 data = col;
  404.  
  405.                 while (col < end) {
  406. @@ -93,7 +93,7 @@
  407.             while (data > (uint8_t *) visual_video_get_pixels (video)) {
  408.                 /* Unpack 1 bpp pixels aka 8 pixels per byte */
  409.                 uint8_t *col = data - video->pitch;
  410. -               uint8_t *end = (uint8_t *) ((intptr_t)data & ~7);
  411. +               uint8_t *end = (uint8_t *) ((int)data & ~7);
  412.                 data = col;
  413.  
  414.                 while (col < end) {
  415. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_bmp.h FroyVisuals/jni/libvisual/lv_bmp.h
  416. --- libvisual.master/libvisual/libvisual/lv_bmp.h   2012-03-22 16:52:33.562363930 +0800
  417. +++ FroyVisuals/jni/libvisual/lv_bmp.h  2012-03-02 22:05:29.431672444 +0800
  418. @@ -24,7 +24,7 @@
  419.  #ifndef _LV_BMP_H
  420.  #define _LV_BMP_H
  421.  
  422. -#include <libvisual/lv_video.h>
  423. +#include "lv_video.h"
  424.  
  425.  VISUAL_BEGIN_DECLS
  426.  
  427. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_buffer.h FroyVisuals/jni/libvisual/lv_buffer.h
  428. --- libvisual.master/libvisual/libvisual/lv_buffer.h    2012-03-22 16:52:33.566363930 +0800
  429. +++ FroyVisuals/jni/libvisual/lv_buffer.h   2012-03-02 22:05:29.431672444 +0800
  430. @@ -24,7 +24,7 @@
  431.  #ifndef _LV_BUFFER_H
  432.  #define _LV_BUFFER_H
  433.  
  434. -#include <libvisual/lv_common.h>
  435. +#include "lv_common.h"
  436.  
  437.  VISUAL_BEGIN_DECLS
  438.  
  439. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_cache.c FroyVisuals/jni/libvisual/lv_cache.c
  440. --- libvisual.master/libvisual/libvisual/lv_cache.c 2012-03-22 16:52:33.566363930 +0800
  441. +++ FroyVisuals/jni/libvisual/lv_cache.c    2012-03-02 22:05:29.431672444 +0800
  442. @@ -278,7 +278,7 @@
  443.     return centry->data;
  444.  }
  445.  
  446. -static int visual_cache_get_size (VisCache *cache)
  447. +int visual_cache_get_size (VisCache *cache)
  448.  {
  449.     visual_log_return_val_if_fail (cache != NULL, -VISUAL_ERROR_CACHE_NULL);
  450.  
  451. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_cache.h FroyVisuals/jni/libvisual/lv_cache.h
  452. --- libvisual.master/libvisual/libvisual/lv_cache.h 2012-03-22 16:52:33.566363930 +0800
  453. +++ FroyVisuals/jni/libvisual/lv_cache.h    2012-03-02 22:05:29.431672444 +0800
  454. @@ -24,10 +24,10 @@
  455.  #ifndef _LV_CACHE_H
  456.  #define _LV_CACHE_H
  457.  
  458. -#include <libvisual/lv_common.h>
  459. -#include <libvisual/lv_time.h>
  460. -#include <libvisual/lv_list.h>
  461. -#include <libvisual/lv_hashmap.h>
  462. +#include "lv_common.h"
  463. +#include "lv_time.h"
  464. +#include "lv_list.h"
  465. +#include "lv_hashmap.h"
  466.  
  467.  VISUAL_BEGIN_DECLS
  468.  
  469. @@ -82,7 +82,7 @@
  470.  
  471.  void *visual_cache_get (VisCache *cache, char *key);
  472.  
  473. -int visual_cache_size (VisCache *cache);
  474. +int visual_cache_get_size (VisCache *cache);
  475.  
  476.  int visual_cache_set_limits (VisCache *cache, int size, VisTime *maxage);
  477.  
  478. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_collection.c FroyVisuals/jni/libvisual/lv_collection.c
  479. --- libvisual.master/libvisual/libvisual/lv_collection.c    2012-03-22 16:52:33.566363930 +0800
  480. +++ FroyVisuals/jni/libvisual/lv_collection.c   2012-03-02 22:05:29.431672444 +0800
  481. @@ -28,9 +28,9 @@
  482.  #include "lv_common.h"
  483.  #include "lv_collection.h"
  484.  
  485. -static int collection_iter_dtor (VisObject *object);
  486. +int collection_iter_dtor (VisObject *object);
  487.  
  488. -static int collection_iter_dtor (VisObject *object)
  489. +int collection_iter_dtor (VisObject *object)
  490.  {
  491.     VisCollectionIter *iter = VISUAL_COLLECTIONITER (object);
  492.  
  493. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_collection.h FroyVisuals/jni/libvisual/lv_collection.h
  494. --- libvisual.master/libvisual/libvisual/lv_collection.h    2012-03-22 16:52:33.566363930 +0800
  495. +++ FroyVisuals/jni/libvisual/lv_collection.h   2012-03-02 22:05:29.431672444 +0800
  496. @@ -24,7 +24,7 @@
  497.  #ifndef _LV_COLLECTION_H
  498.  #define _LV_COLLECTION_H
  499.  
  500. -#include <libvisual/lv_common.h>
  501. +#include "lv_common.h"
  502.  
  503.  VISUAL_BEGIN_DECLS
  504.  
  505. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_color.c FroyVisuals/jni/libvisual/lv_color.c
  506. --- libvisual.master/libvisual/libvisual/lv_color.c 2012-03-22 16:52:33.566363930 +0800
  507. +++ FroyVisuals/jni/libvisual/lv_color.c    2012-03-02 22:05:29.431672444 +0800
  508. @@ -30,7 +30,7 @@
  509.  #include "lv_color.h"
  510.  
  511.  typedef struct {
  512. -   uint16_t b:5, g:6, r:5, a:6;
  513. +   uint16_t b:5, g:6, r:5;
  514.  } _color16;
  515.  
  516.  
  517. @@ -272,7 +272,6 @@
  518.     color->r = colors->r << 2;
  519.     color->g = colors->g << 3;
  520.     color->b = colors->b << 2;
  521. -   color->a = colors->a << 3;
  522.  
  523.     return VISUAL_OK;
  524.  }
  525. @@ -300,7 +299,6 @@
  526.     colors.r = color->r >> 2;
  527.     colors.g = color->g >> 3;
  528.     colors.b = color->b >> 2;
  529. -    colors.a = color->a >> 3;
  530.  
  531.     return *((uint16_t *) &colors);
  532.  }
  533. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_color.h FroyVisuals/jni/libvisual/lv_color.h
  534. --- libvisual.master/libvisual/libvisual/lv_color.h 2012-03-22 16:52:33.566363930 +0800
  535. +++ FroyVisuals/jni/libvisual/lv_color.h    2012-03-02 22:05:29.431672444 +0800
  536. @@ -24,7 +24,7 @@
  537.  #ifndef _LV_COLOR_H
  538.  #define _LV_COLOR_H
  539.  
  540. -#include <libvisual/lv_common.h>
  541. +#include "lv_common.h"
  542.  
  543.  VISUAL_BEGIN_DECLS
  544.  
  545. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_common.h FroyVisuals/jni/libvisual/lv_common.h
  546. --- libvisual.master/libvisual/libvisual/lv_common.h    2012-03-22 16:52:33.566363930 +0800
  547. +++ FroyVisuals/jni/libvisual/lv_common.h   2012-03-02 22:05:29.431672444 +0800
  548. @@ -24,12 +24,12 @@
  549.  #ifndef _LV_COMMON_H
  550.  #define _LV_COMMON_H
  551.  
  552. -#include <libvisual/lv_defines.h>
  553. +#include "lv_defines.h"
  554.  
  555. -#include <libvisual/lv_mem.h>
  556. -#include <libvisual/lv_log.h>
  557. -#include <libvisual/lv_error.h>
  558. -#include <libvisual/lv_types.h>
  559. -#include <libvisual/lv_object.h>
  560. +#include "lv_mem.h"
  561. +#include "lv_log.h"
  562. +#include "lv_error.h"
  563. +#include "lv_types.h"
  564. +#include "lv_object.h"
  565.  
  566.  #endif /* _LV_COMMON_H */
  567. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_config.h FroyVisuals/jni/libvisual/lv_config.h
  568. --- libvisual.master/libvisual/libvisual/lv_config.h    2012-03-22 16:52:33.566363930 +0800
  569. +++ FroyVisuals/jni/libvisual/lv_config.h   2012-03-02 22:05:29.431672444 +0800
  570. @@ -24,8 +24,8 @@
  571.  #ifndef _LV_CONFIG_H
  572.  #define _LV_CONFIG_H
  573.  
  574. -#include <libvisual/lv_common.h>
  575. -#include <libvisual/lv_list.h>
  576. +#include "lv_common.h"
  577. +#include "lv_list.h"
  578.  
  579.  VISUAL_BEGIN_DECLS
  580.  
  581. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lvconfig.h FroyVisuals/jni/libvisual/lvconfig.h
  582. --- libvisual.master/libvisual/libvisual/lvconfig.h 2012-03-22 17:05:05.670344483 +0800
  583. +++ FroyVisuals/jni/libvisual/lvconfig.h    2012-03-02 22:05:29.455672444 +0800
  584. @@ -23,8 +23,8 @@
  585.  #define VISUAL_BIG_ENDIAN  (0)
  586.  #define VISUAL_LITTLE_ENDIAN   (1)
  587.  
  588. -typedef unsigned long visual_size_t;
  589. -#define VISUAL_SIZE_T_FORMAT   "lu"
  590. +typedef unsigned int visual_size_t;
  591. +#define VISUAL_SIZE_T_FORMAT   "u"
  592.  
  593.  #define VISUAL_OS_LINUX
  594.  
  595. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_cpu.c FroyVisuals/jni/libvisual/lv_cpu.c
  596. --- libvisual.master/libvisual/libvisual/lv_cpu.c   2012-03-23 04:39:57.313266392 +0800
  597. +++ FroyVisuals/jni/libvisual/lv_cpu.c  2012-03-07 07:53:09.766566422 +0800
  598. @@ -57,7 +57,10 @@
  599.  #include <windows.h>
  600.  #endif
  601.  
  602. -#include <config.h>
  603. +#if defined(VISUAL_ARCH_ARM)
  604. +#include <cpu-features.h>
  605. +#endif
  606. +
  607.  #include <stdio.h>
  608.  #include <stdlib.h>
  609.  #include <unistd.h>
  610. @@ -72,8 +75,10 @@
  611.  static VisCPU __lv_cpu_caps;
  612.  static int __lv_cpu_initialized = FALSE;
  613.  
  614. +#if defined(VISUAL_ARCH_X86)
  615.  static int has_cpuid (void);
  616.  static int cpuid (unsigned int ax, unsigned int *p);
  617. +#endif
  618.  
  619.  /* The sigill handlers */
  620.  #if defined(VISUAL_ARCH_X86) //x86 (linux katmai handler check thing)
  621. @@ -183,7 +188,7 @@
  622.   * and RedHat patched 2.2 kernels that have broken exception handling
  623.   * support for user space apps that do SSE.
  624.   */
  625. -static void check_os_katmai_support( void )
  626. +void check_os_katmai_support( void )
  627.  {
  628.  // printf ("omg\n");
  629.  #if defined(VISUAL_ARCH_X86)
  630. @@ -228,6 +233,7 @@
  631.         SetUnhandledExceptionFilter(exc_fil);
  632.     }
  633.  #elif defined(VISUAL_OS_LINUX)
  634. +#if 0 // FIXME This doesn't seem supported on Android x86? _POSIX_SOURCE is not defined.
  635.  // printf ("omg1\n");
  636.  // printf ("omg2\n");
  637.     struct sigaction saved_sigill;
  638. @@ -272,7 +278,7 @@
  639.     */
  640.     sigaction( SIGILL, &saved_sigill, NULL );
  641.     sigaction( SIGFPE, &saved_sigfpe, NULL );
  642. -
  643. +#endif
  644.  #else
  645.  // printf ("hier dan3\n");
  646.     /* We can't use POSIX signal handling to test the availability of
  647. @@ -286,9 +292,9 @@
  648.  }
  649.  
  650.  
  651. -static int has_cpuid (void)
  652. +#if defined(VISUAL_ARCH_X86)
  653. +int has_cpuid (void)
  654.  {
  655. -#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64)
  656.     int a, c;
  657.  
  658.     __asm __volatile
  659. @@ -305,14 +311,12 @@
  660.          : "cc");
  661.  
  662.     return a != c;
  663. -#else
  664. -   return 0;
  665. -#endif
  666.  }
  667. +#endif
  668.  
  669. -static int cpuid (unsigned int ax, unsigned int *p)
  670. +#if defined(VISUAL_ARCH_X86)
  671. +int cpuid (unsigned int ax, unsigned int *p)
  672.  {
  673. -#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64)
  674.     uint32_t flags;
  675.  
  676.     __asm __volatile
  677. @@ -324,10 +328,9 @@
  678.          : "0" (ax));
  679.  
  680.     return VISUAL_OK;
  681. -#else
  682. -   return -VISUAL_ERROR_CPU_INVALID_CODE;
  683. -#endif
  684. +   //return -VISUAL_ERROR_CPU_INVALID_CODE;
  685.  }
  686. +#endif
  687.  
  688.  /**
  689.   * @defgroup VisCPU VisCPU
  690. @@ -362,6 +365,8 @@
  691.     __lv_cpu_caps.type = VISUAL_CPU_TYPE_X86;
  692.  #elif defined(VISUAL_ARCH_POWERPC)
  693.     __lv_cpu_caps.type = VISUAL_CPU_TYPE_POWERPC;
  694. +#elif defined(VISUAL_ARCH_ARM)
  695. +    __lv_cpu_caps.type = VISUAL_CPU_TYPE_ARM;
  696.  #else
  697.     __lv_cpu_caps.type = VISUAL_CPU_TYPE_OTHER;
  698.  #endif
  699. @@ -450,6 +455,22 @@
  700.     check_os_altivec_support ();
  701.  #endif /* VISUAL_ARCH_POWERPC */
  702.  
  703. +#if defined(VISUAL_ARCH_ARM)
  704. +    if(android_getCpuFamily() == ANDROID_CPU_FAMILY_ARM)
  705. +    {
  706. +       uint64_t type = android_getCpuFeatures();
  707. +        if(type & ANDROID_CPU_ARM_FEATURE_ARMv7)
  708. +               __lv_cpu_caps.hasARMv7 = 1;
  709. +        if(type & ANDROID_CPU_ARM_FEATURE_VFPv3)
  710. +                __lv_cpu_caps.hasVFPv3 = 1;
  711. +        if(type & ANDROID_CPU_ARM_FEATURE_NEON)
  712. +                __lv_cpu_caps.hasNeon = 1;
  713. +        if(type & ANDROID_CPU_ARM_FEATURE_LDREX_STREX)
  714. +                __lv_cpu_caps.hasLDREX_STREX = 1;
  715. +       __lv_cpu_caps.nrcpu = android_getCpuCount();
  716. +    }
  717. +#endif
  718. +
  719.     /* Synchronizing enabled flags with has flags */
  720.     __lv_cpu_caps.enabledTSC    = __lv_cpu_caps.hasTSC;
  721.     __lv_cpu_caps.enabledMMX    = __lv_cpu_caps.hasMMX;
  722. @@ -459,6 +480,10 @@
  723.     __lv_cpu_caps.enabled3DNow  = __lv_cpu_caps.has3DNow;
  724.     __lv_cpu_caps.enabled3DNowExt   = __lv_cpu_caps.has3DNowExt;
  725.     __lv_cpu_caps.enabledAltiVec    = __lv_cpu_caps.hasAltiVec;
  726. +    __lv_cpu_caps.enabledARMv7      = __lv_cpu_caps.hasARMv7;
  727. +    __lv_cpu_caps.enabledVFPv3   = __lv_cpu_caps.hasVFPv3;
  728. +    __lv_cpu_caps.enabledNeon    = __lv_cpu_caps.hasNeon;
  729. +    __lv_cpu_caps.enabledLDREX_STREX    = __lv_cpu_caps.hasLDREX_STREX;
  730.    
  731.     visual_log (VISUAL_LOG_DEBUG, "CPU: Number of CPUs: %d", __lv_cpu_caps.nrcpu);
  732.     visual_log (VISUAL_LOG_DEBUG, "CPU: type %d", __lv_cpu_caps.type);
  733. @@ -472,6 +497,10 @@
  734.     visual_log (VISUAL_LOG_DEBUG, "CPU: 3DNow %d", __lv_cpu_caps.has3DNow);
  735.     visual_log (VISUAL_LOG_DEBUG, "CPU: 3DNowExt %d", __lv_cpu_caps.has3DNowExt);
  736.     visual_log (VISUAL_LOG_DEBUG, "CPU: AltiVec %d", __lv_cpu_caps.hasAltiVec);
  737. +   visual_log (VISUAL_LOG_DEBUG, "CPU: ARM v7 %d", __lv_cpu_caps.hasARMv7);
  738. +   visual_log (VISUAL_LOG_DEBUG, "CPU: ARM VFPv3 %d", __lv_cpu_caps.hasVFPv3);
  739. +   visual_log (VISUAL_LOG_DEBUG, "CPU: ARM NEON %d", __lv_cpu_caps.hasNeon);
  740. +   visual_log (VISUAL_LOG_DEBUG, "CPU: ARM LDREX_STREX %d", __lv_cpu_caps.hasLDREX_STREX);
  741.  
  742.     __lv_cpu_initialized = TRUE;
  743.  }
  744. @@ -596,6 +625,58 @@
  745.  }
  746.  
  747.  /**
  748. + * Function to retrieve if the ARM v7 feature is enabled.
  749. + *
  750. + * @return Whether altivec is enabled or not.
  751. + */
  752. +int visual_cpu_get_armv7 ()
  753. +{
  754. +   if (__lv_cpu_initialized == FALSE)
  755. +       visual_log (VISUAL_LOG_CRITICAL, _("The VisCPU system is not initialized."));
  756. +
  757. +   return __lv_cpu_caps.enabledARMv7;
  758. +}
  759. +
  760. +/**
  761. + * Function to retrieve if the ARM VFPv3 feature is enabled.
  762. + *
  763. + * @return Whether altivec is enabled or not.
  764. + */
  765. +int visual_cpu_get_vfpv3 ()
  766. +{
  767. +   if (__lv_cpu_initialized == FALSE)
  768. +       visual_log (VISUAL_LOG_CRITICAL, _("The VisCPU system is not initialized."));
  769. +
  770. +   return __lv_cpu_caps.enabledVFPv3;
  771. +}
  772. +
  773. +/**
  774. + * Function to retrieve if the ARM Neon feature is enabled.
  775. + *
  776. + * @return Whether altivec is enabled or not.
  777. + */
  778. +int visual_cpu_get_neon ()
  779. +{
  780. +   if (__lv_cpu_initialized == FALSE)
  781. +       visual_log (VISUAL_LOG_CRITICAL, _("The VisCPU system is not initialized."));
  782. +
  783. +   return __lv_cpu_caps.enabledNeon;
  784. +}
  785. +
  786. +/**
  787. + * Function to retrieve if the ARM LDREX_STREX feature is enabled.
  788. + *
  789. + * @return Whether altivec is enabled or not.
  790. + */
  791. +int visual_cpu_get_ldrex_strex ()
  792. +{
  793. +   if (__lv_cpu_initialized == FALSE)
  794. +       visual_log (VISUAL_LOG_CRITICAL, _("The VisCPU system is not initialized."));
  795. +
  796. +   return __lv_cpu_caps.enabledLDREX_STREX;
  797. +}
  798. +
  799. +/**
  800.   * Function to set if the tsc feature should be enabled or not, this function will also check
  801.   * if the feature is actually available.
  802.   *
  803. @@ -746,6 +827,82 @@
  804.  
  805.     return VISUAL_OK;
  806.  }
  807. +
  808. +/**
  809. + * Function to set if the ARM VFPv3 (hardware floats) feature should be enabled or not, this function will also check
  810. + * if the feature is actually available.
  811. + *
  812. + * @return VISUAL_OK on succes, -VISUAL_ERROR_CPU_FEATURE_NOT_SUPPORTED on failure.
  813. + */
  814. +int visual_cpu_set_armv7 (int enabled)
  815. +{
  816. +   if (__lv_cpu_initialized == FALSE)
  817. +       visual_log (VISUAL_LOG_CRITICAL, _("The VisCPU system is not initialized."));
  818. +
  819. +   if (__lv_cpu_caps.hasARMv7 == FALSE)
  820. +       return -VISUAL_ERROR_CPU_FEATURE_NOT_SUPPORTED;
  821. +
  822. +   __lv_cpu_caps.enabledARMv7 = enabled;
  823. +
  824. +   return VISUAL_OK;
  825. +}
  826. +
  827. +/**
  828. + * Function to set if the ARM VFPv3 (hardware floats) feature should be enabled or not, this function will also check
  829. + * if the feature is actually available.
  830. + *
  831. + * @return VISUAL_OK on succes, -VISUAL_ERROR_CPU_FEATURE_NOT_SUPPORTED on failure.
  832. + */
  833. +int visual_cpu_set_vfpv3 (int enabled)
  834. +{
  835. +   if (__lv_cpu_initialized == FALSE)
  836. +       visual_log (VISUAL_LOG_CRITICAL, _("The VisCPU system is not initialized."));
  837. +
  838. +   if (__lv_cpu_caps.hasVFPv3 == FALSE)
  839. +       return -VISUAL_ERROR_CPU_FEATURE_NOT_SUPPORTED;
  840. +
  841. +   __lv_cpu_caps.enabledVFPv3 = enabled;
  842. +
  843. +   return VISUAL_OK;
  844. +}
  845. +
  846. +/**
  847. + * Function to set if the ARM Neon feature should be enabled or not, this function will also check
  848. + * if the feature is actually available.
  849. + *
  850. + * @return VISUAL_OK on succes, -VISUAL_ERROR_CPU_FEATURE_NOT_SUPPORTED on failure.
  851. + */
  852. +int visual_cpu_set_neon (int enabled)
  853. +{
  854. +   if (__lv_cpu_initialized == FALSE)
  855. +       visual_log (VISUAL_LOG_CRITICAL, _("The VisCPU system is not initialized."));
  856. +
  857. +   if (__lv_cpu_caps.hasNeon == FALSE)
  858. +       return -VISUAL_ERROR_CPU_FEATURE_NOT_SUPPORTED;
  859. +
  860. +   __lv_cpu_caps.enabledNeon = enabled;
  861. +
  862. +   return VISUAL_OK;
  863. +}
  864. +
  865. +/**
  866. + * Function to set if the ARM Neon feature should be enabled or not, this function will also check
  867. + * if the feature is actually available.
  868. + *
  869. + * @return VISUAL_OK on succes, -VISUAL_ERROR_CPU_FEATURE_NOT_SUPPORTED on failure.
  870. + */
  871. +int visual_cpu_set_ldrex_strex (int enabled)
  872. +{
  873. +   if (__lv_cpu_initialized == FALSE)
  874. +       visual_log (VISUAL_LOG_CRITICAL, _("The VisCPU system is not initialized."));
  875. +
  876. +   if (__lv_cpu_caps.hasLDREX_STREX == FALSE)
  877. +       return -VISUAL_ERROR_CPU_FEATURE_NOT_SUPPORTED;
  878. +
  879. +   __lv_cpu_caps.enabledLDREX_STREX = enabled;
  880. +
  881. +   return VISUAL_OK;
  882. +}
  883.  
  884.  /**
  885.   * @}
  886. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_cpu.h FroyVisuals/jni/libvisual/lv_cpu.h
  887. --- libvisual.master/libvisual/libvisual/lv_cpu.h   2012-03-22 16:52:33.566363930 +0800
  888. +++ FroyVisuals/jni/libvisual/lv_cpu.h  2012-03-02 22:05:29.431672444 +0800
  889. @@ -25,8 +25,8 @@
  890.  #ifndef _LV_CPU_H
  891.  #define _LV_CPU_H
  892.  
  893. -#include <libvisual/lvconfig.h>
  894. -#include <libvisual/lv_common.h>
  895. +#include "lvconfig.h"
  896. +#include "lv_common.h"
  897.  
  898.  VISUAL_BEGIN_DECLS;
  899.  
  900. @@ -39,6 +39,7 @@
  901.     VISUAL_CPU_TYPE_SPARC,      /**< Running on the sparc architecture. */
  902.     VISUAL_CPU_TYPE_X86,        /**< Running on the X86 architecture. */
  903.     VISUAL_CPU_TYPE_POWERPC,    /**< Running on the PowerPC architecture. */
  904. +    VISUAL_CPU_TYPE_ARM,        /**< Running on the ARM architecture. */
  905.     VISUAL_CPU_TYPE_OTHER       /**< Running on an architecture that is not specified. */
  906.  } VisCPUType;
  907.  
  908. @@ -66,6 +67,10 @@
  909.     int     has3DNow;       /**< The CPU has the 3dnow feature. */
  910.     int     has3DNowExt;        /**< The CPU has the 3dnowext feature. */
  911.     int     hasAltiVec;     /**< The CPU has the altivec feature. */   
  912. +    int     hasARMv7;       /**<The CPU has the ARM v7 feature. */
  913. +    int     hasVFPv3;       /**<The CPU has the ARM VFPv3 feature. */
  914. +    int     hasNeon;        /**<The CPU has the ARM Neon feature. */
  915. +    int     hasLDREX_STREX; /**<The CPU has ARM LDREX_STREX feature. */
  916.  
  917.     int     enabledTSC;     /**< The tsc feature is enabled. */
  918.     int     enabledMMX;     /**< The mmx feature is enabled. */
  919. @@ -75,6 +80,10 @@
  920.     int     enabled3DNow;       /**< The 3dnow feature is enabled. */
  921.     int     enabled3DNowExt;    /**< The 3dnowext feature is enabled. */
  922.     int     enabledAltiVec;     /**< The altivec feature is enabled. */  
  923. +    int     enabledVFPv3;         /**< The ARM hardware floats feature is enabled. */
  924. +    int     enabledARMv7;       /**< The ARM v7 feature is enabled. */
  925. +    int     enabledNeon;        /**< The ARM Neon feature is enabled. */
  926. +    int     enabledLDREX_STREX; /**< The ARM LDREX_STREX feature is enabled. */
  927.  };
  928.  
  929.  void visual_cpu_initialize (void);
  930. @@ -88,6 +97,10 @@
  931.  int visual_cpu_get_3dnow (void);
  932.  int visual_cpu_get_3dnow2 (void);
  933.  int visual_cpu_get_altivec (void);
  934. +int visual_cpu_get_armv7 (void);
  935. +int visual_cpu_get_vfpv3 (void);
  936. +int visual_cpu_get_neon (void);
  937. +int visual_cpu_get_ldrex_strex (void);
  938.  
  939.  int visual_cpu_set_tsc (int enabled);
  940.  int visual_cpu_set_mmx (int enabled);
  941. @@ -97,6 +110,10 @@
  942.  int visual_cpu_set_3dnow (int enabled);
  943.  int visual_cpu_set_3dnow2 (int enabled);
  944.  int visual_cpu_set_altivec (int enabled);
  945. +int visual_cpu_set_armv7 (int enabled);
  946. +int visual_cpu_set_vfpv3 (int enabled);
  947. +int visual_cpu_set_neon (int enabled);
  948. +int visual_cpu_set_ldrex_strex (int enabled);
  949.  
  950.  VISUAL_END_DECLS
  951.  
  952. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_defines.h FroyVisuals/jni/libvisual/lv_defines.h
  953. --- libvisual.master/libvisual/libvisual/lv_defines.h   2012-03-22 16:52:33.566363930 +0800
  954. +++ FroyVisuals/jni/libvisual/lv_defines.h  2012-03-02 22:05:29.435672445 +0800
  955. @@ -65,13 +65,13 @@
  956.  #if __GNUC__ >= 3
  957.  # define inline            inline __attribute__ ((always_inline))
  958.  # define __malloc      __attribute__ ((malloc))
  959. -# define __packed      __attribute__ ((packed))
  960. +//# define __packedd       __attribute__ ((packed))
  961.  # define VIS_LIKELY(x)     __builtin_expect (!!(x), 1)
  962.  # define VIS_UNLIKELY(x)   __builtin_expect (!!(x), 0)
  963.  #else
  964.  # define inline            /* no inline */
  965.  # define __malloc      /* no malloc */
  966. -# define __packed      /* no packed */
  967. +//# define __packedd       /* no packed */
  968.  # define VIS_LIKELY(x)     (x)
  969.  # define VIS_UNLIKELY(x)   (x)
  970.  #endif
  971. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_error.h FroyVisuals/jni/libvisual/lv_error.h
  972. --- libvisual.master/libvisual/libvisual/lv_error.h 2012-03-22 16:52:33.566363930 +0800
  973. +++ FroyVisuals/jni/libvisual/lv_error.h    2012-03-02 22:05:29.435672445 +0800
  974. @@ -24,7 +24,7 @@
  975.  #ifndef _LV_ERROR_H
  976.  #define _LV_ERROR_H
  977.  
  978. -#include <libvisual/lv_defines.h>
  979. +#include "lv_defines.h"
  980.  
  981.  VISUAL_BEGIN_DECLS
  982.  
  983. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_event.h FroyVisuals/jni/libvisual/lv_event.h
  984. --- libvisual.master/libvisual/libvisual/lv_event.h 2012-03-22 16:52:33.566363930 +0800
  985. +++ FroyVisuals/jni/libvisual/lv_event.h    2012-03-02 22:05:29.435672445 +0800
  986. @@ -1,10 +1,10 @@
  987.  #ifndef _LV_EVENT_H
  988.  #define _LV_EVENT_H
  989.  
  990. -#include <libvisual/lv_songinfo.h>
  991. -#include <libvisual/lv_video.h>
  992. -#include <libvisual/lv_list.h>
  993. -#include <libvisual/lv_keysym.h>
  994. +#include "lv_songinfo.h"
  995. +#include "lv_video.h"
  996. +#include "lv_list.h"
  997. +#include "lv_keysym.h"
  998.  
  999.  VISUAL_BEGIN_DECLS
  1000.  
  1001. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_fourier.c FroyVisuals/jni/libvisual/lv_fourier.c
  1002. --- libvisual.master/libvisual/libvisual/lv_fourier.c   2012-03-23 03:50:31.061343097 +0800
  1003. +++ FroyVisuals/jni/libvisual/lv_fourier.c  2012-03-02 22:05:29.435672445 +0800
  1004. @@ -37,6 +37,7 @@
  1005.  #include "lv_utils.h"
  1006.  #include "lv_math.h"
  1007.  #include "lv_fourier.h"
  1008. +#include "kiss_fft129/kiss_fft.h"
  1009.  
  1010.  /* Log scale settings */
  1011.  #define AMP_LOG_SCALE_THRESHOLD0   0.001f
  1012. @@ -474,22 +475,53 @@
  1013.   *
  1014.   * @return VISUAL_OK on succes, -VISUAL_ERROR_FOURIER_NULL or -VISUAL_ERROR_NULL on failure.
  1015.   */
  1016. +#define NUMFFTS 128
  1017. +
  1018.  int visual_dft_perform (VisDFT *dft, float *output, float *input)
  1019.  {
  1020. -   unsigned int i;
  1021. -
  1022.     visual_log_return_val_if_fail (dft != NULL, -VISUAL_ERROR_FOURIER_NULL);
  1023.     visual_log_return_val_if_fail (output != NULL, -VISUAL_ERROR_NULL);
  1024.     visual_log_return_val_if_fail (input != NULL, -VISUAL_ERROR_NULL);
  1025.  
  1026. +    int nfft=kiss_fft_next_fast_size(dft->spectrum_size);
  1027. +    int nbytes = sizeof(kiss_fft_cpx) * nfft;
  1028. +    int isinverse = FALSE, i;
  1029. +    kiss_fft_cpx *buf = (kiss_fft_cpx*)KISS_FFT_MALLOC(nbytes);
  1030. +    kiss_fft_cpx *bufout=(kiss_fft_cpx*)KISS_FFT_MALLOC(nbytes);
  1031. +    kiss_fft_cfg state = kiss_fft_alloc(nfft, isinverse, 0, 0);
  1032. +
  1033.     if (dft->brute_force)
  1034.         perform_dft_brute_force (dft, output, input);
  1035.     else
  1036.         perform_fft_radix2_dit (dft, output, input);
  1037.  
  1038. +/*
  1039. +    memset(buf, 0, nbytes);
  1040. +
  1041. +
  1042. +    for(i=0; i < nfft; ++i)
  1043. +    {
  1044. +        buf[i].r = input[i>>1];
  1045. +        buf[i].i = input[(i+nfft)>>1];
  1046. +    }
  1047. +
  1048. +    for(i = 0; i < NUMFFTS; i++)
  1049. +        kiss_fft(state, buf, bufout);
  1050. +
  1051. +    for(i = 0; i < nfft; i++)
  1052. +    {
  1053. +        dft->real[i] = bufout[i].r;
  1054. +        dft->imag[i] = bufout[i].i;
  1055. +    }
  1056. +*/
  1057. +
  1058.     visual_math_vectorized_complex_to_norm_scale (output, dft->real, dft->imag,
  1059. -           dft->spectrum_size / 2,
  1060. -           1.0 / dft->spectrum_size);
  1061. +           dft->spectrum_size / 2, 1.0 / dft->spectrum_size);
  1062. +
  1063. +    free(state);
  1064. +    free(buf);
  1065. +    free(bufout);
  1066. +    kiss_fft_cleanup();
  1067.  
  1068.     return VISUAL_OK;
  1069.  }
  1070. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_fourier.h FroyVisuals/jni/libvisual/lv_fourier.h
  1071. --- libvisual.master/libvisual/libvisual/lv_fourier.h   2012-03-22 16:52:33.570363930 +0800
  1072. +++ FroyVisuals/jni/libvisual/lv_fourier.h  2012-03-02 22:05:29.435672445 +0800
  1073. @@ -25,7 +25,7 @@
  1074.  #ifndef _LV_FOURIER_H
  1075.  #define _LV_FOURIER_H
  1076.  
  1077. -#include <libvisual/lv_common.h>
  1078. +#include "lv_common.h"
  1079.  
  1080.  VISUAL_BEGIN_DECLS
  1081.  
  1082. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_gl.h FroyVisuals/jni/libvisual/lv_gl.h
  1083. --- libvisual.master/libvisual/libvisual/lv_gl.h    2012-03-22 16:52:33.570363930 +0800
  1084. +++ FroyVisuals/jni/libvisual/lv_gl.h   2012-03-02 22:05:29.435672445 +0800
  1085. @@ -24,8 +24,8 @@
  1086.  #ifndef _LV_GL_H
  1087.  #define _LV_GL_H
  1088.  
  1089. -#include <libvisual/lv_common.h>
  1090. -#include <libvisual/lv_hashmap.h>
  1091. +#include "lv_common.h"
  1092. +#include "lv_hashmap.h"
  1093.  
  1094.  VISUAL_BEGIN_DECLS
  1095.  
  1096. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_hashlist.h FroyVisuals/jni/libvisual/lv_hashlist.h
  1097. --- libvisual.master/libvisual/libvisual/lv_hashlist.h  2012-03-23 04:21:43.857294668 +0800
  1098. +++ FroyVisuals/jni/libvisual/lv_hashlist.h 2012-03-02 22:05:29.435672445 +0800
  1099. @@ -24,10 +24,10 @@
  1100.  #ifndef _LV_HASHLIST_H
  1101.  #define _LV_HASHLIST_H
  1102.  
  1103. -#include <libvisual/lv_common.h>
  1104. -#include <libvisual/lv_time.h>
  1105. -#include <libvisual/lv_list.h>
  1106. -#include <libvisual/lv_hashmap.h>
  1107. +#include "lv_common.h"
  1108. +#include "lv_time.h"
  1109. +#include "lv_list.h"
  1110. +#include "lv_hashmap.h"
  1111.  
  1112.  VISUAL_BEGIN_DECLS
  1113.  
  1114. @@ -69,10 +69,9 @@
  1115.  
  1116.  void *visual_hashlist_get (VisHashlist *hashlist, char *key);
  1117.  
  1118. -int visual_hashlist_size (VisHashlist *hashlist);
  1119. +int visual_hashlist_get_size (VisHashlist *hashlist);
  1120.  
  1121.  int visual_hashlist_set_size (VisHashlist *hashlist, int size);
  1122. -int visual_hashlist_get_size (VisHashlist *hashlist);
  1123.  
  1124.  VisList *visual_hashlist_get_list (VisHashlist *hashlist);
  1125.  
  1126. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_hashmap.c FroyVisuals/jni/libvisual/lv_hashmap.c
  1127. --- libvisual.master/libvisual/libvisual/lv_hashmap.c   2012-03-22 16:52:33.570363930 +0800
  1128. +++ FroyVisuals/jni/libvisual/lv_hashmap.c  2012-03-02 22:05:29.435672445 +0800
  1129. @@ -64,9 +64,9 @@
  1130.  
  1131.  static int hashmap_destroy (VisCollection *collection)
  1132.  {
  1133. -   VisCollectionDestroyerFunc destroyer;
  1134. +   //VisCollectionDestroyerFunc destroyer;
  1135.     VisHashmap *hashmap = VISUAL_HASHMAP (collection);
  1136. -   VisHashmapEntry *mentry;
  1137. +   //VisHashmapEntry *mentry;
  1138.     int i;
  1139.  
  1140.     for (i = 0; i < hashmap->size; i++)
  1141. @@ -126,7 +126,7 @@
  1142.  {
  1143.     VisCollectionIter *iter;
  1144.     HashmapIterContext *context;
  1145. -   VisHashmap *hashmap = VISUAL_HASHMAP (collection);
  1146. +   //VisHashmap *hashmap = VISUAL_HASHMAP (collection);
  1147.  
  1148.     context = visual_mem_new0 (HashmapIterContext, 1);
  1149.  
  1150. @@ -201,7 +201,7 @@
  1151.  
  1152.  static void hashmap_iter_next (VisCollectionIter *iter, VisCollection *collection, VisObject *itercontext)
  1153.  {
  1154. -   VisHashmap *hashmap = VISUAL_HASHMAP (collection);
  1155. +   //VisHashmap *hashmap = VISUAL_HASHMAP (collection);
  1156.     HashmapIterContext *context = HASHMAP_ITERCONTEXT (itercontext);
  1157.  
  1158.     if (context->retrieved == FALSE) {
  1159. @@ -503,7 +503,7 @@
  1160.  
  1161.  int visual_hashmap_set_table_size (VisHashmap *hashmap, int tablesize)
  1162.  {
  1163. -   int oldsize;
  1164. +   //int oldsize;
  1165.  
  1166.     visual_log_return_val_if_fail (hashmap != NULL, -VISUAL_ERROR_HASHMAP_NULL);
  1167.  
  1168. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_hashmap.h FroyVisuals/jni/libvisual/lv_hashmap.h
  1169. --- libvisual.master/libvisual/libvisual/lv_hashmap.h   2012-03-22 16:52:33.570363930 +0800
  1170. +++ FroyVisuals/jni/libvisual/lv_hashmap.h  2012-03-02 22:05:29.435672445 +0800
  1171. @@ -24,9 +24,9 @@
  1172.  #ifndef _LV_HASHMAP_H
  1173.  #define _LV_HASHMAP_H
  1174.  
  1175. -#include <libvisual/lv_common.h>
  1176. -#include <libvisual/lv_list.h>
  1177. -#include <libvisual/lv_collection.h>
  1178. +#include "lv_common.h"
  1179. +#include "lv_list.h"
  1180. +#include "lv_collection.h"
  1181.  
  1182.  VISUAL_BEGIN_DECLS
  1183.  
  1184. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_input.h FroyVisuals/jni/libvisual/lv_input.h
  1185. --- libvisual.master/libvisual/libvisual/lv_input.h 2012-03-22 16:52:33.570363930 +0800
  1186. +++ FroyVisuals/jni/libvisual/lv_input.h    2012-03-02 22:05:29.435672445 +0800
  1187. @@ -24,9 +24,9 @@
  1188.  #ifndef _LV_INPUT_H
  1189.  #define _LV_INPUT_H
  1190.  
  1191. -#include <libvisual/lv_audio.h>
  1192. -#include <libvisual/lv_plugin.h>
  1193. -#include <libvisual/lv_common.h>
  1194. +#include "lv_audio.h"
  1195. +#include "lv_plugin.h"
  1196. +#include "lv_common.h"
  1197.  
  1198.  VISUAL_BEGIN_DECLS
  1199.  
  1200. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_libvisual.c FroyVisuals/jni/libvisual/lv_libvisual.c
  1201. --- libvisual.master/libvisual/libvisual/lv_libvisual.c 2012-03-22 16:52:33.570363930 +0800
  1202. +++ FroyVisuals/jni/libvisual/lv_libvisual.c    2012-03-09 04:54:40.758374963 +0800
  1203. @@ -41,6 +41,7 @@
  1204.  #include "lv_thread.h"
  1205.  #include "lv_cpu.h"
  1206.  #include "config.h"
  1207. +#include "prof.h"
  1208.  
  1209.  
  1210.  /** Set when libvisual is initialized. */
  1211. @@ -279,6 +280,13 @@
  1212.     char *homedir = NULL;
  1213.     int ret = 0;
  1214.  
  1215. +    /* FIXME Start profiling */
  1216. +    /* Change to 500 interrupts per second */
  1217. +#ifdef VISUAL_HAVE_PROFILING
  1218. +    setenv("CPUPROFILE_FREQUENCY", "500", 1);
  1219. +    monstartup("libvisual.so");
  1220. +#endif
  1221. +
  1222.  #if ENABLE_NLS
  1223.     bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
  1224.     bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
  1225. @@ -326,16 +334,16 @@
  1226.     visual_fourier_initialize ();
  1227.  
  1228.     /* Add the standard plugin paths */
  1229. -   ret = visual_init_path_add (PLUGPATH"/actor");
  1230. +   ret = visual_init_path_add ("plugins/actor");
  1231.     visual_log_return_val_if_fail (ret == VISUAL_OK, ret);
  1232.  
  1233. -   ret = visual_init_path_add (PLUGPATH"/input");
  1234. +   ret = visual_init_path_add ("plugins/input");
  1235.     visual_log_return_val_if_fail (ret == VISUAL_OK, ret);
  1236.  
  1237. -   ret = visual_init_path_add (PLUGPATH"/morph");
  1238. +   ret = visual_init_path_add ("plugins/morph");
  1239.     visual_log_return_val_if_fail (ret == VISUAL_OK, ret);
  1240.  
  1241. -   ret = visual_init_path_add (PLUGPATH"/transform");
  1242. +   ret = visual_init_path_add ("plugins/transform");
  1243.     visual_log_return_val_if_fail (ret == VISUAL_OK, ret);
  1244.  
  1245.  #if !defined(VISUAL_OS_WIN32)
  1246. @@ -450,6 +458,11 @@
  1247.     }
  1248.  
  1249.     __lv_initialized = FALSE;
  1250. +
  1251. +#ifdef VISUAL_HAVE_PROFILING
  1252. +    moncleanup(); //FIXME End profilng
  1253. +#endif
  1254. +
  1255.     return VISUAL_OK;
  1256.  }
  1257.  
  1258. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_list.h FroyVisuals/jni/libvisual/lv_list.h
  1259. --- libvisual.master/libvisual/libvisual/lv_list.h  2012-03-22 16:52:33.570363930 +0800
  1260. +++ FroyVisuals/jni/libvisual/lv_list.h 2012-03-02 22:05:29.439672446 +0800
  1261. @@ -32,8 +32,8 @@
  1262.  #ifndef _LV_LIST_H
  1263.  #define _LV_LIST_H
  1264.  
  1265. -#include <libvisual/lv_common.h>
  1266. -#include <libvisual/lv_collection.h>
  1267. +#include "lv_common.h"
  1268. +#include "lv_collection.h"
  1269.  
  1270.  #if defined(__FreeBSD__) || defined(__OpenBSD__)
  1271.  #include <sys/queue.h>
  1272. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_log.h FroyVisuals/jni/libvisual/lv_log.h
  1273. --- libvisual.master/libvisual/libvisual/lv_log.h   2012-03-22 18:40:50.970195916 +0800
  1274. +++ FroyVisuals/jni/libvisual/lv_log.h  2012-03-02 22:05:29.439672446 +0800
  1275. @@ -31,7 +31,6 @@
  1276.  
  1277.  #include <libvisual/lv_defines.h>
  1278.  #include <libvisual/lvconfig.h>
  1279. -#include <libvisual/lv_error.h>
  1280.  
  1281.  VISUAL_BEGIN_DECLS
  1282.  
  1283. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_math.c FroyVisuals/jni/libvisual/lv_math.c
  1284. --- libvisual.master/libvisual/libvisual/lv_math.c  2012-03-23 04:13:32.541307371 +0800
  1285. +++ FroyVisuals/jni/libvisual/lv_math.c 2012-03-02 22:05:29.439672446 +0800
  1286. @@ -30,6 +30,7 @@
  1287.  
  1288.  #include "lv_bits.h"
  1289.  #include "lv_math.h"
  1290. +#include "lv_cpu.h"
  1291.  
  1292.  /* This file is getting big and bloated because of the large chunks of simd code. When all is in place we'll take a serious
  1293.   * look how we can reduce this. For example by using macros for common blocks. */
  1294. @@ -62,8 +63,6 @@
  1295.     visual_log_return_val_if_fail (dest != NULL, -VISUAL_ERROR_NULL);
  1296.     visual_log_return_val_if_fail (src != NULL, -VISUAL_ERROR_NULL);
  1297.  
  1298. -#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64)
  1299. -
  1300.     /* FIXME check what is faster on AMD (sse or 3dnow) */
  1301.     if (visual_cpu_get_sse () && n >= 16) {
  1302.         float packed_multiplier[4];
  1303. @@ -73,6 +72,7 @@
  1304.         packed_multiplier[2] = multiplier;
  1305.         packed_multiplier[3] = multiplier;
  1306.  
  1307. +#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64)
  1308.         while (!VISUAL_ALIGNED(d, 16)) {
  1309.             (*d) = (*s) * multiplier;
  1310.  
  1311. @@ -86,6 +86,7 @@
  1312.             ("\n\t movups (%0), %%xmm7"
  1313.              :: "r" (packed_multiplier) : "memory");
  1314.  
  1315. +
  1316.         while (n > 16) {
  1317.             __asm __volatile
  1318.                 ("\n\t prefetchnta 256(%0)"
  1319. @@ -108,12 +109,14 @@
  1320.  
  1321.             n -= 16;
  1322.         }
  1323. +#endif /* VISUAL_ARCH_X86 */
  1324.     } else if (visual_cpu_get_3dnow ()) {
  1325.         float packed_multiplier[2];
  1326.  
  1327.         packed_multiplier[0] = multiplier;
  1328.         packed_multiplier[1] = multiplier;
  1329.  
  1330. +#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64)
  1331.         __asm __volatile
  1332.             ("\n\t movq %[multiplier], %%mm0"
  1333.              :: [multiplier] "m" (*packed_multiplier));
  1334. @@ -152,9 +155,9 @@
  1335.  
  1336.         __asm __volatile
  1337.             ("\n\t emms");
  1338. -   }
  1339. +#endif /* VISUAL_ARCH_X86 */
  1340.  
  1341. -#endif /* VISUAL_ARCH_X86 || VISUAL_ARCH_X86_64 */
  1342. +   }
  1343.  
  1344.     while (n--) {
  1345.         (*d) = (*s) * multiplier;
  1346. @@ -185,8 +188,6 @@
  1347.     visual_log_return_val_if_fail (dest != NULL, -VISUAL_ERROR_NULL);
  1348.     visual_log_return_val_if_fail (src != NULL, -VISUAL_ERROR_NULL);
  1349.  
  1350. -#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64)
  1351. -
  1352.     if (visual_cpu_get_sse () && n >= 16) {
  1353.         float packed_adder[4];
  1354.  
  1355. @@ -195,6 +196,7 @@
  1356.         packed_adder[2] = adder;
  1357.         packed_adder[3] = adder;
  1358.  
  1359. +#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64)
  1360.         while (!VISUAL_ALIGNED(d, 16)) {
  1361.             (*d) = (*s) + adder;
  1362.  
  1363. @@ -231,12 +233,14 @@
  1364.  
  1365.             n -= 16;
  1366.         }
  1367. +#endif /* VISUAL_ARCH_X86 */
  1368.     } else if (visual_cpu_get_3dnow ()) {
  1369.         float packed_adder[2];
  1370.  
  1371.         packed_adder[0] = adder;
  1372.         packed_adder[1] = adder;
  1373.  
  1374. +#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64)
  1375.         __asm __volatile
  1376.             ("\n\t movq %[adder], %%mm0"
  1377.              :: [adder] "m" (*packed_adder));
  1378. @@ -275,9 +279,9 @@
  1379.  
  1380.         __asm __volatile
  1381.             ("\n\t emms");
  1382. -   }
  1383. +#endif /* VISUAL_ARCH_X86 */
  1384.  
  1385. -#endif /* VISUAL_ARCH_X86 || VISUAL_ARCH_X86_64 */
  1386. +   }
  1387.  
  1388.     while (n--) {
  1389.         (*d) = (*s) + adder;
  1390. @@ -308,7 +312,6 @@
  1391.     visual_log_return_val_if_fail (dest != NULL, -VISUAL_ERROR_NULL);
  1392.     visual_log_return_val_if_fail (src != NULL, -VISUAL_ERROR_NULL);
  1393.  
  1394. -#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64)
  1395.     if (visual_cpu_get_sse () && n >= 16) {
  1396.         float packed_substracter[4];
  1397.  
  1398. @@ -317,6 +320,7 @@
  1399.         packed_substracter[2] = substracter;
  1400.         packed_substracter[3] = substracter;
  1401.  
  1402. +#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64)
  1403.         while (!VISUAL_ALIGNED(d, 16)) {
  1404.             (*d) = (*s) - substracter;
  1405.  
  1406. @@ -353,12 +357,14 @@
  1407.  
  1408.             n -= 16;
  1409.         }
  1410. +#endif /* VISUAL_ARCH_X86 */
  1411.     } else if (visual_cpu_get_3dnow ()) {
  1412.         float packed_substracter[2];
  1413.  
  1414.         packed_substracter[0] = substracter;
  1415.         packed_substracter[1] = substracter;
  1416.  
  1417. +#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64)
  1418.         __asm __volatile
  1419.             ("\n\t movq %[substracter], %%mm0"
  1420.              :: [substracter] "m" (*packed_substracter));
  1421. @@ -397,9 +403,9 @@
  1422.  
  1423.         __asm __volatile
  1424.             ("\n\t emms");
  1425. -   }
  1426. +#endif /* VISUAL_ARCH_X86 */
  1427.  
  1428. -#endif /* VISUAL_ARCH_X86 || VISUAL_ARCH_X86_64 */
  1429. +   }
  1430.  
  1431.     while (n--) {
  1432.         (*d) = (*s) - substracter;
  1433. @@ -421,9 +427,8 @@
  1434.     visual_log_return_val_if_fail (src1 != NULL, -VISUAL_ERROR_NULL);
  1435.     visual_log_return_val_if_fail (src2 != NULL, -VISUAL_ERROR_NULL);
  1436.  
  1437. -#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64)
  1438. -
  1439.     if (visual_cpu_get_sse () && n >= 16) {
  1440. +#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64)
  1441.         while (!VISUAL_ALIGNED(d, 16)) {
  1442.             (*d) = (*s1) * (*s2);
  1443.  
  1444. @@ -462,7 +467,9 @@
  1445.  
  1446.             n -= 16;
  1447.         }
  1448. +#endif /* VISUAL_ARCH_X86 */
  1449.     } else if (visual_cpu_get_3dnow ()) {
  1450. +#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64)
  1451.         while (n > 8) {
  1452.             __asm __volatile
  1453.                 ("\n\t prefetch 256(%0)"
  1454. @@ -493,9 +500,9 @@
  1455.  
  1456.         __asm __volatile
  1457.             ("\n\t emms");
  1458. -   }
  1459. +#endif /* VISUAL_ARCH_X86 */
  1460.  
  1461. -#endif /* VISUAL_ARCH_X86) || VISUAL_ARCH_X86_64 */
  1462. +   }
  1463.  
  1464.     while (n--) {
  1465.         (*d) = (*s1) * (*s2);
  1466. @@ -526,9 +533,8 @@
  1467.     visual_log_return_val_if_fail (flts != NULL, -VISUAL_ERROR_NULL);
  1468.     visual_log_return_val_if_fail (ints != NULL, -VISUAL_ERROR_NULL);
  1469.  
  1470. -#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64)
  1471. -
  1472.     if (visual_cpu_get_3dnow ()) {
  1473. +#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64)
  1474.  
  1475.         while (n > 16) {
  1476.             __asm __volatile
  1477. @@ -559,11 +565,10 @@
  1478.  
  1479.         __asm __volatile
  1480.             ("\n\t emms");
  1481. +#endif /* VISUAL_ARCH_X86 */
  1482.  
  1483.     }
  1484.  
  1485. -#endif /* VISUAL_ARCH_X86 || VISUAL_ARCH_X86_64 */
  1486. -
  1487.     while (n--) {
  1488.         *d = *s;
  1489.  
  1490. @@ -592,9 +597,8 @@
  1491.     visual_log_return_val_if_fail (flts != NULL, -VISUAL_ERROR_NULL);
  1492.     visual_log_return_val_if_fail (ints != NULL, -VISUAL_ERROR_NULL);
  1493.  
  1494. -#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64)
  1495. -
  1496.     if (visual_cpu_get_3dnow ()) {
  1497. +#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64)
  1498.  
  1499.         while (n > 16) {
  1500.             __asm __volatile
  1501. @@ -625,9 +629,9 @@
  1502.  
  1503.         __asm __volatile
  1504.             ("\n\t emms");
  1505. -   }
  1506. +#endif /* VISUAL_ARCH_X86 */
  1507.  
  1508. -#endif /* VISUAL_ARCH_X86 || VISUAL_ARCH_X86_64 */
  1509. +   }
  1510.  
  1511.     while (n--) {
  1512.         *d = *s;
  1513. @@ -658,14 +662,13 @@
  1514.     visual_log_return_val_if_fail (flts != NULL, -VISUAL_ERROR_NULL);
  1515.     visual_log_return_val_if_fail (ints != NULL, -VISUAL_ERROR_NULL);
  1516.  
  1517. -#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64)
  1518. -
  1519.     if (visual_cpu_get_3dnow ()) {
  1520.         float packed_multiplier[2];
  1521.  
  1522.         packed_multiplier[0] = multiplier;
  1523.         packed_multiplier[1] = multiplier;
  1524.  
  1525. +#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64)
  1526.         __asm __volatile
  1527.             ("\n\t movq %[multiplier], %%mm0"
  1528.              :: [multiplier] "m" (*packed_multiplier));
  1529. @@ -696,9 +699,9 @@
  1530.  
  1531.         __asm __volatile
  1532.             ("\n\t emms");
  1533. -   }
  1534. +#endif /* VISUAL_ARCH_X86 */
  1535.  
  1536. -#endif
  1537. +   }
  1538.  
  1539.     while (n--) {
  1540.         *d = (float) *s * multiplier;
  1541. @@ -729,13 +732,13 @@
  1542.     visual_log_return_val_if_fail (flts != NULL, -VISUAL_ERROR_NULL);
  1543.     visual_log_return_val_if_fail (ints != NULL, -VISUAL_ERROR_NULL);
  1544.  
  1545. -#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64)
  1546.     if (visual_cpu_get_3dnow ()) {
  1547.         float packed_multiplier[2];
  1548.  
  1549.         packed_multiplier[0] = multiplier;
  1550.         packed_multiplier[1] = multiplier;
  1551.  
  1552. +#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64)
  1553.         __asm __volatile
  1554.             ("\n\t movq %[multiplier], %%mm0"
  1555.              :: [multiplier] "m" (*packed_multiplier));
  1556. @@ -774,8 +777,9 @@
  1557.  
  1558.         __asm __volatile
  1559.             ("\n\t emms");
  1560. +#endif /* VISUAL_ARCH_X86 */
  1561. +
  1562.     }
  1563. -#endif /* VISUAL_ARCH_X86 || VISUAL_ARCH_X86_64 */
  1564.  
  1565.     while (n--) {
  1566.         *d = (float) *s * multiplier;
  1567. @@ -807,7 +811,6 @@
  1568.     visual_log_return_val_if_fail (flts != NULL, -VISUAL_ERROR_NULL);
  1569.     visual_log_return_val_if_fail (ints != NULL, -VISUAL_ERROR_NULL);
  1570.  
  1571. -#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64)
  1572.     if (visual_cpu_get_3dnow ()) {
  1573.         float packed_multiplier[2];
  1574.         float packed_normalise_mul[2];
  1575. @@ -822,6 +825,7 @@
  1576.         packed_adder[0] = 1;
  1577.         packed_adder[1] = 1;
  1578.  
  1579. +#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64)
  1580.         __asm __volatile
  1581.             ("\n\t movq %[multiplier], %%mm0"
  1582.              "\n\t movq %[normalise_mul], %%mm6"
  1583. @@ -857,9 +861,9 @@
  1584.  
  1585.         __asm __volatile
  1586.             ("\n\t emms");
  1587. -   }
  1588. +#endif /* VISUAL_ARCH_X86 */
  1589.  
  1590. -#endif /* VISUAL_ARCH_X86 || VISUAL_ARCH_X86_64 */
  1591. +   }
  1592.  
  1593.     while (n--) {
  1594.         *d = (float) (((*s) + 1) * 0.5) * multiplier;
  1595. @@ -889,9 +893,8 @@
  1596.     visual_log_return_val_if_fail (dest != NULL, -VISUAL_ERROR_NULL);
  1597.     visual_log_return_val_if_fail (src != NULL, -VISUAL_ERROR_NULL);
  1598.  
  1599. -#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64)
  1600. -
  1601.     if (visual_cpu_get_sse () && n >= 16) {
  1602. +#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64)
  1603.         while (!VISUAL_ALIGNED(d, 16)) {
  1604.             *d = sqrtf (*s);
  1605.  
  1606. @@ -921,10 +924,9 @@
  1607.  
  1608.             n -= 16;
  1609.         }
  1610. +#endif /* VISUAL_ARCH_X86 */
  1611.     }
  1612.  
  1613. -#endif /* VISUAL_ARCH_X86 || VISUAL_ARCH_X86_64 */
  1614. -
  1615.     while (n--) {
  1616.         *d = sqrtf (*s);
  1617.  
  1618. @@ -956,10 +958,9 @@
  1619.     visual_log_return_val_if_fail (real != NULL, -VISUAL_ERROR_NULL);
  1620.     visual_log_return_val_if_fail (imag != NULL, -VISUAL_ERROR_NULL);
  1621.  
  1622. -#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64)
  1623. -
  1624.     if (visual_cpu_get_sse () && n >= 16) {
  1625.  
  1626. +#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64)
  1627.         while (!VISUAL_ALIGNED(d, 16)) {
  1628.             *d = sqrtf (((*r) * (*r)) + ((*i) * (*i)));
  1629.  
  1630. @@ -996,10 +997,9 @@
  1631.  
  1632.             n -= 8;
  1633.         }
  1634. +#endif /* VISUAL_ARCH_X86 */
  1635.     }
  1636.  
  1637. -#endif /* VISUAL_ARCH_X86 || VISUAL_ARCH_X86_64 */
  1638. -
  1639.     while (n--) {
  1640.         *d = sqrtf (((*r) * (*r)) + ((*i) * (*i)));
  1641.  
  1642. @@ -1033,8 +1033,6 @@
  1643.     visual_log_return_val_if_fail (real != NULL, -VISUAL_ERROR_NULL);
  1644.     visual_log_return_val_if_fail (imag != NULL, -VISUAL_ERROR_NULL);
  1645.  
  1646. -#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64)
  1647. -
  1648.     if (visual_cpu_get_sse () && n >= 16) {
  1649.         float packed_scaler[4];
  1650.  
  1651. @@ -1043,6 +1041,7 @@
  1652.         packed_scaler[2] = scaler;
  1653.         packed_scaler[3] = scaler;
  1654.  
  1655. +#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64)
  1656.         while (!VISUAL_ALIGNED(d, 16)) {
  1657.             *d = sqrtf (((*r) * (*r)) + ((*i) * (*i))) * scaler;
  1658.  
  1659. @@ -1085,11 +1084,9 @@
  1660.  
  1661.             n -= 8;
  1662.         }
  1663. +#endif /* VISUAL_ARCH_X86 */
  1664.     }
  1665.  
  1666. -#endif /* VISUAL_ARCH_X86 || VISUAL_ARCH_X86_64 */
  1667. -
  1668. -
  1669.     while (n--) {
  1670.         *d = sqrtf (((*r) * (*r)) + ((*i) * (*i))) * scaler;
  1671.  
  1672. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_math.h FroyVisuals/jni/libvisual/lv_math.h
  1673. --- libvisual.master/libvisual/libvisual/lv_math.h  2012-03-22 16:52:33.574363931 +0800
  1674. +++ FroyVisuals/jni/libvisual/lv_math.h 2012-03-02 22:05:29.439672446 +0800
  1675. @@ -24,7 +24,7 @@
  1676.  #ifndef _LV_MATH_H
  1677.  #define _LV_MATH_H
  1678.  
  1679. -#include <libvisual/lv_common.h>
  1680. +#include "lv_common.h"
  1681.  
  1682.  VISUAL_BEGIN_DECLS
  1683.  
  1684. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_mem.c FroyVisuals/jni/libvisual/lv_mem.c
  1685. --- libvisual.master/libvisual/libvisual/lv_mem.c   2012-03-23 04:36:54.345271124 +0800
  1686. +++ FroyVisuals/jni/libvisual/lv_mem.c  2012-03-02 22:05:29.439672446 +0800
  1687. @@ -27,6 +27,10 @@
  1688.  #include <stdlib.h>
  1689.  #include <gettext.h>
  1690.  
  1691. +#if defined(HAVE_NEON)
  1692. +#    include <arm_neon.h>
  1693. +#endif
  1694. +
  1695.  #include "lv_mem.h"
  1696.  #include "lv_common.h"
  1697.  #include "lv_log.h"
  1698. @@ -42,21 +46,25 @@
  1699.  static void *mem_copy_mmx2 (void *dest, const void *src, visual_size_t n);
  1700.  static void *mem_copy_3dnow (void *dest, const void *src, visual_size_t n);
  1701.  static void *mem_copy_altivec (void *dest, const void *src, visual_size_t n);
  1702. +static void *mem_copy_neon (void *dest, const void *src, visual_size_t n);
  1703.  
  1704.  static void *mem_set8_c (void *dest, int c, visual_size_t n);
  1705.  static void *mem_set8_mmx (void *dest, int c, visual_size_t n);
  1706.  static void *mem_set8_mmx2 (void *dest, int c, visual_size_t n);
  1707.  static void *mem_set8_altivec (void *dest, int c, visual_size_t n);
  1708. +static void *mem_set8_neon (void *dest, int c, visual_size_t n);
  1709.  
  1710.  static void *mem_set16_c (void *dest, int c, visual_size_t n);
  1711.  static void *mem_set16_mmx (void *dest, int c, visual_size_t n);
  1712.  static void *mem_set16_mmx2 (void *dest, int c, visual_size_t n);
  1713.  static void *mem_set16_altivec (void *dest, int c, visual_size_t n);
  1714. +static void *mem_set16_neon (void *dest, int c, visual_size_t n);
  1715.  
  1716.  static void *mem_set32_c (void *dest, int c, visual_size_t n);
  1717.  static void *mem_set32_mmx (void *dest, int c, visual_size_t n);
  1718.  static void *mem_set32_mmx2 (void *dest, int c, visual_size_t n);
  1719.  static void *mem_set32_altivec (void *dest, int c, visual_size_t n);
  1720. +static void *mem_set32_neon (void *dest, int c, visual_size_t n);
  1721.  
  1722.  /* Optimal performance functions set by visual_mem_initialize(). */
  1723.  VisMemCopyFunc visual_mem_copy = mem_copy_c;
  1724. @@ -111,6 +119,20 @@
  1725.         visual_mem_set32 = mem_set32_mmx2;
  1726.     }
  1727.  
  1728. +    if (visual_cpu_get_altivec() > 0) {
  1729. +        visual_mem_copy = mem_copy_altivec;
  1730. +        visual_mem_set = mem_set8_altivec;
  1731. +        visual_mem_set16 = mem_set16_altivec;
  1732. +        visual_mem_set32 = mem_set32_altivec;
  1733. +    }
  1734. +
  1735. +    if (visual_cpu_get_neon() > 0) {
  1736. +        visual_mem_copy = mem_copy_neon;
  1737. +        visual_mem_set = mem_set8_neon;
  1738. +        visual_mem_set16 = mem_set16_neon;
  1739. +        visual_mem_set32 = mem_set32_neon;
  1740. +    }
  1741. +
  1742.     return VISUAL_OK;
  1743.  }
  1744.  
  1745. @@ -375,9 +397,49 @@
  1746.  
  1747.  static void *mem_copy_altivec (void *dest, const void *src, visual_size_t n)
  1748.  {
  1749. +
  1750.      return NULL;
  1751.  }
  1752.  
  1753. +static void *mem_copy_neon (void *dest, const void *src, visual_size_t n)
  1754. +{
  1755. +    memcpy(dest, src, n);
  1756. +    return dest;
  1757. +#if 0
  1758. +   uint32_t *d = dest;
  1759. +   const uint32_t *s = src;
  1760. +   uint8_t *dc = dest;
  1761. +   const uint8_t *sc = src;
  1762. +
  1763. +#ifdef VISUAL_ARCH_ARM
  1764. +   while (n >= 64) {
  1765. +        __asm __volatile(
  1766. +        "\n\t ldmia %[source]!, {r4-r7}"
  1767. +        "\n\t stmia %[dest]!, {r4-r7}"
  1768. +        "\n\t ldmia %[source]!, {r4-r7}"
  1769. +        "\n\t stmia %[dest]!, {r4-r7}"
  1770. +        "\n\t ldmia %[source]!, {r4-r7}"
  1771. +        "\n\t stmia %[dest]!, {r4-r7}"
  1772. +        "\n\t ldmia %[source]!, {r4-r7}"
  1773. +        "\n\t stmia %[dest]!, {r4-r7}"
  1774. +        :: [dest] "r" (d), [source] "r" (s) : "r4", "r5", "r6", "r7" );
  1775. +
  1776. +        d+=16;
  1777. +        s+=16;
  1778. +       n -= 64;
  1779. +   }
  1780. +#endif
  1781. +
  1782. +   dc = (uint8_t *) d;
  1783. +   sc = (const uint8_t *) s;
  1784. +
  1785. +   while (n--)
  1786. +       *dc++ = *sc++;
  1787. +
  1788. +   return dest;
  1789. +#endif
  1790. +}
  1791. +
  1792.  /* Memset functions, 1 byte memset */
  1793.  static void *mem_set8_c (void *dest, int c, visual_size_t n)
  1794.  {
  1795. @@ -525,9 +587,61 @@
  1796.  
  1797.  static void *mem_set8_altivec (void *dest, int c, visual_size_t n)
  1798.  {
  1799. +
  1800.      return NULL;
  1801.  }
  1802.  
  1803. +/* Memset functions, 1 byte memset */
  1804. +static void *mem_set8_neon (void *dest, int c, visual_size_t n)
  1805. +{
  1806. +
  1807. +    memset(dest, c, n);
  1808. +    return dest;
  1809. +#if 0
  1810. +   uint32_t *d = dest;
  1811. +   uint8_t *dc = dest;
  1812. +   uint32_t setflag32 =
  1813. +       (c & 0xff) |
  1814. +       ((c << 8) & 0xff00) |
  1815. +       ((c << 16) & 0xff0000) |
  1816. +       ((c << 24) & 0xff000000);
  1817. +   uint8_t setflag8 = c & 0xff;
  1818. +
  1819. +#if defined(VISUAL_ARCH_ARM)
  1820. +
  1821. +   while (n >= 32) {
  1822. +       __asm __volatile
  1823. +        (
  1824. +            "\n\t mov r4, %[flag]"
  1825. +            "\n\t mov r5, r4"
  1826. +            "\n\t mov r6, r4"
  1827. +            "\n\t mov r7, r4"
  1828. +            "\n\t stmia %[dst]!,{r4-r7}"
  1829. +            "\n\t stmia %[dst]!,{r4-r7}"
  1830. +        :: [dst] "r" (d), [flag] "r" (&setflag32) : "r4", "r5", "r6", "r7");
  1831. +
  1832. +       d += 8;
  1833. +
  1834. +       n -= 32;
  1835. +   }
  1836. +
  1837. +#endif /* VISUAL_ARCH_ARM */
  1838. +
  1839. +   while (n >= 4) {
  1840. +       *d++ = setflag32;
  1841. +       n -= 4;
  1842. +   }
  1843. +
  1844. +   dc = (uint8_t *) d;
  1845. +
  1846. +   while (n--)
  1847. +       *dc++ = setflag8;
  1848. +
  1849. +   return dest;
  1850. +#endif
  1851. +}
  1852. +
  1853. +
  1854.  /* Memset functions, 2 byte memset */
  1855.  static void *mem_set16_c (void *dest, int c, visual_size_t n)
  1856.  {
  1857. @@ -669,9 +783,33 @@
  1858.  
  1859.  static void *mem_set16_altivec (void *dest, int c, visual_size_t n)
  1860.  {
  1861. +
  1862.      return NULL;
  1863.  }
  1864.  
  1865. +/* Memset functions, 2 byte memset */
  1866. +static void *mem_set16_neon (void *dest, int c, visual_size_t n)
  1867. +{
  1868. +    memset(dest, c, n);
  1869. +    return dest;
  1870. +#if 0
  1871. +   uint32_t *d = dest;
  1872. +   uint16_t *dc = dest;
  1873. +   uint32_t setflag32 =
  1874. +       (c & 0xffff) |
  1875. +       ((c << 16) & 0xffff0000);
  1876. +   uint16_t setflag16 = c & 0xffff;
  1877. +
  1878. +
  1879. +   dc = (uint16_t *) d;
  1880. +
  1881. +   while (n--)
  1882. +       *dc++ = setflag16;
  1883. +
  1884. +   return dest;
  1885. +#endif
  1886. +}
  1887. +
  1888.  /* Memset functions, 4 byte memset */
  1889.  static void *mem_set32_c (void *dest, int c, visual_size_t n)
  1890.  {
  1891. @@ -780,9 +918,26 @@
  1892.  
  1893.  static void *mem_set32_altivec (void *dest, int c, visual_size_t n)
  1894.  {
  1895. +
  1896.      return NULL;
  1897.  }
  1898.  
  1899. +/* Memset functions, 4 byte memset */
  1900. +static void *mem_set32_neon (void *dest, int c, visual_size_t n)
  1901. +{
  1902. +    memset(dest, c, n);
  1903. +    return dest;
  1904. +#if 0
  1905. +   uint32_t *d = dest;
  1906. +   uint32_t setflag32 = c;
  1907. +
  1908. +   while (n--)
  1909. +       *d++ = setflag32;
  1910. +
  1911. +   return dest;
  1912. +#endif
  1913. +}
  1914. +
  1915.  /**
  1916.   * @}
  1917.   */
  1918. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_mem.h FroyVisuals/jni/libvisual/lv_mem.h
  1919. --- libvisual.master/libvisual/libvisual/lv_mem.h   2012-03-22 16:52:33.574363931 +0800
  1920. +++ FroyVisuals/jni/libvisual/lv_mem.h  2012-03-02 22:05:29.439672446 +0800
  1921. @@ -24,9 +24,9 @@
  1922.  #ifndef _LV_MEM_H
  1923.  #define _LV_MEM_H
  1924.  
  1925. -#include <libvisual/lvconfig.h>
  1926. +#include "lvconfig.h"
  1927.  
  1928. -#include <libvisual/lv_defines.h>
  1929. +#include "lv_defines.h"
  1930.  
  1931.  VISUAL_BEGIN_DECLS
  1932.  
  1933. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_morph.c FroyVisuals/jni/libvisual/lv_morph.c
  1934. --- libvisual.master/libvisual/libvisual/lv_morph.c 2012-03-22 16:52:33.574363931 +0800
  1935. +++ FroyVisuals/jni/libvisual/lv_morph.c    2012-03-02 22:05:29.439672446 +0800
  1936. @@ -240,7 +240,7 @@
  1937.   */
  1938.  int visual_morph_get_supported_depth (VisMorph *morph)
  1939.  {
  1940. -   VisPluginData *plugin;
  1941. +   //VisPluginData *plugin;
  1942.     VisMorphPlugin *morphplugin;
  1943.  
  1944.     visual_log_return_val_if_fail (morph != NULL, -VISUAL_ERROR_MORPH_NULL);
  1945. @@ -256,7 +256,7 @@
  1946.  
  1947.  VisVideoAttributeOptions *visual_morph_get_video_attribute_options (VisMorph *morph)
  1948.  {
  1949. -   VisPluginData *plugin;
  1950. +   //VisPluginData *plugin;
  1951.     VisMorphPlugin *morphplugin;
  1952.  
  1953.     visual_log_return_val_if_fail (morph != NULL, NULL);
  1954. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_morph.h FroyVisuals/jni/libvisual/lv_morph.h
  1955. --- libvisual.master/libvisual/libvisual/lv_morph.h 2012-03-22 16:52:33.574363931 +0800
  1956. +++ FroyVisuals/jni/libvisual/lv_morph.h    2012-03-02 22:05:29.443672446 +0800
  1957. @@ -24,11 +24,11 @@
  1958.  #ifndef _LV_MORPH_H
  1959.  #define _LV_MORPH_H
  1960.  
  1961. -#include <libvisual/lv_palette.h>
  1962. -#include <libvisual/lv_plugin.h>
  1963. -#include <libvisual/lv_list.h>
  1964. -#include <libvisual/lv_video.h>
  1965. -#include <libvisual/lv_time.h>
  1966. +#include "lv_palette.h"
  1967. +#include "lv_plugin.h"
  1968. +#include "lv_list.h"
  1969. +#include "lv_video.h"
  1970. +#include "lv_time.h"
  1971.  
  1972.  VISUAL_BEGIN_DECLS
  1973.  
  1974. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_object.h FroyVisuals/jni/libvisual/lv_object.h
  1975. --- libvisual.master/libvisual/libvisual/lv_object.h    2012-03-22 16:52:33.574363931 +0800
  1976. +++ FroyVisuals/jni/libvisual/lv_object.h   2012-03-02 22:05:29.443672446 +0800
  1977. @@ -24,8 +24,8 @@
  1978.  #ifndef _LV_OBJECT_H
  1979.  #define _LV_OBJECT_H
  1980.  
  1981. -#include <libvisual/lv_defines.h>
  1982. -#include <libvisual/lv_types.h>
  1983. +#include "lv_defines.h"
  1984. +#include "lv_types.h"
  1985.  
  1986.  VISUAL_BEGIN_DECLS
  1987.  
  1988. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_os.h FroyVisuals/jni/libvisual/lv_os.h
  1989. --- libvisual.master/libvisual/libvisual/lv_os.h    2012-03-22 16:52:33.574363931 +0800
  1990. +++ FroyVisuals/jni/libvisual/lv_os.h   2012-03-02 22:05:29.443672446 +0800
  1991. @@ -24,7 +24,7 @@
  1992.  #ifndef _LV_OS_H
  1993.  #define _LV_OS_H
  1994.  
  1995. -#include <libvisual/lv_common.h>
  1996. +#include "lv_common.h"
  1997.  
  1998.  VISUAL_BEGIN_DECLS
  1999.  
  2000. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_palette.h FroyVisuals/jni/libvisual/lv_palette.h
  2001. --- libvisual.master/libvisual/libvisual/lv_palette.h   2012-03-22 16:52:33.574363931 +0800
  2002. +++ FroyVisuals/jni/libvisual/lv_palette.h  2012-03-02 22:05:29.443672446 +0800
  2003. @@ -24,8 +24,8 @@
  2004.  #ifndef _LV_PALETTE_H
  2005.  #define _LV_PALETTE_H
  2006.  
  2007. -#include <libvisual/lv_common.h>
  2008. -#include <libvisual/lv_color.h>
  2009. +#include "lv_common.h"
  2010. +#include "lv_color.h"
  2011.  
  2012.  VISUAL_BEGIN_DECLS
  2013.  
  2014. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_param.c FroyVisuals/jni/libvisual/lv_param.c
  2015. --- libvisual.master/libvisual/libvisual/lv_param.c 2012-03-22 16:52:33.574363931 +0800
  2016. +++ FroyVisuals/jni/libvisual/lv_param.c    2012-03-02 22:05:29.443672446 +0800
  2017. @@ -205,7 +205,7 @@
  2018.      visual_mem_copy(&param->defaultnum, &param->numeric, sizeof(param->defaultnum));
  2019.  
  2020.      if(param->type == VISUAL_PARAM_ENTRY_TYPE_STRING)
  2021. -        param->defaultstring = strdup(param->string);
  2022. +        ;//param->defaultstring = strdup(param->string); FIXME
  2023.  
  2024.  /*
  2025.      if(param->type == VISUAL_PARAM_ENTRY_TYPE_COLOR)
  2026. @@ -1346,7 +1346,7 @@
  2027.      visual_log_return_val_if_fail(param != NULL, -VISUAL_ERROR_PARAM_NULL);
  2028.  
  2029.      if(param->defaultstring)
  2030. -        visual_mem_free(param->defaultstring);
  2031. +        ;//visual_mem_free(param->defaultstring);
  2032.  
  2033.      param->defaultstring = strdup(str);
  2034.  
  2035. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_param.h FroyVisuals/jni/libvisual/lv_param.h
  2036. --- libvisual.master/libvisual/libvisual/lv_param.h 2012-03-22 16:52:33.574363931 +0800
  2037. +++ FroyVisuals/jni/libvisual/lv_param.h    2012-03-02 22:05:29.443672446 +0800
  2038. @@ -24,11 +24,11 @@
  2039.  #ifndef _LV_PARAM_H
  2040.  #define _LV_PARAM_H
  2041.  
  2042. -#include <libvisual/lv_common.h>
  2043. -#include <libvisual/lv_color.h>
  2044. -#include <libvisual/lv_palette.h>
  2045. -#include <libvisual/lv_list.h>
  2046. -#include <libvisual/lv_event.h>
  2047. +#include "lv_common.h"
  2048. +#include "lv_color.h"
  2049. +#include "lv_palette.h"
  2050. +#include "lv_list.h"
  2051. +#include "lv_event.h"
  2052.  
  2053.  VISUAL_BEGIN_DECLS
  2054.  
  2055. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_plugin.c FroyVisuals/jni/libvisual/lv_plugin.c
  2056. --- libvisual.master/libvisual/libvisual/lv_plugin.c    2012-03-22 16:52:33.578363931 +0800
  2057. +++ FroyVisuals/jni/libvisual/lv_plugin.c   2012-03-02 22:05:29.443672446 +0800
  2058. @@ -239,7 +239,6 @@
  2059.  
  2060.     if (plugin->info->events != NULL) {
  2061.         plugin->info->events (plugin, &plugin->eventqueue);
  2062. -
  2063.         return VISUAL_OK;
  2064.     }
  2065.  
  2066. @@ -816,7 +815,7 @@
  2067.     VisPluginRef **ref;
  2068.     VisPluginInfo *plug_info;
  2069.     VisPluginInfo *dup_info;
  2070. -   const char *plug_name;
  2071. +   //const char *plug_name;
  2072.     VisPluginGetInfoFunc get_plugin_info;
  2073.     int *plugin_version;
  2074.  #if defined(VISUAL_OS_WIN32)
  2075. @@ -897,6 +896,8 @@
  2076.         return NULL;
  2077.     }
  2078.  
  2079. +    visual_log(VISUAL_LOG_INFO, "Plugin loaded: %s %s (%s) %s <%s>", plug_info->name, plug_info->version, plug_info->about, plug_info->help, plug_info->author);
  2080. +
  2081.     ref = visual_mem_new0 (VisPluginRef *, cnt);
  2082.  
  2083.     for (i = 0; i < cnt; i++) {
  2084. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_plugin.h FroyVisuals/jni/libvisual/lv_plugin.h
  2085. --- libvisual.master/libvisual/libvisual/lv_plugin.h    2012-03-22 16:52:33.578363931 +0800
  2086. +++ FroyVisuals/jni/libvisual/lv_plugin.h   2012-03-02 22:05:29.443672446 +0800
  2087. @@ -24,16 +24,16 @@
  2088.  #ifndef _LV_PLUGIN_H
  2089.  #define _LV_PLUGIN_H
  2090.  
  2091. -#include <libvisual/lv_video.h>
  2092. -#include <libvisual/lv_audio.h>
  2093. -#include <libvisual/lv_palette.h>
  2094. -#include <libvisual/lv_list.h>
  2095. -#include <libvisual/lv_songinfo.h>
  2096. -#include <libvisual/lv_event.h>
  2097. -#include <libvisual/lv_param.h>
  2098. -#include <libvisual/lv_ui.h>
  2099. -#include <libvisual/lv_random.h>
  2100. -#include <libvisual/lv_types.h>
  2101. +#include "lv_video.h"
  2102. +#include "lv_audio.h"
  2103. +#include "lv_palette.h"
  2104. +#include "lv_list.h"
  2105. +#include "lv_songinfo.h"
  2106. +#include "lv_event.h"
  2107. +#include "lv_param.h"
  2108. +#include "lv_ui.h"
  2109. +#include "lv_random.h"
  2110. +#include "lv_types.h"
  2111.  
  2112.  #include "lvconfig.h"
  2113.  
  2114. @@ -59,9 +59,20 @@
  2115.  #define VISUAL_PLUGIN_TYPE_NULL        "Libvisual:core:null"
  2116.  
  2117.  /**
  2118. - * Standard defination for GPL plugins, use this for the .license entry in VisPluginInfo
  2119. + * Standard defination for GPLv1 plugins, use this for the .license entry in VisPluginInfo
  2120.   */
  2121. -#define VISUAL_PLUGIN_LICENSE_GPL  "GPL"
  2122. +#define VISUAL_PLUGIN_LICENSE_GPLv1 "GPLv1"
  2123. +
  2124. +/**
  2125. + * Standard defination for GPLv2 plugins, use this for the .license entry in VisPluginInfo
  2126. + */
  2127. +#define VISUAL_PLUGIN_LICENSE_GPL  "GPLv2"
  2128. +
  2129. +/**
  2130. + * Standard defination for GPLv3 plugins, use this for the .license entry in VisPluginInfo
  2131. + */
  2132. +
  2133. +#define VISUAL_PLUGIN_LICENSE_GPLv3    "GPLv3"
  2134.  /**
  2135.   * Standard defination for LGPL plugins, use this for the .license entry in VisPluginInfo
  2136.   */
  2137. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_random.h FroyVisuals/jni/libvisual/lv_random.h
  2138. --- libvisual.master/libvisual/libvisual/lv_random.h    2012-03-22 16:52:33.578363931 +0800
  2139. +++ FroyVisuals/jni/libvisual/lv_random.h   2012-03-02 22:05:29.447672445 +0800
  2140. @@ -25,7 +25,7 @@
  2141.  #ifndef _LV_RANDOM_H
  2142.  #define _LV_RANDOM_H
  2143.  
  2144. -#include <libvisual/lv_common.h>
  2145. +#include "lv_common.h"
  2146.  
  2147.  VISUAL_BEGIN_DECLS
  2148.  
  2149. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_rectangle.c FroyVisuals/jni/libvisual/lv_rectangle.c
  2150. --- libvisual.master/libvisual/libvisual/lv_rectangle.c 2012-03-22 16:52:33.578363931 +0800
  2151. +++ FroyVisuals/jni/libvisual/lv_rectangle.c    2012-03-02 22:05:29.447672445 +0800
  2152. @@ -341,8 +341,6 @@
  2153.   */
  2154.  int visual_rectangle_denormalise_many_values (VisRectangle *rect, float *fxlist, float *fylist, int32_t *xlist, int32_t *ylist, int size)
  2155.  {
  2156. -   int i;
  2157. -
  2158.     visual_log_return_val_if_fail (rect != NULL, -VISUAL_ERROR_RECTANGLE_NULL);
  2159.  
  2160.     visual_math_vectorized_floats_to_int32s_multiply (xlist, fxlist, size, rect->width);
  2161. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_rectangle.h FroyVisuals/jni/libvisual/lv_rectangle.h
  2162. --- libvisual.master/libvisual/libvisual/lv_rectangle.h 2012-03-22 16:52:33.578363931 +0800
  2163. +++ FroyVisuals/jni/libvisual/lv_rectangle.h    2012-03-02 22:05:29.447672445 +0800
  2164. @@ -24,7 +24,7 @@
  2165.  #ifndef _LV_RECTANGLE_H
  2166.  #define _LV_RECTANGLE_H
  2167.  
  2168. -#include <libvisual/lv_common.h>
  2169. +#include "lv_common.h"
  2170.  
  2171.  VISUAL_BEGIN_DECLS
  2172.  
  2173. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_ringbuffer.c FroyVisuals/jni/libvisual/lv_ringbuffer.c
  2174. --- libvisual.master/libvisual/libvisual/lv_ringbuffer.c    2012-03-23 04:39:05.893267722 +0800
  2175. +++ FroyVisuals/jni/libvisual/lv_ringbuffer.c   2012-03-02 22:05:29.447672445 +0800
  2176. @@ -21,8 +21,6 @@
  2177.   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  2178.   */
  2179.  
  2180. -#include <config.h>
  2181. -
  2182.  #include <stdio.h>
  2183.  #include <stdlib.h>
  2184.  #include <unistd.h>
  2185. @@ -30,7 +28,7 @@
  2186.  #include <fcntl.h>
  2187.  #include <gettext.h>
  2188.  
  2189. -#include "lvconfig.h"
  2190. +#include <lvconfig.h>
  2191.  #include "lv_ringbuffer.h"
  2192.  #include "lv_log.h"
  2193.  #include "lv_mem.h"
  2194. @@ -255,8 +253,8 @@
  2195.     VisListEntry *le = NULL;
  2196.     VisRingBufferEntry *entry;
  2197.     int curposition = 0;
  2198. -   int curoffset = 0;
  2199. -   int positioncorr = 0;
  2200. +   //int curoffset = 0;
  2201. +   //int positioncorr = 0;
  2202.     int startat = 0;
  2203.     int buffercorr = 0;
  2204.  
  2205. @@ -343,7 +341,7 @@
  2206.  {
  2207.     VisListEntry *le = NULL;
  2208.     VisRingBufferEntry *entry;
  2209. -   int curposition = 0;
  2210. +   //int curposition = 0;
  2211.     int curoffset = 0;
  2212.     int startat = 0;
  2213.  
  2214. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_ringbuffer.h FroyVisuals/jni/libvisual/lv_ringbuffer.h
  2215. --- libvisual.master/libvisual/libvisual/lv_ringbuffer.h    2012-03-22 16:52:33.578363931 +0800
  2216. +++ FroyVisuals/jni/libvisual/lv_ringbuffer.h   2012-03-02 22:05:29.447672445 +0800
  2217. @@ -24,9 +24,9 @@
  2218.  #ifndef _LV_RINGBUFFER_H
  2219.  #define _LV_RINGBUFFER_H
  2220.  
  2221. -#include <libvisual/lv_common.h>
  2222. -#include <libvisual/lv_list.h>
  2223. -#include <libvisual/lv_buffer.h>
  2224. +#include "lv_common.h"
  2225. +#include "lv_list.h"
  2226. +#include "lv_buffer.h"
  2227.  
  2228.  VISUAL_BEGIN_DECLS
  2229.  
  2230. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_songinfo.h FroyVisuals/jni/libvisual/lv_songinfo.h
  2231. --- libvisual.master/libvisual/libvisual/lv_songinfo.h  2012-03-22 16:52:33.578363931 +0800
  2232. +++ FroyVisuals/jni/libvisual/lv_songinfo.h 2012-03-02 22:05:29.447672445 +0800
  2233. @@ -24,8 +24,8 @@
  2234.  #ifndef _LV_SONGINFO_H
  2235.  #define _LV_SONGINFO_H
  2236.  
  2237. -#include <libvisual/lv_time.h>
  2238. -#include <libvisual/lv_video.h>
  2239. +#include "lv_time.h"
  2240. +#include "lv_video.h"
  2241.  
  2242.  VISUAL_BEGIN_DECLS
  2243.  
  2244. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_thread.c FroyVisuals/jni/libvisual/lv_thread.c
  2245. --- libvisual.master/libvisual/libvisual/lv_thread.c    2012-03-23 04:20:47.197296131 +0800
  2246. +++ FroyVisuals/jni/libvisual/lv_thread.c   2012-03-02 22:05:29.447672445 +0800
  2247. @@ -80,7 +80,6 @@
  2248.  static ThreadFuncs __lv_thread_funcs;
  2249.  
  2250.  /* Posix implementation */
  2251. -#ifdef VISUAL_THREAD_MODEL_POSIX
  2252.  static VisThread *thread_create_posix (VisThreadFunc func, void *data, int joinable);
  2253.  static int thread_free_posix (VisThread *thread);
  2254.  static void *thread_join_posix (VisThread *thread);
  2255. @@ -93,10 +92,9 @@
  2256.  static int mutex_lock_posix (VisMutex *mutex);
  2257.  static int mutex_trylock_posix (VisMutex *mutex);
  2258.  static int mutex_unlock_posix (VisMutex *mutex);
  2259. -#endif
  2260.  
  2261. -/* Windows32 implementation */
  2262.  #ifdef VISUAL_THREAD_MODEL_WIN32
  2263. +/* Windows32 implementation */
  2264.  static VisThread *thread_create_win32 (VisThreadFunc func, void *data, int joinable);
  2265.  static int thread_free_win32 (VisThread *thread);
  2266.  static void *thread_join_win32 (VisThread *thread);
  2267. @@ -111,8 +109,8 @@
  2268.  static int mutex_unlock_win32 (VisMutex *mutex);
  2269.  #endif
  2270.  
  2271. -/* GThread implementation */
  2272.  #ifdef VISUAL_THREAD_MODEL_GTHREAD2
  2273. +/* GThread implementation */
  2274.  static VisThread *thread_create_gthread (VisThreadFunc func, void *data, int joinable);
  2275.  static int thread_free_gthread (VisThread *thread);
  2276.  static void *thread_join_gthread (VisThread *thread);
  2277. @@ -457,12 +455,11 @@
  2278.  
  2279.  /* Native implementations */
  2280.  
  2281. -#ifdef VISUAL_THREAD_MODEL_POSIX
  2282. -
  2283.  /* Posix implementation */
  2284.  static VisThread *thread_create_posix (VisThreadFunc func, void *data, int joinable)
  2285.  {
  2286.     VisThread *thread = NULL;
  2287. +#ifdef VISUAL_THREAD_MODEL_POSIX
  2288.  
  2289.     pthread_attr_t attr;
  2290.     int res;
  2291. @@ -487,6 +484,7 @@
  2292.  
  2293.         return NULL;
  2294.     }
  2295. +#endif
  2296.  
  2297.     return thread;
  2298.  }
  2299. @@ -499,34 +497,42 @@
  2300.  static void *thread_join_posix (VisThread *thread)
  2301.  {
  2302.     void *result = NULL;
  2303. +#ifdef VISUAL_THREAD_MODEL_POSIX
  2304.  
  2305.     if (pthread_join (thread->thread, &result) < 0) {
  2306.         visual_log (VISUAL_LOG_CRITICAL, _("Error while joining thread"));
  2307.  
  2308.         return NULL;
  2309.     }
  2310. +#endif
  2311.  
  2312.     return result;
  2313.  }
  2314.  
  2315.  static void thread_exit_posix (void *retval)
  2316.  {
  2317. +#ifdef VISUAL_THREAD_MODEL_POSIX
  2318.     pthread_exit (retval);
  2319. +#endif
  2320.  }
  2321.  
  2322.  static void thread_yield_posix ()
  2323.  {
  2324. +#ifdef VISUAL_THREAD_MODEL_POSIX
  2325.     sched_yield ();
  2326. +#endif
  2327.  }
  2328.  
  2329.  
  2330.  static VisMutex *mutex_new_posix ()
  2331.  {
  2332.     VisMutex *mutex;
  2333. +#ifdef VISUAL_THREAD_MODEL_POSIX
  2334.  
  2335.     mutex = visual_mem_new0 (VisMutex, 1);
  2336.  
  2337.     pthread_mutex_init (&mutex->mutex, NULL);
  2338. +#endif
  2339.  
  2340.     return mutex;
  2341.  }
  2342. @@ -539,41 +545,46 @@
  2343.  static int mutex_init_posix (VisMutex *mutex)
  2344.  {
  2345.     visual_mem_set (mutex, 0, sizeof (VisMutex));
  2346. +#ifdef VISUAL_THREAD_MODEL_POSIX
  2347.  
  2348.     pthread_mutex_init (&mutex->mutex, NULL);
  2349. +#endif
  2350.  
  2351.     return VISUAL_OK;
  2352.  }
  2353.  
  2354.  static int mutex_lock_posix (VisMutex *mutex)
  2355.  {
  2356. +#ifdef VISUAL_THREAD_MODEL_POSIX
  2357.     if (pthread_mutex_lock (&mutex->mutex) < 0)
  2358.         return -VISUAL_ERROR_MUTEX_LOCK_FAILURE;
  2359. +#endif
  2360.  
  2361.     return VISUAL_OK;
  2362.  }
  2363.  
  2364.  static int mutex_trylock_posix (VisMutex *mutex)
  2365.  {
  2366. +#ifdef VISUAL_THREAD_MODEL_POSIX
  2367.     if (pthread_mutex_trylock (&mutex->mutex) < 0)
  2368.         return -VISUAL_ERROR_MUTEX_TRYLOCK_FAILURE;
  2369. +#endif
  2370.  
  2371.     return VISUAL_OK;
  2372.  }
  2373.  
  2374.  static int mutex_unlock_posix (VisMutex *mutex)
  2375.  {
  2376. +#ifdef VISUAL_THREAD_MODEL_POSIX
  2377.     if (pthread_mutex_unlock (&mutex->mutex) < 0)
  2378.         return -VISUAL_ERROR_MUTEX_UNLOCK_FAILURE;
  2379. +#endif
  2380.  
  2381.     return VISUAL_OK;
  2382.  }
  2383.  
  2384. -#endif // VISUAL_THREAD_MODEL_POSIX
  2385. -
  2386. -/* Windows32 implementation */
  2387.  #ifdef VISUAL_THREAD_MODEL_WIN32
  2388. -
  2389. +/* Windows32 implementation */
  2390.  static VisThread *thread_create_win32 (VisThreadFunc func, void *data, int joinable)
  2391.  {
  2392.     VisThread *thread = NULL;
  2393. @@ -601,12 +612,16 @@
  2394.  
  2395.     return thread;
  2396.  }
  2397. +#endif
  2398.  
  2399. +#ifdef VISUAL_THREAD_MODEL_WIN32
  2400.  static int thread_free_win32 (VisThread *thread)
  2401.  {
  2402.     return visual_mem_free (thread);
  2403.  }
  2404. +#endif
  2405.  
  2406. +#ifdef VISUAL_THREAD_MODEL_WIN32
  2407.  static void *thread_join_win32 (VisThread *thread)
  2408.  {
  2409.     void *result = NULL;
  2410. @@ -624,51 +639,72 @@
  2411.  
  2412.     return result;
  2413.  }
  2414. +#endif
  2415.  
  2416. +#ifdef VISUAL_THREAD_MODEL_WIN32
  2417.  static void thread_exit_win32 (void *retval)
  2418.  {
  2419. +
  2420.  }
  2421. +#endif
  2422.  
  2423. +#ifdef VISUAL_THREAD_MODEL_WIN32
  2424.  static void thread_yield_win32 ()
  2425.  {
  2426. -}
  2427.  
  2428. +}
  2429. +#endif
  2430.  
  2431. +#ifdef VISUAL_THREAD_MODEL_WIN32
  2432.  static VisMutex *mutex_new_win32 ()
  2433.  {
  2434. -    return 0;
  2435. +
  2436. +    return NULL;
  2437.  }
  2438. +#endif
  2439.  
  2440. +#ifdef VISUAL_THREAD_MODEL_WIN32
  2441.  static int mutex_free_win32 (VisMutex *mutex)
  2442.  {
  2443. +
  2444.      return 0;
  2445.  }
  2446. +#endif
  2447.  
  2448. +#ifdef VISUAL_THREAD_MODEL_WIN32
  2449.  static int mutex_init_win32 (VisMutex *mutex)
  2450.  {
  2451. +
  2452.      return 0;
  2453.  }
  2454. +#endif
  2455.  
  2456. +#ifdef VISUAL_THREAD_MODEL_WIN32
  2457.  static int mutex_lock_win32 (VisMutex *mutex)
  2458.  {
  2459. +
  2460.      return 0;
  2461.  }
  2462. +#endif
  2463.  
  2464. +#ifdef VISUAL_THREAD_MODEL_WIN32
  2465.  static int mutex_trylock_win32 (VisMutex *mutex)
  2466.  {
  2467. +
  2468.      return 0;
  2469.  }
  2470. +#endif
  2471.  
  2472. +#ifdef VISUAL_THREAD_MODEL_WIN32
  2473.  static int mutex_unlock_win32 (VisMutex *mutex)
  2474.  {
  2475. +
  2476.      return 0;
  2477.  }
  2478. +#endif
  2479.  
  2480. -#endif /* VISUAL_THREAD_MODEL_WIN32 */
  2481. -
  2482. -/* GThread implementation */
  2483.  #ifdef VISUAL_THREAD_MODEL_GTHREAD2
  2484. -
  2485. +/* GThread implementation */
  2486.  static VisThread *thread_create_gthread (VisThreadFunc func, void *data, int joinable)
  2487.  {
  2488.     VisThread *thread = NULL;
  2489. @@ -687,12 +723,16 @@
  2490.  
  2491.     return thread;
  2492.  }
  2493. +#endif
  2494.  
  2495. +#ifdef VISUAL_THREAD_MODEL_GTHREAD2
  2496.  static int thread_free_gthread (VisThread *thread)
  2497.  {
  2498.     return visual_mem_free (thread);
  2499.  }
  2500. +#endif
  2501.  
  2502. +#ifdef VISUAL_THREAD_MODEL_GTHREAD2
  2503.  static void *thread_join_gthread (VisThread *thread)
  2504.  {
  2505.     gpointer result;
  2506. @@ -703,18 +743,24 @@
  2507.  
  2508.     return result;
  2509.  }
  2510. +#endif
  2511.  
  2512. +#ifdef VISUAL_THREAD_MODEL_GTHREAD2
  2513.  static void thread_exit_gthread (void *retval)
  2514.  {
  2515.     g_thread_exit (retval);
  2516.  }
  2517. +#endif
  2518.  
  2519. +#ifdef VISUAL_THREAD_MODEL_GTHREAD2
  2520.  static void thread_yield_gthread ()
  2521.  {
  2522.     g_thread_yield ();
  2523.  }
  2524. +#endif
  2525.  
  2526.  
  2527. +#ifdef VISUAL_THREAD_MODEL_GTHREAD2   
  2528.  static VisMutex *mutex_new_gthread ()
  2529.  {
  2530.     VisMutex *mutex;
  2531. @@ -727,7 +773,9 @@
  2532.  
  2533.     return mutex;
  2534.  }
  2535. +#endif
  2536.  
  2537. +#ifdef VISUAL_THREAD_MODEL_GTHREAD2
  2538.  static int mutex_free_gthread (VisMutex *mutex)
  2539.  {
  2540.     visual_log_return_val_if_fail (mutex->mutex != NULL, -VISUAL_ERROR_MUTEX_NULL);
  2541. @@ -736,7 +784,9 @@
  2542.  
  2543.     return visual_mem_free (mutex);
  2544.  }
  2545. +#endif
  2546.  
  2547. +#ifdef VISUAL_THREAD_MODEL_GTHREAD2
  2548.  static int mutex_init_gthread (VisMutex *mutex)
  2549.  {
  2550.     mutex->static_mutex_used = TRUE;
  2551. @@ -745,7 +795,9 @@
  2552.  
  2553.     return VISUAL_OK;
  2554.  }
  2555. +#endif
  2556.  
  2557. +#ifdef VISUAL_THREAD_MODEL_GTHREAD2
  2558.  static int mutex_lock_gthread (VisMutex *mutex)
  2559.  {
  2560.     if (mutex->static_mutex_used == TRUE)
  2561. @@ -755,7 +807,9 @@
  2562.  
  2563.     return VISUAL_OK;
  2564.  }
  2565. +#endif
  2566.  
  2567. +#ifdef VISUAL_THREAD_MODEL_GTHREAD2
  2568.  static int mutex_trylock_gthread (VisMutex *mutex)
  2569.  {
  2570.     if (mutex->static_mutex_used == TRUE)
  2571. @@ -765,7 +819,9 @@
  2572.  
  2573.     return VISUAL_OK;
  2574.  }
  2575. +#endif
  2576.  
  2577. +#ifdef VISUAL_THREAD_MODEL_GTHREAD2
  2578.  static int mutex_unlock_gthread (VisMutex *mutex)
  2579.  {
  2580.     if (mutex->static_mutex_used == TRUE)
  2581. @@ -775,5 +831,5 @@
  2582.  
  2583.     return VISUAL_OK;
  2584.  }
  2585. +#endif
  2586.  
  2587. -#endif // VISUAL_THREAD_MODEL_GTHREAD2
  2588. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_thread.h FroyVisuals/jni/libvisual/lv_thread.h
  2589. --- libvisual.master/libvisual/libvisual/lv_thread.h    2012-03-22 16:52:33.578363931 +0800
  2590. +++ FroyVisuals/jni/libvisual/lv_thread.h   2012-03-02 22:05:29.447672445 +0800
  2591. @@ -1,8 +1,8 @@
  2592.  #ifndef _LV_THREAD_H
  2593.  #define _LV_THREAD_H
  2594.  
  2595. -#include <libvisual/lvconfig.h>
  2596. -#include <libvisual/lv_common.h>
  2597. +#include "lvconfig.h"
  2598. +#include "lv_common.h"
  2599.  
  2600.  #include "lvconfig.h"
  2601.  
  2602. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_time.h FroyVisuals/jni/libvisual/lv_time.h
  2603. --- libvisual.master/libvisual/libvisual/lv_time.h  2012-03-22 16:52:33.578363931 +0800
  2604. +++ FroyVisuals/jni/libvisual/lv_time.h 2012-03-02 22:05:29.447672445 +0800
  2605. @@ -27,7 +27,7 @@
  2606.  #include <sys/time.h>
  2607.  #include <time.h>
  2608.  
  2609. -#include <libvisual/lv_common.h>
  2610. +#include "lv_common.h"
  2611.  
  2612.  VISUAL_BEGIN_DECLS
  2613.  
  2614. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_transform.h FroyVisuals/jni/libvisual/lv_transform.h
  2615. --- libvisual.master/libvisual/libvisual/lv_transform.h 2012-03-22 16:52:33.578363931 +0800
  2616. +++ FroyVisuals/jni/libvisual/lv_transform.h    2012-03-02 22:05:29.447672445 +0800
  2617. @@ -24,12 +24,12 @@
  2618.  #ifndef _LV_TRANSFORM_H
  2619.  #define _LV_TRANSFORM_H
  2620.  
  2621. -#include <libvisual/lv_audio.h>
  2622. -#include <libvisual/lv_video.h>
  2623. -#include <libvisual/lv_palette.h>
  2624. -#include <libvisual/lv_plugin.h>
  2625. -#include <libvisual/lv_songinfo.h>
  2626. -#include <libvisual/lv_event.h>
  2627. +#include "lv_audio.h"
  2628. +#include "lv_video.h"
  2629. +#include "lv_palette.h"
  2630. +#include "lv_plugin.h"
  2631. +#include "lv_songinfo.h"
  2632. +#include "lv_event.h"
  2633.  
  2634.  VISUAL_BEGIN_DECLS
  2635.  
  2636. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_types.h FroyVisuals/jni/libvisual/lv_types.h
  2637. --- libvisual.master/libvisual/libvisual/lv_types.h 2012-03-22 16:52:33.578363931 +0800
  2638. +++ FroyVisuals/jni/libvisual/lv_types.h    2012-03-02 22:05:29.447672445 +0800
  2639. @@ -24,7 +24,7 @@
  2640.  #ifndef _LV_TYPES_H
  2641.  #define _LV_TYPES_H
  2642.  
  2643. -#include <libvisual/lv_defines.h>
  2644. +#include "lv_defines.h"
  2645.  
  2646.  #if defined(VISUAL_OS_WIN32)
  2647.  #include <stdint.h>
  2648. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_ui.c FroyVisuals/jni/libvisual/lv_ui.c
  2649. --- libvisual.master/libvisual/libvisual/lv_ui.c    2012-03-22 16:52:33.582363931 +0800
  2650. +++ FroyVisuals/jni/libvisual/lv_ui.c   2012-03-02 22:05:29.451672444 +0800
  2651. @@ -339,8 +339,8 @@
  2652.   */
  2653.  VisList *visual_ui_box_get_childs (VisUIBox *box)
  2654.  {
  2655. -   VisUIWidget *next;
  2656. -   VisListEntry *le = NULL;
  2657. +   //VisUIWidget *next;
  2658. +   //VisListEntry *le = NULL;
  2659.  
  2660.     visual_log_return_val_if_fail (box != NULL, NULL);
  2661.  
  2662. @@ -1066,7 +1066,7 @@
  2663.   */
  2664.  int visual_ui_choice_add_many (VisUIChoice *choice, VisParamEntry *paramchoices)
  2665.  {
  2666. -   VisUIChoiceEntry *centry;
  2667. +   //VisUIChoiceEntry *centry;
  2668.     int i = 0;
  2669.  
  2670.     visual_log_return_val_if_fail (choice != NULL, -VISUAL_ERROR_UI_CHOICE_NULL);
  2671. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_ui.h FroyVisuals/jni/libvisual/lv_ui.h
  2672. --- libvisual.master/libvisual/libvisual/lv_ui.h    2012-03-22 16:52:33.582363931 +0800
  2673. +++ FroyVisuals/jni/libvisual/lv_ui.h   2012-03-02 22:05:29.451672444 +0800
  2674. @@ -24,10 +24,10 @@
  2675.  #ifndef _LV_UI_H
  2676.  #define _LV_UI_H
  2677.  
  2678. -#include <libvisual/lv_list.h>
  2679. -#include <libvisual/lv_param.h>
  2680. -#include <libvisual/lv_video.h>
  2681. -#include <libvisual/lv_common.h>
  2682. +#include "lv_list.h"
  2683. +#include "lv_param.h"
  2684. +#include "lv_video.h"
  2685. +#include "lv_common.h"
  2686.  
  2687.  VISUAL_BEGIN_DECLS
  2688.  
  2689. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_utils.c FroyVisuals/jni/libvisual/lv_utils.c
  2690. --- libvisual.master/libvisual/libvisual/lv_utils.c 2012-03-23 21:09:12.123731556 +0800
  2691. +++ FroyVisuals/jni/libvisual/lv_utils.c    2012-03-02 22:05:29.451672444 +0800
  2692. @@ -43,7 +43,27 @@
  2693.   */
  2694.  int visual_utils_is_power_of_2 (int n)
  2695.  {
  2696. -   return (n > 0) && !(n & (n - 1));
  2697. +   int bits_found = FALSE;
  2698. +
  2699. +   if (n < 1)
  2700. +       return FALSE;
  2701. +
  2702. +   do {
  2703. +       if (n & 1) {
  2704. +           if (bits_found)
  2705. +               return FALSE;
  2706. +
  2707. +           bits_found = TRUE;
  2708. +       }
  2709. +
  2710. +       n >>= 1;
  2711. +
  2712. +   } while (n > 0);
  2713. +
  2714. +   /* Couldn't we use this: */
  2715. +   /* FIXME: (n & (n -1)) == 0) */
  2716. +
  2717. +   return TRUE;
  2718.  }
  2719.  
  2720.  /**
  2721. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_utils.h FroyVisuals/jni/libvisual/lv_utils.h
  2722. --- libvisual.master/libvisual/libvisual/lv_utils.h 2012-03-22 16:52:33.582363931 +0800
  2723. +++ FroyVisuals/jni/libvisual/lv_utils.h    2012-03-02 22:05:29.451672444 +0800
  2724. @@ -24,7 +24,7 @@
  2725.  #ifndef _LV_UTILS_H
  2726.  #define _LV_UTILS_H
  2727.  
  2728. -#include <libvisual/lv_common.h>
  2729. +#include "lv_common.h"
  2730.  
  2731.  VISUAL_BEGIN_DECLS
  2732.  
  2733. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_video.c FroyVisuals/jni/libvisual/lv_video.c
  2734. --- libvisual.master/libvisual/libvisual/lv_video.c 2012-03-23 03:45:36.209350718 +0800
  2735. +++ FroyVisuals/jni/libvisual/lv_video.c    2012-03-07 07:53:09.766566422 +0800
  2736. @@ -249,6 +249,11 @@
  2737.  int visual_video_free_buffer (VisVideo *video)
  2738.  {
  2739.     visual_log_return_val_if_fail (video != NULL, -VISUAL_ERROR_VIDEO_NULL);
  2740. +    if(!visual_video_get_pixels(video))
  2741. +    {
  2742. +        int *tmp = NULL;
  2743. +        *tmp = 0;
  2744. +    }
  2745.     visual_log_return_val_if_fail (visual_video_get_pixels (video) != NULL, -VISUAL_ERROR_VIDEO_PIXELS_NULL);
  2746.  
  2747.     if (video->pixel_rows != NULL)
  2748. @@ -1441,16 +1446,23 @@
  2749.     } else if (dest->depth == VISUAL_VIDEO_DEPTH_16BIT) {
  2750.  
  2751.         for (y = 0; y < src->height; y++) {
  2752. -           _color16 *destr = (_color16 *) destbuf;
  2753. -           _color16 *srcr = (_color16 *) srcbuf;
  2754. +           //_color16 *destr = (_color16 *) destbuf;
  2755. +           //_color16 *srcr = (_color16 *) srcbuf;
  2756. +            _color16 destr;
  2757. +            _color16 srcr;
  2758. +            int cnt = 0;
  2759.  
  2760.             for (x = 0; x < src->width; x++) {
  2761. -               destr->r = ((alpha * (srcr->r - destr->r) >> 8) + destr->r);
  2762. -               destr->g = ((alpha * (srcr->g - destr->g) >> 8) + destr->g);
  2763. -               destr->b = ((alpha * (srcr->b - destr->b) >> 8) + destr->b);
  2764. -
  2765. -               destr += 1;
  2766. -               srcr += 1;
  2767. +                memcpy(&srcr, srcbuf + cnt, sizeof(_color16));
  2768. +               memcpy(&destr, destbuf + cnt, sizeof(_color16));
  2769. +               destr.r = ((alpha * (srcr.r - destr.r) >> 8) + destr.r);
  2770. +               destr.g = ((alpha * (srcr.g - destr.g) >> 8) + destr.g);
  2771. +               destr.b = ((alpha * (srcr.b - destr.b) >> 8) + destr.b);
  2772. +                memcpy(destbuf + cnt, &destr, sizeof(uint8_t) * 2);
  2773. +
  2774. +               //destr += 1;
  2775. +               //srcr += 1;
  2776. +                cnt += 1;
  2777.             }
  2778.  
  2779.             destbuf += dest->pitch;
  2780. @@ -1495,9 +1507,10 @@
  2781.  
  2782.  static int blit_overlay_surfacealphacolorkey (VisVideo *dest, VisVideo *src)
  2783.  {
  2784. +    visual_log(VISUAL_LOG_DEBUG, "blit_overlay_surfacealphacolorkey");
  2785.     int x, y;
  2786. -   uint8_t *destbuf = visual_video_get_pixels (dest);
  2787. -   uint8_t *srcbuf = visual_video_get_pixels (src);
  2788. +   uint8_t *destbuf __attribute__ ((__aligned__(4)))  = visual_video_get_pixels (dest);
  2789. +   uint8_t *srcbuf __attribute__ ((__aligned__(4))) = visual_video_get_pixels (src);
  2790.     uint8_t alpha = src->density;
  2791.  
  2792.     if (dest->depth == VISUAL_VIDEO_DEPTH_8BIT) {
  2793. @@ -1528,18 +1541,22 @@
  2794.         uint16_t color = visual_color_to_uint16 (&src->colorkey);
  2795.  
  2796.         for (y = 0; y < src->height; y++) {
  2797. -           _color16 *destr = (_color16 *) destbuf;
  2798. -           _color16 *srcr = (_color16 *) srcbuf;
  2799. +           _color16 destr;// = (_color16 *) destbuf;
  2800. +           _color16 srcr;// = (_color16 *) srcbuf;
  2801. +            int cnt = 0;
  2802.  
  2803.             for (x = 0; x < src->width; x++) {
  2804. -               if (color != *((uint16_t *) srcr)) {
  2805. -                   destr->r = ((alpha * (srcr->r - destr->r) >> 8) + destr->r);
  2806. -                   destr->g = ((alpha * (srcr->g - destr->g) >> 8) + destr->g);
  2807. -                   destr->b = ((alpha * (srcr->b - destr->b) >> 8) + destr->b);
  2808. -               }
  2809. -
  2810. -               destr++;
  2811. -               srcr++;
  2812. +                memcpy(&srcr, srcbuf + cnt, sizeof(_color16));
  2813. +               memcpy(&destr, destbuf + cnt, sizeof(_color16));
  2814. +               if (color != *((uint16_t *) &srcr)) {
  2815. +                   destr.r = ((alpha * (srcr.r - destr.r) >> 8) + destr.r);
  2816. +                   destr.g = ((alpha * (srcr.g - destr.g) >> 8) + destr.g);
  2817. +                   destr.b = ((alpha * (srcr.b - destr.b) >> 8) + destr.b);
  2818. +               }
  2819. +                memcpy(destbuf + cnt, &destr, sizeof(uint16_t));
  2820. +                cnt++;
  2821. +               //destr++;
  2822. +               //srcr++;
  2823.             }
  2824.  
  2825.             destbuf += dest->pitch;
  2826. @@ -1572,7 +1589,12 @@
  2827.  
  2828.         for (y = 0; y < src->height; y++) {
  2829.             for (x = 0; x < src->width; x++) {
  2830. -               if (color == *((uint32_t *) destbuf)) {
  2831. +                int b = destbuf[0];
  2832. +                int g = destbuf[1];
  2833. +                int r = destbuf[2];
  2834. +                int a = destbuf[3];
  2835. +                int point = b | g | r | a;
  2836. +               if (color == point) {
  2837.                     *destbuf = ((alpha * (*srcbuf - *destbuf) >> 8) + *destbuf);
  2838.                     *(destbuf + 1) = ((alpha * (*(srcbuf + 1) - *(destbuf + 1)) >> 8) + *(destbuf + 1));
  2839.                     *(destbuf + 2) = ((alpha * (*(srcbuf + 2) - *(destbuf + 2)) >> 8) + *(destbuf + 2));
  2840. @@ -1701,7 +1723,7 @@
  2841.  int visual_video_fill_color (VisVideo *video, VisColor *rcolor)
  2842.  {
  2843.     VisColor color;
  2844. -   VisRectangle rect;
  2845. +   //VisRectangle rect;
  2846.  
  2847.     visual_log_return_val_if_fail (video != NULL, -VISUAL_ERROR_VIDEO_NULL);
  2848.  
  2849. @@ -1763,6 +1785,7 @@
  2850.  
  2851.     errret = visual_video_fill_color (&svid, color);
  2852.  
  2853. +//out:
  2854.     visual_object_unref (VISUAL_OBJECT (&svid));
  2855.  
  2856.     return errret;
  2857. @@ -1805,6 +1828,8 @@
  2858.  
  2859.  static int fill_color24 (VisVideo *video, VisColor *color)
  2860.  {
  2861. +    visual_log(VISUAL_LOG_DEBUG, "fill_color24 ------------------------------------------ ");
  2862. +
  2863.     int x, y;
  2864.     uint32_t *buf;
  2865.     uint8_t *rbuf = visual_video_get_pixels (video);
  2866. @@ -1827,12 +1852,17 @@
  2867.         (color->r);
  2868.  
  2869.     for (y = 0; y < video->height; y++) {
  2870. -       buf = (uint32_t *) rbuf;
  2871. +       buf = malloc(video->pitch);//(uint32_t *) rbuf;
  2872. +
  2873. +        memcpy(buf, rbuf, video->pitch);
  2874.  
  2875.         for (x = video->width; x >= video->bpp; x -= video->bpp) {
  2876. -           *(buf++) = cola;
  2877. -           *(buf++) = colb;
  2878. -           *(buf++) = colc;
  2879. +            uint8_t b = rbuf[0];
  2880. +            uint8_t g = rbuf[1];
  2881. +            uint8_t r = rbuf[2];
  2882. +           *(rbuf++) = cola;
  2883. +           *(rbuf++) = colb;
  2884. +           *(rbuf++) = colc;
  2885.         }
  2886.  
  2887.         buf8 = (uint8_t *) buf;
  2888. @@ -1842,6 +1872,8 @@
  2889.  
  2890.  
  2891.         rbuf += video->pitch;
  2892. +
  2893. +        free(buf);
  2894.     }
  2895.  
  2896.     return VISUAL_OK;
  2897. @@ -2624,6 +2656,7 @@
  2898.     return VISUAL_OK;
  2899.  }
  2900.  
  2901. +
  2902.  static int depth_transform_32_to_24_c (VisVideo *dest, VisVideo *src)
  2903.  {
  2904.     int x, y;
  2905. @@ -2711,7 +2744,7 @@
  2906.  {
  2907.     uint8_t *destbuf, *srcbuf;
  2908.     int x, y;
  2909. -   int i = 0;
  2910. +   //int i = 0;
  2911.     int pitchdiff = dest->pitch - (dest->width * dest->bpp);
  2912.  
  2913.     destbuf = visual_video_get_pixels (dest);
  2914. @@ -3164,7 +3197,7 @@
  2915.         u = 0;
  2916.  
  2917.         for (x = dest->width - 1; x--; u += du) {
  2918. -           uint8_t cul, cll, cur, clr, b;
  2919. +           uint8_t cul, cll, cur, clr;
  2920.             uint32_t ul, ll, ur, lr; /* fixed point 16.16 [0,1[   */
  2921.             uint32_t b0; /* fixed point 16.16 [0,255[ */
  2922.  
  2923. @@ -3227,7 +3260,7 @@
  2924.         for (x = dest->width - 1; x--; u += du) {
  2925.             _color16 cul, cll, cur, clr, b;
  2926.             uint32_t ul, ll, ur, lr; /* fixed point 16.16 [0,1[   */
  2927. -           uint32_t b3, b2, b1, b0; /* fixed point 16.16 [0,255[ */
  2928. +           uint32_t b2, b1, b0; /* fixed point 16.16 [0,255[ */
  2929.  
  2930.             /* fracU = frac(u) = u & 0xffff */
  2931.             /* fixed point format convertion: fracU >>= 8) */
  2932. @@ -3302,7 +3335,7 @@
  2933.         for (x = dest->width - 1; x--; u += du) {
  2934.             _color24 cul, cll, cur, clr, b;
  2935.             uint32_t ul, ll, ur, lr; /* fixed point 16.16 [0,1[   */
  2936. -           uint32_t b3, b2, b1, b0; /* fixed point 16.16 [0,255[ */
  2937. +           uint32_t b2, b1, b0; /* fixed point 16.16 [0,255[ */
  2938.  
  2939.             /* fracU = frac(u) = u & 0xffff */
  2940.             /* fixed point format convertion: fracU >>= 8) */
  2941. diff -aurb --exclude '*.mk' --exclude '*.a' --exclude examples --exclude .git --exclude CHANGELOG --exclude COPYING --exclude '.hg*' libvisual.master/libvisual/libvisual/lv_video.h FroyVisuals/jni/libvisual/lv_video.h
  2942. --- libvisual.master/libvisual/libvisual/lv_video.h 2012-03-22 16:52:33.582363931 +0800
  2943. +++ FroyVisuals/jni/libvisual/lv_video.h    2012-03-02 22:05:29.451672444 +0800
  2944. @@ -27,11 +27,11 @@
  2945.  #ifndef _LV_VIDEO_H
  2946.  #define _LV_VIDEO_H
  2947.  
  2948. -#include <libvisual/lv_common.h>
  2949. -#include <libvisual/lv_palette.h>
  2950. -#include <libvisual/lv_rectangle.h>
  2951. -#include <libvisual/lv_buffer.h>
  2952. -#include <libvisual/lv_gl.h>
  2953. +#include "lv_common.h"
  2954. +#include "lv_palette.h"
  2955. +#include "lv_rectangle.h"
  2956. +#include "lv_buffer.h"
  2957. +#include "lv_gl.h"
  2958.  
  2959.  VISUAL_BEGIN_DECLS
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top