Created
March 23, 2012 14:03
-
-
Save kaixiong/2170935 to your computer and use it in GitHub Desktop.
FroyVisuals <-> LV diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
--- libvisual.master/libvisual/libvisual/libvisual.h 2012-03-22 16:52:33.558363930 +0800 | |
+++ FroyVisuals/jni/libvisual/libvisual.h 2012-03-02 22:05:29.427672445 +0800 | |
@@ -24,46 +24,46 @@ | |
#ifndef LV_LIBVISUAL_H | |
#define LV_LIBVISUAL_H | |
-#include <libvisual/lvconfig.h> | |
+#include "lvconfig.h" | |
-#include <libvisual/lv_bits.h> | |
-#include <libvisual/lv_time.h> | |
-#include <libvisual/lv_color.h> | |
-#include <libvisual/lv_param.h> | |
-#include <libvisual/lv_config.h> | |
-#include <libvisual/lv_cpu.h> | |
-#include <libvisual/lv_bin.h> | |
-#include <libvisual/lv_event.h> | |
-#include <libvisual/lv_keysym.h> | |
-#include <libvisual/lv_actor.h> | |
-#include <libvisual/lv_input.h> | |
-#include <libvisual/lv_audio.h> | |
-#include <libvisual/lv_fourier.h> | |
-#include <libvisual/lv_list.h> | |
-#include <libvisual/lv_palette.h> | |
-#include <libvisual/lv_plugin.h> | |
-#include <libvisual/lv_video.h> | |
-#include <libvisual/lv_libvisual.h> | |
-#include <libvisual/lv_songinfo.h> | |
-#include <libvisual/lv_morph.h> | |
-#include <libvisual/lv_transform.h> | |
-#include <libvisual/lv_bmp.h> | |
-#include <libvisual/lv_log.h> | |
-#include <libvisual/lv_random.h> | |
-#include <libvisual/lv_ui.h> | |
-#include <libvisual/lv_collection.h> | |
-#include <libvisual/lv_hashmap.h> | |
-#include <libvisual/lv_cache.h> | |
-#include <libvisual/lv_ringbuffer.h> | |
-#include <libvisual/lv_rectangle.h> | |
-#include <libvisual/lv_error.h> | |
-#include <libvisual/lv_thread.h> | |
-#include <libvisual/lv_object.h> | |
-#include <libvisual/lv_types.h> | |
-#include <libvisual/lv_utils.h> | |
-#include <libvisual/lv_gl.h> | |
-#include <libvisual/lv_math.h> | |
-#include <libvisual/lv_os.h> | |
-#include <libvisual/lv_common.h> | |
+#include "lv_bits.h" | |
+#include "lv_time.h" | |
+#include "lv_color.h" | |
+#include "lv_param.h" | |
+#include "lv_config.h" | |
+#include "lv_cpu.h" | |
+#include "lv_bin.h" | |
+#include "lv_event.h" | |
+#include "lv_keysym.h" | |
+#include "lv_actor.h" | |
+#include "lv_input.h" | |
+#include "lv_audio.h" | |
+#include "lv_fourier.h" | |
+#include "lv_list.h" | |
+#include "lv_palette.h" | |
+#include "lv_plugin.h" | |
+#include "lv_video.h" | |
+#include "lv_libvisual.h" | |
+#include "lv_songinfo.h" | |
+#include "lv_morph.h" | |
+#include "lv_transform.h" | |
+#include "lv_bmp.h" | |
+#include "lv_log.h" | |
+#include "lv_random.h" | |
+#include "lv_ui.h" | |
+#include "lv_collection.h" | |
+#include "lv_hashmap.h" | |
+#include "lv_cache.h" | |
+#include "lv_ringbuffer.h" | |
+#include "lv_rectangle.h" | |
+#include "lv_error.h" | |
+#include "lv_thread.h" | |
+#include "lv_object.h" | |
+#include "lv_types.h" | |
+#include "lv_utils.h" | |
+#include "lv_gl.h" | |
+#include "lv_math.h" | |
+#include "lv_os.h" | |
+#include "lv_common.h" | |
#endif /* LV_LIBVISUAL_H */ | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_actor.c 2012-03-22 16:52:33.562363930 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_actor.c 2012-03-02 22:05:29.427672445 +0800 | |
@@ -499,6 +499,7 @@ | |
*/ | |
int visual_actor_video_negotiate (VisActor *actor, int rundepth, int noevent, int forced) | |
{ | |
+visual_log(VISUAL_LOG_INFO, "start negotiate"); | |
int depthflag; | |
visual_log_return_val_if_fail (actor != NULL, -VISUAL_ERROR_ACTOR_NULL); | |
@@ -531,11 +532,15 @@ | |
/* Set up depth transformation enviroment */ | |
if (visual_video_depth_is_supported (depthflag, actor->video->depth) != TRUE || | |
(forced == TRUE && actor->video->depth != rundepth)) | |
+ { | |
/* When the depth is not supported, or if we only switch the depth and not | |
* the size */ | |
+visual_log(VISUAL_LOG_INFO, "negotiate video 1"); | |
return negotiate_video_with_unsupported_depth (actor, rundepth, noevent, forced); | |
- else | |
+ } else { | |
+visual_log(VISUAL_LOG_INFO, "negotiate video 2"); | |
return negotiate_video (actor, noevent); | |
+ } | |
return -VISUAL_ERROR_IMPOSSIBLE; | |
} | |
@@ -731,7 +736,7 @@ | |
} | |
/* Songinfo handling */ | |
- if (visual_songinfo_compare (&actor->songcompare, &actplugin->songinfo) == FALSE || | |
+ if(0) /*FIXME*/if (visual_songinfo_compare (&actor->songcompare, &actplugin->songinfo) == FALSE || | |
actor->songcompare.elapsed != actplugin->songinfo.elapsed) { | |
visual_songinfo_mark (&actplugin->songinfo); | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_actor.h 2012-03-22 16:52:33.562363930 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_actor.h 2012-03-02 22:05:29.427672445 +0800 | |
@@ -24,12 +24,12 @@ | |
#ifndef _LV_ACTOR_H | |
#define _LV_ACTOR_H | |
-#include <libvisual/lv_audio.h> | |
-#include <libvisual/lv_video.h> | |
-#include <libvisual/lv_palette.h> | |
-#include <libvisual/lv_plugin.h> | |
-#include <libvisual/lv_songinfo.h> | |
-#include <libvisual/lv_event.h> | |
+#include "lv_audio.h" | |
+#include "lv_video.h" | |
+#include "lv_palette.h" | |
+#include "lv_plugin.h" | |
+#include "lv_songinfo.h" | |
+#include "lv_event.h" | |
VISUAL_BEGIN_DECLS | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_audio.c 2012-03-23 07:27:47.249005996 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_audio.c 2012-03-02 22:05:29.427672445 +0800 | |
@@ -40,8 +40,8 @@ | |
static int audio_samplepool_channel_dtor (VisObject *object); | |
static int audio_sample_dtor (VisObject *object); | |
-static int audio_band_total (VisAudio *audio, int begin, int end); | |
-static int audio_band_energy (VisAudio *audio, int band, int length); | |
+//static int audio_band_total (VisAudio *audio, int begin, int end); | |
+//static int audio_band_energy (VisAudio *audio, int band, int length); | |
/* Format transform functions */ | |
static int transform_format_buffer_from_float (VisBuffer *dest, VisBuffer *src, int size, int sign); | |
@@ -116,10 +116,11 @@ | |
} | |
+/* | |
static int audio_band_total (VisAudio *audio, int begin, int end) | |
{ | |
int bpmtotal = 0; | |
- int i; | |
+ //int i; | |
// for (i = begin; i < end; i++) | |
// bpmtotal += audio->freq[2][i]; | |
@@ -129,11 +130,13 @@ | |
else | |
return 0; | |
} | |
+*/ | |
+/* | |
static int audio_band_energy (VisAudio *audio, int band, int length) | |
{ | |
int energytotal = 0; | |
- int i; | |
+ //int i; | |
// for (i = 0; i < length; i++) | |
// energytotal += audio->bpmhistory[i][band]; | |
@@ -143,6 +146,7 @@ | |
else | |
return 0; | |
} | |
+*/ | |
/** | |
* @defgroup VisAudio VisAudio | |
@@ -212,11 +216,11 @@ | |
*/ | |
int visual_audio_analyze (VisAudio *audio) | |
{ | |
- float temp_out[256]; | |
- float temp_audio[2][512]; | |
+ //float temp_out[256]; | |
+ //float temp_audio[2][512]; | |
short pcm[3][1024]; | |
- double scale; | |
- int i, j, y; | |
+ //double scale; | |
+ //int i, j, y; | |
visual_log_return_val_if_fail (audio != NULL, -VISUAL_ERROR_AUDIO_NULL); | |
@@ -561,7 +565,7 @@ | |
int ret; | |
float *data; | |
int datasize; | |
- int i; | |
+ //int i; | |
visual_log_return_val_if_fail (audio != NULL, -VISUAL_ERROR_AUDIO_NULL); | |
visual_log_return_val_if_fail (buffer != NULL, -VISUAL_ERROR_BUFFER_NULL); | |
@@ -603,7 +607,7 @@ | |
int ret; | |
float *data; | |
int datasize; | |
- int i; | |
+ //int i; | |
visual_log_return_val_if_fail (buffer != NULL, -VISUAL_ERROR_BUFFER_NULL); | |
visual_log_return_val_if_fail (sample != NULL, -VISUAL_ERROR_BUFFER_NULL); | |
@@ -1564,7 +1568,7 @@ | |
visual_log_return_val_if_fail(audio != NULL, -VISUAL_ERROR_AUDIO_NULL); | |
VisBuffer pcm; | |
- float buffer[BEAT_MAX_SIZE], *p; | |
+ float buffer[BEAT_MAX_SIZE]; | |
unsigned char visdata[BEAT_MAX_SIZE]; | |
int i; | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_audio.h 2012-03-22 16:52:33.562363930 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_audio.h 2012-03-02 22:05:29.427672445 +0800 | |
@@ -24,11 +24,11 @@ | |
#ifndef _LV_AUDIO_H | |
#define _LV_AUDIO_H | |
-#include <libvisual/lv_fourier.h> | |
-#include <libvisual/lv_time.h> | |
-#include <libvisual/lv_ringbuffer.h> | |
-#include <libvisual/lv_hashmap.h> | |
-#include <libvisual/lv_beat.h> | |
+#include "lv_fourier.h" | |
+#include "lv_time.h" | |
+#include "lv_ringbuffer.h" | |
+#include "lv_hashmap.h" | |
+#include "lv_beat.h" | |
VISUAL_BEGIN_DECLS | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_beat.c 2012-03-22 16:52:33.562363930 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_beat.c 2012-03-02 22:05:29.427672445 +0800 | |
@@ -5,7 +5,7 @@ | |
* Authors: Scott Sibley <scott@starlon.net> | |
* Adapted from Winamp's AVS plugin. See below. | |
* | |
- * $Id$ | |
+ * $Id: lv_beat.c 1548 2011-05-25 13:27:05Z starlon $ | |
* | |
* This program is free software; you can redistribute it and/or modify | |
* it under the terms of the GNU Lesser General Public License as | |
@@ -774,7 +774,6 @@ | |
{ | |
visual_log_return_val_if_fail(beat != NULL, FALSE); | |
- int i=0; | |
int offI; | |
clock_t thisLen; | |
int learning = beat_ready_to_learn(beat); | |
@@ -878,7 +877,6 @@ | |
double sc=0; | |
int mx=0; | |
float et; | |
- int smSum=0, smN=0; | |
if (!beat_ready_to_learn(beat)) | |
return; | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_beat.h 2012-03-22 16:52:33.562363930 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_beat.h 2012-03-02 22:05:29.427672445 +0800 | |
@@ -5,7 +5,7 @@ | |
* Authors: Scott Sibley <scott@starlon.net> | |
* Adapted from Winamp's AVS plugin. See below. | |
* | |
- * $Id$ | |
+ * $Id: lv_beat.h 1551 2011-05-26 04:45:10Z starlon $ | |
* | |
* This program is free software; you can redistribute it and/or modify | |
* it under the terms of the GNU Lesser General Public License as | |
@@ -54,7 +54,7 @@ | |
#ifndef _LV_BEAT_H | |
#define _LV_BEAT_H | |
-#include <libvisual/lv_time.h> | |
+#include "lv_time.h" | |
VISUAL_BEGIN_DECLS | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_bin.c 2012-03-22 16:52:33.562363930 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_bin.c 2012-03-02 22:05:29.427672445 +0800 | |
@@ -231,11 +231,34 @@ | |
int visual_bin_connect (VisBin *bin, VisActor *actor, VisInput *input) | |
{ | |
+ int depthflag; | |
+ int depth; | |
+ | |
visual_log_return_val_if_fail (bin != NULL, -1); | |
+ visual_log_return_val_if_fail(actor != NULL, -1); | |
+ visual_log_return_val_if_fail(input != NULL, -1); | |
visual_bin_set_actor (bin, actor); | |
visual_bin_set_input (bin, input); | |
+ depthflag = visual_actor_get_supported_depth(actor); | |
+ | |
+ if(depthflag == VISUAL_VIDEO_DEPTH_GL) | |
+ visual_bin_set_depth(bin, VISUAL_VIDEO_DEPTH_GL); | |
+ else | |
+ { | |
+ depth = bin_get_depth_using_preferred(bin, depthflag); | |
+ | |
+ if((bin->depthflag & depth) > 0) | |
+ visual_bin_set_depth(bin, depth); | |
+ else { | |
+ visual_bin_set_depth(bin, | |
+ visual_video_depth_get_highest_nogl(bin->depthflag)); | |
+ } | |
+ } | |
+ | |
+ bin->depthforcedmain = bin->depth; | |
+ | |
return 0; | |
} | |
@@ -279,7 +302,8 @@ | |
visual_log_return_val_if_fail (input != NULL, -1); | |
/* Connect */ | |
- visual_bin_connect (bin, actor, input); | |
+ visual_bin_set_actor (bin, actor); | |
+ visual_bin_set_input (bin, input); | |
bin->managed = TRUE; | |
bin->inputmanaged = TRUE; | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_bin.h 2012-03-22 16:52:33.562363930 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_bin.h 2012-03-02 22:05:29.427672445 +0800 | |
@@ -24,11 +24,11 @@ | |
#ifndef _LV_BIN_H | |
#define _LV_BIN_H | |
-#include <libvisual/lv_actor.h> | |
-#include <libvisual/lv_input.h> | |
-#include <libvisual/lv_morph.h> | |
-#include <libvisual/lv_video.h> | |
-#include <libvisual/lv_time.h> | |
+#include "lv_actor.h" | |
+#include "lv_input.h" | |
+#include "lv_morph.h" | |
+#include "lv_video.h" | |
+#include "lv_time.h" | |
VISUAL_BEGIN_DECLS | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_bits.h 2012-03-22 16:52:33.562363930 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_bits.h 2012-03-02 22:05:29.431672444 +0800 | |
@@ -24,8 +24,8 @@ | |
#ifndef _LV_ENDIANESS_H | |
#define _LV_ENDIANESS_H | |
-#include <libvisual/lvconfig.h> | |
-#include <libvisual/lv_defines.h> | |
+#include "lvconfig.h" | |
+#include "lv_defines.h" | |
VISUAL_BEGIN_DECLS | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_bmp.c 2012-03-23 03:52:20.013340280 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_bmp.c 2012-03-02 22:05:29.431672444 +0800 | |
@@ -72,7 +72,7 @@ | |
while (data > (uint8_t *) visual_video_get_pixels (video)) { | |
/* Unpack 4 bpp pixels aka 2 pixels per byte */ | |
uint8_t *col = data - video->pitch; | |
- uint8_t *end = (uint8_t *) ((intptr_t)data & ~1); | |
+ uint8_t *end = (uint8_t *) ((int)data & ~1); | |
data = col; | |
while (col < end) { | |
@@ -93,7 +93,7 @@ | |
while (data > (uint8_t *) visual_video_get_pixels (video)) { | |
/* Unpack 1 bpp pixels aka 8 pixels per byte */ | |
uint8_t *col = data - video->pitch; | |
- uint8_t *end = (uint8_t *) ((intptr_t)data & ~7); | |
+ uint8_t *end = (uint8_t *) ((int)data & ~7); | |
data = col; | |
while (col < end) { | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_bmp.h 2012-03-22 16:52:33.562363930 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_bmp.h 2012-03-02 22:05:29.431672444 +0800 | |
@@ -24,7 +24,7 @@ | |
#ifndef _LV_BMP_H | |
#define _LV_BMP_H | |
-#include <libvisual/lv_video.h> | |
+#include "lv_video.h" | |
VISUAL_BEGIN_DECLS | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_buffer.h 2012-03-22 16:52:33.566363930 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_buffer.h 2012-03-02 22:05:29.431672444 +0800 | |
@@ -24,7 +24,7 @@ | |
#ifndef _LV_BUFFER_H | |
#define _LV_BUFFER_H | |
-#include <libvisual/lv_common.h> | |
+#include "lv_common.h" | |
VISUAL_BEGIN_DECLS | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_cache.c 2012-03-22 16:52:33.566363930 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_cache.c 2012-03-02 22:05:29.431672444 +0800 | |
@@ -278,7 +278,7 @@ | |
return centry->data; | |
} | |
-static int visual_cache_get_size (VisCache *cache) | |
+int visual_cache_get_size (VisCache *cache) | |
{ | |
visual_log_return_val_if_fail (cache != NULL, -VISUAL_ERROR_CACHE_NULL); | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_cache.h 2012-03-22 16:52:33.566363930 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_cache.h 2012-03-02 22:05:29.431672444 +0800 | |
@@ -24,10 +24,10 @@ | |
#ifndef _LV_CACHE_H | |
#define _LV_CACHE_H | |
-#include <libvisual/lv_common.h> | |
-#include <libvisual/lv_time.h> | |
-#include <libvisual/lv_list.h> | |
-#include <libvisual/lv_hashmap.h> | |
+#include "lv_common.h" | |
+#include "lv_time.h" | |
+#include "lv_list.h" | |
+#include "lv_hashmap.h" | |
VISUAL_BEGIN_DECLS | |
@@ -82,7 +82,7 @@ | |
void *visual_cache_get (VisCache *cache, char *key); | |
-int visual_cache_size (VisCache *cache); | |
+int visual_cache_get_size (VisCache *cache); | |
int visual_cache_set_limits (VisCache *cache, int size, VisTime *maxage); | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_collection.c 2012-03-22 16:52:33.566363930 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_collection.c 2012-03-02 22:05:29.431672444 +0800 | |
@@ -28,9 +28,9 @@ | |
#include "lv_common.h" | |
#include "lv_collection.h" | |
-static int collection_iter_dtor (VisObject *object); | |
+int collection_iter_dtor (VisObject *object); | |
-static int collection_iter_dtor (VisObject *object) | |
+int collection_iter_dtor (VisObject *object) | |
{ | |
VisCollectionIter *iter = VISUAL_COLLECTIONITER (object); | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_collection.h 2012-03-22 16:52:33.566363930 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_collection.h 2012-03-02 22:05:29.431672444 +0800 | |
@@ -24,7 +24,7 @@ | |
#ifndef _LV_COLLECTION_H | |
#define _LV_COLLECTION_H | |
-#include <libvisual/lv_common.h> | |
+#include "lv_common.h" | |
VISUAL_BEGIN_DECLS | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_color.c 2012-03-22 16:52:33.566363930 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_color.c 2012-03-02 22:05:29.431672444 +0800 | |
@@ -30,7 +30,7 @@ | |
#include "lv_color.h" | |
typedef struct { | |
- uint16_t b:5, g:6, r:5, a:6; | |
+ uint16_t b:5, g:6, r:5; | |
} _color16; | |
@@ -272,7 +272,6 @@ | |
color->r = colors->r << 2; | |
color->g = colors->g << 3; | |
color->b = colors->b << 2; | |
- color->a = colors->a << 3; | |
return VISUAL_OK; | |
} | |
@@ -300,7 +299,6 @@ | |
colors.r = color->r >> 2; | |
colors.g = color->g >> 3; | |
colors.b = color->b >> 2; | |
- colors.a = color->a >> 3; | |
return *((uint16_t *) &colors); | |
} | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_color.h 2012-03-22 16:52:33.566363930 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_color.h 2012-03-02 22:05:29.431672444 +0800 | |
@@ -24,7 +24,7 @@ | |
#ifndef _LV_COLOR_H | |
#define _LV_COLOR_H | |
-#include <libvisual/lv_common.h> | |
+#include "lv_common.h" | |
VISUAL_BEGIN_DECLS | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_common.h 2012-03-22 16:52:33.566363930 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_common.h 2012-03-02 22:05:29.431672444 +0800 | |
@@ -24,12 +24,12 @@ | |
#ifndef _LV_COMMON_H | |
#define _LV_COMMON_H | |
-#include <libvisual/lv_defines.h> | |
+#include "lv_defines.h" | |
-#include <libvisual/lv_mem.h> | |
-#include <libvisual/lv_log.h> | |
-#include <libvisual/lv_error.h> | |
-#include <libvisual/lv_types.h> | |
-#include <libvisual/lv_object.h> | |
+#include "lv_mem.h" | |
+#include "lv_log.h" | |
+#include "lv_error.h" | |
+#include "lv_types.h" | |
+#include "lv_object.h" | |
#endif /* _LV_COMMON_H */ | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_config.h 2012-03-22 16:52:33.566363930 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_config.h 2012-03-02 22:05:29.431672444 +0800 | |
@@ -24,8 +24,8 @@ | |
#ifndef _LV_CONFIG_H | |
#define _LV_CONFIG_H | |
-#include <libvisual/lv_common.h> | |
-#include <libvisual/lv_list.h> | |
+#include "lv_common.h" | |
+#include "lv_list.h" | |
VISUAL_BEGIN_DECLS | |
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 | |
--- libvisual.master/libvisual/libvisual/lvconfig.h 2012-03-22 17:05:05.670344483 +0800 | |
+++ FroyVisuals/jni/libvisual/lvconfig.h 2012-03-02 22:05:29.455672444 +0800 | |
@@ -23,8 +23,8 @@ | |
#define VISUAL_BIG_ENDIAN (0) | |
#define VISUAL_LITTLE_ENDIAN (1) | |
-typedef unsigned long visual_size_t; | |
-#define VISUAL_SIZE_T_FORMAT "lu" | |
+typedef unsigned int visual_size_t; | |
+#define VISUAL_SIZE_T_FORMAT "u" | |
#define VISUAL_OS_LINUX | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_cpu.c 2012-03-23 04:39:57.313266392 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_cpu.c 2012-03-07 07:53:09.766566422 +0800 | |
@@ -57,7 +57,10 @@ | |
#include <windows.h> | |
#endif | |
-#include <config.h> | |
+#if defined(VISUAL_ARCH_ARM) | |
+#include <cpu-features.h> | |
+#endif | |
+ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
@@ -72,8 +75,10 @@ | |
static VisCPU __lv_cpu_caps; | |
static int __lv_cpu_initialized = FALSE; | |
+#if defined(VISUAL_ARCH_X86) | |
static int has_cpuid (void); | |
static int cpuid (unsigned int ax, unsigned int *p); | |
+#endif | |
/* The sigill handlers */ | |
#if defined(VISUAL_ARCH_X86) //x86 (linux katmai handler check thing) | |
@@ -183,7 +188,7 @@ | |
* and RedHat patched 2.2 kernels that have broken exception handling | |
* support for user space apps that do SSE. | |
*/ | |
-static void check_os_katmai_support( void ) | |
+void check_os_katmai_support( void ) | |
{ | |
// printf ("omg\n"); | |
#if defined(VISUAL_ARCH_X86) | |
@@ -228,6 +233,7 @@ | |
SetUnhandledExceptionFilter(exc_fil); | |
} | |
#elif defined(VISUAL_OS_LINUX) | |
+#if 0 // FIXME This doesn't seem supported on Android x86? _POSIX_SOURCE is not defined. | |
// printf ("omg1\n"); | |
// printf ("omg2\n"); | |
struct sigaction saved_sigill; | |
@@ -272,7 +278,7 @@ | |
*/ | |
sigaction( SIGILL, &saved_sigill, NULL ); | |
sigaction( SIGFPE, &saved_sigfpe, NULL ); | |
- | |
+#endif | |
#else | |
// printf ("hier dan3\n"); | |
/* We can't use POSIX signal handling to test the availability of | |
@@ -286,9 +292,9 @@ | |
} | |
-static int has_cpuid (void) | |
+#if defined(VISUAL_ARCH_X86) | |
+int has_cpuid (void) | |
{ | |
-#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) | |
int a, c; | |
__asm __volatile | |
@@ -305,14 +311,12 @@ | |
: "cc"); | |
return a != c; | |
-#else | |
- return 0; | |
-#endif | |
} | |
+#endif | |
-static int cpuid (unsigned int ax, unsigned int *p) | |
+#if defined(VISUAL_ARCH_X86) | |
+int cpuid (unsigned int ax, unsigned int *p) | |
{ | |
-#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) | |
uint32_t flags; | |
__asm __volatile | |
@@ -324,10 +328,9 @@ | |
: "0" (ax)); | |
return VISUAL_OK; | |
-#else | |
- return -VISUAL_ERROR_CPU_INVALID_CODE; | |
-#endif | |
+ //return -VISUAL_ERROR_CPU_INVALID_CODE; | |
} | |
+#endif | |
/** | |
* @defgroup VisCPU VisCPU | |
@@ -362,6 +365,8 @@ | |
__lv_cpu_caps.type = VISUAL_CPU_TYPE_X86; | |
#elif defined(VISUAL_ARCH_POWERPC) | |
__lv_cpu_caps.type = VISUAL_CPU_TYPE_POWERPC; | |
+#elif defined(VISUAL_ARCH_ARM) | |
+ __lv_cpu_caps.type = VISUAL_CPU_TYPE_ARM; | |
#else | |
__lv_cpu_caps.type = VISUAL_CPU_TYPE_OTHER; | |
#endif | |
@@ -450,6 +455,22 @@ | |
check_os_altivec_support (); | |
#endif /* VISUAL_ARCH_POWERPC */ | |
+#if defined(VISUAL_ARCH_ARM) | |
+ if(android_getCpuFamily() == ANDROID_CPU_FAMILY_ARM) | |
+ { | |
+ uint64_t type = android_getCpuFeatures(); | |
+ if(type & ANDROID_CPU_ARM_FEATURE_ARMv7) | |
+ __lv_cpu_caps.hasARMv7 = 1; | |
+ if(type & ANDROID_CPU_ARM_FEATURE_VFPv3) | |
+ __lv_cpu_caps.hasVFPv3 = 1; | |
+ if(type & ANDROID_CPU_ARM_FEATURE_NEON) | |
+ __lv_cpu_caps.hasNeon = 1; | |
+ if(type & ANDROID_CPU_ARM_FEATURE_LDREX_STREX) | |
+ __lv_cpu_caps.hasLDREX_STREX = 1; | |
+ __lv_cpu_caps.nrcpu = android_getCpuCount(); | |
+ } | |
+#endif | |
+ | |
/* Synchronizing enabled flags with has flags */ | |
__lv_cpu_caps.enabledTSC = __lv_cpu_caps.hasTSC; | |
__lv_cpu_caps.enabledMMX = __lv_cpu_caps.hasMMX; | |
@@ -459,6 +480,10 @@ | |
__lv_cpu_caps.enabled3DNow = __lv_cpu_caps.has3DNow; | |
__lv_cpu_caps.enabled3DNowExt = __lv_cpu_caps.has3DNowExt; | |
__lv_cpu_caps.enabledAltiVec = __lv_cpu_caps.hasAltiVec; | |
+ __lv_cpu_caps.enabledARMv7 = __lv_cpu_caps.hasARMv7; | |
+ __lv_cpu_caps.enabledVFPv3 = __lv_cpu_caps.hasVFPv3; | |
+ __lv_cpu_caps.enabledNeon = __lv_cpu_caps.hasNeon; | |
+ __lv_cpu_caps.enabledLDREX_STREX = __lv_cpu_caps.hasLDREX_STREX; | |
visual_log (VISUAL_LOG_DEBUG, "CPU: Number of CPUs: %d", __lv_cpu_caps.nrcpu); | |
visual_log (VISUAL_LOG_DEBUG, "CPU: type %d", __lv_cpu_caps.type); | |
@@ -472,6 +497,10 @@ | |
visual_log (VISUAL_LOG_DEBUG, "CPU: 3DNow %d", __lv_cpu_caps.has3DNow); | |
visual_log (VISUAL_LOG_DEBUG, "CPU: 3DNowExt %d", __lv_cpu_caps.has3DNowExt); | |
visual_log (VISUAL_LOG_DEBUG, "CPU: AltiVec %d", __lv_cpu_caps.hasAltiVec); | |
+ visual_log (VISUAL_LOG_DEBUG, "CPU: ARM v7 %d", __lv_cpu_caps.hasARMv7); | |
+ visual_log (VISUAL_LOG_DEBUG, "CPU: ARM VFPv3 %d", __lv_cpu_caps.hasVFPv3); | |
+ visual_log (VISUAL_LOG_DEBUG, "CPU: ARM NEON %d", __lv_cpu_caps.hasNeon); | |
+ visual_log (VISUAL_LOG_DEBUG, "CPU: ARM LDREX_STREX %d", __lv_cpu_caps.hasLDREX_STREX); | |
__lv_cpu_initialized = TRUE; | |
} | |
@@ -596,6 +625,58 @@ | |
} | |
/** | |
+ * Function to retrieve if the ARM v7 feature is enabled. | |
+ * | |
+ * @return Whether altivec is enabled or not. | |
+ */ | |
+int visual_cpu_get_armv7 () | |
+{ | |
+ if (__lv_cpu_initialized == FALSE) | |
+ visual_log (VISUAL_LOG_CRITICAL, _("The VisCPU system is not initialized.")); | |
+ | |
+ return __lv_cpu_caps.enabledARMv7; | |
+} | |
+ | |
+/** | |
+ * Function to retrieve if the ARM VFPv3 feature is enabled. | |
+ * | |
+ * @return Whether altivec is enabled or not. | |
+ */ | |
+int visual_cpu_get_vfpv3 () | |
+{ | |
+ if (__lv_cpu_initialized == FALSE) | |
+ visual_log (VISUAL_LOG_CRITICAL, _("The VisCPU system is not initialized.")); | |
+ | |
+ return __lv_cpu_caps.enabledVFPv3; | |
+} | |
+ | |
+/** | |
+ * Function to retrieve if the ARM Neon feature is enabled. | |
+ * | |
+ * @return Whether altivec is enabled or not. | |
+ */ | |
+int visual_cpu_get_neon () | |
+{ | |
+ if (__lv_cpu_initialized == FALSE) | |
+ visual_log (VISUAL_LOG_CRITICAL, _("The VisCPU system is not initialized.")); | |
+ | |
+ return __lv_cpu_caps.enabledNeon; | |
+} | |
+ | |
+/** | |
+ * Function to retrieve if the ARM LDREX_STREX feature is enabled. | |
+ * | |
+ * @return Whether altivec is enabled or not. | |
+ */ | |
+int visual_cpu_get_ldrex_strex () | |
+{ | |
+ if (__lv_cpu_initialized == FALSE) | |
+ visual_log (VISUAL_LOG_CRITICAL, _("The VisCPU system is not initialized.")); | |
+ | |
+ return __lv_cpu_caps.enabledLDREX_STREX; | |
+} | |
+ | |
+/** | |
* Function to set if the tsc feature should be enabled or not, this function will also check | |
* if the feature is actually available. | |
* | |
@@ -746,6 +827,82 @@ | |
return VISUAL_OK; | |
} | |
+ | |
+/** | |
+ * Function to set if the ARM VFPv3 (hardware floats) feature should be enabled or not, this function will also check | |
+ * if the feature is actually available. | |
+ * | |
+ * @return VISUAL_OK on succes, -VISUAL_ERROR_CPU_FEATURE_NOT_SUPPORTED on failure. | |
+ */ | |
+int visual_cpu_set_armv7 (int enabled) | |
+{ | |
+ if (__lv_cpu_initialized == FALSE) | |
+ visual_log (VISUAL_LOG_CRITICAL, _("The VisCPU system is not initialized.")); | |
+ | |
+ if (__lv_cpu_caps.hasARMv7 == FALSE) | |
+ return -VISUAL_ERROR_CPU_FEATURE_NOT_SUPPORTED; | |
+ | |
+ __lv_cpu_caps.enabledARMv7 = enabled; | |
+ | |
+ return VISUAL_OK; | |
+} | |
+ | |
+/** | |
+ * Function to set if the ARM VFPv3 (hardware floats) feature should be enabled or not, this function will also check | |
+ * if the feature is actually available. | |
+ * | |
+ * @return VISUAL_OK on succes, -VISUAL_ERROR_CPU_FEATURE_NOT_SUPPORTED on failure. | |
+ */ | |
+int visual_cpu_set_vfpv3 (int enabled) | |
+{ | |
+ if (__lv_cpu_initialized == FALSE) | |
+ visual_log (VISUAL_LOG_CRITICAL, _("The VisCPU system is not initialized.")); | |
+ | |
+ if (__lv_cpu_caps.hasVFPv3 == FALSE) | |
+ return -VISUAL_ERROR_CPU_FEATURE_NOT_SUPPORTED; | |
+ | |
+ __lv_cpu_caps.enabledVFPv3 = enabled; | |
+ | |
+ return VISUAL_OK; | |
+} | |
+ | |
+/** | |
+ * Function to set if the ARM Neon feature should be enabled or not, this function will also check | |
+ * if the feature is actually available. | |
+ * | |
+ * @return VISUAL_OK on succes, -VISUAL_ERROR_CPU_FEATURE_NOT_SUPPORTED on failure. | |
+ */ | |
+int visual_cpu_set_neon (int enabled) | |
+{ | |
+ if (__lv_cpu_initialized == FALSE) | |
+ visual_log (VISUAL_LOG_CRITICAL, _("The VisCPU system is not initialized.")); | |
+ | |
+ if (__lv_cpu_caps.hasNeon == FALSE) | |
+ return -VISUAL_ERROR_CPU_FEATURE_NOT_SUPPORTED; | |
+ | |
+ __lv_cpu_caps.enabledNeon = enabled; | |
+ | |
+ return VISUAL_OK; | |
+} | |
+ | |
+/** | |
+ * Function to set if the ARM Neon feature should be enabled or not, this function will also check | |
+ * if the feature is actually available. | |
+ * | |
+ * @return VISUAL_OK on succes, -VISUAL_ERROR_CPU_FEATURE_NOT_SUPPORTED on failure. | |
+ */ | |
+int visual_cpu_set_ldrex_strex (int enabled) | |
+{ | |
+ if (__lv_cpu_initialized == FALSE) | |
+ visual_log (VISUAL_LOG_CRITICAL, _("The VisCPU system is not initialized.")); | |
+ | |
+ if (__lv_cpu_caps.hasLDREX_STREX == FALSE) | |
+ return -VISUAL_ERROR_CPU_FEATURE_NOT_SUPPORTED; | |
+ | |
+ __lv_cpu_caps.enabledLDREX_STREX = enabled; | |
+ | |
+ return VISUAL_OK; | |
+} | |
/** | |
* @} | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_cpu.h 2012-03-22 16:52:33.566363930 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_cpu.h 2012-03-02 22:05:29.431672444 +0800 | |
@@ -25,8 +25,8 @@ | |
#ifndef _LV_CPU_H | |
#define _LV_CPU_H | |
-#include <libvisual/lvconfig.h> | |
-#include <libvisual/lv_common.h> | |
+#include "lvconfig.h" | |
+#include "lv_common.h" | |
VISUAL_BEGIN_DECLS; | |
@@ -39,6 +39,7 @@ | |
VISUAL_CPU_TYPE_SPARC, /**< Running on the sparc architecture. */ | |
VISUAL_CPU_TYPE_X86, /**< Running on the X86 architecture. */ | |
VISUAL_CPU_TYPE_POWERPC, /**< Running on the PowerPC architecture. */ | |
+ VISUAL_CPU_TYPE_ARM, /**< Running on the ARM architecture. */ | |
VISUAL_CPU_TYPE_OTHER /**< Running on an architecture that is not specified. */ | |
} VisCPUType; | |
@@ -66,6 +67,10 @@ | |
int has3DNow; /**< The CPU has the 3dnow feature. */ | |
int has3DNowExt; /**< The CPU has the 3dnowext feature. */ | |
int hasAltiVec; /**< The CPU has the altivec feature. */ | |
+ int hasARMv7; /**<The CPU has the ARM v7 feature. */ | |
+ int hasVFPv3; /**<The CPU has the ARM VFPv3 feature. */ | |
+ int hasNeon; /**<The CPU has the ARM Neon feature. */ | |
+ int hasLDREX_STREX; /**<The CPU has ARM LDREX_STREX feature. */ | |
int enabledTSC; /**< The tsc feature is enabled. */ | |
int enabledMMX; /**< The mmx feature is enabled. */ | |
@@ -75,6 +80,10 @@ | |
int enabled3DNow; /**< The 3dnow feature is enabled. */ | |
int enabled3DNowExt; /**< The 3dnowext feature is enabled. */ | |
int enabledAltiVec; /**< The altivec feature is enabled. */ | |
+ int enabledVFPv3; /**< The ARM hardware floats feature is enabled. */ | |
+ int enabledARMv7; /**< The ARM v7 feature is enabled. */ | |
+ int enabledNeon; /**< The ARM Neon feature is enabled. */ | |
+ int enabledLDREX_STREX; /**< The ARM LDREX_STREX feature is enabled. */ | |
}; | |
void visual_cpu_initialize (void); | |
@@ -88,6 +97,10 @@ | |
int visual_cpu_get_3dnow (void); | |
int visual_cpu_get_3dnow2 (void); | |
int visual_cpu_get_altivec (void); | |
+int visual_cpu_get_armv7 (void); | |
+int visual_cpu_get_vfpv3 (void); | |
+int visual_cpu_get_neon (void); | |
+int visual_cpu_get_ldrex_strex (void); | |
int visual_cpu_set_tsc (int enabled); | |
int visual_cpu_set_mmx (int enabled); | |
@@ -97,6 +110,10 @@ | |
int visual_cpu_set_3dnow (int enabled); | |
int visual_cpu_set_3dnow2 (int enabled); | |
int visual_cpu_set_altivec (int enabled); | |
+int visual_cpu_set_armv7 (int enabled); | |
+int visual_cpu_set_vfpv3 (int enabled); | |
+int visual_cpu_set_neon (int enabled); | |
+int visual_cpu_set_ldrex_strex (int enabled); | |
VISUAL_END_DECLS | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_defines.h 2012-03-22 16:52:33.566363930 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_defines.h 2012-03-02 22:05:29.435672445 +0800 | |
@@ -65,13 +65,13 @@ | |
#if __GNUC__ >= 3 | |
# define inline inline __attribute__ ((always_inline)) | |
# define __malloc __attribute__ ((malloc)) | |
-# define __packed __attribute__ ((packed)) | |
+//# define __packedd __attribute__ ((packed)) | |
# define VIS_LIKELY(x) __builtin_expect (!!(x), 1) | |
# define VIS_UNLIKELY(x) __builtin_expect (!!(x), 0) | |
#else | |
# define inline /* no inline */ | |
# define __malloc /* no malloc */ | |
-# define __packed /* no packed */ | |
+//# define __packedd /* no packed */ | |
# define VIS_LIKELY(x) (x) | |
# define VIS_UNLIKELY(x) (x) | |
#endif | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_error.h 2012-03-22 16:52:33.566363930 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_error.h 2012-03-02 22:05:29.435672445 +0800 | |
@@ -24,7 +24,7 @@ | |
#ifndef _LV_ERROR_H | |
#define _LV_ERROR_H | |
-#include <libvisual/lv_defines.h> | |
+#include "lv_defines.h" | |
VISUAL_BEGIN_DECLS | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_event.h 2012-03-22 16:52:33.566363930 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_event.h 2012-03-02 22:05:29.435672445 +0800 | |
@@ -1,10 +1,10 @@ | |
#ifndef _LV_EVENT_H | |
#define _LV_EVENT_H | |
-#include <libvisual/lv_songinfo.h> | |
-#include <libvisual/lv_video.h> | |
-#include <libvisual/lv_list.h> | |
-#include <libvisual/lv_keysym.h> | |
+#include "lv_songinfo.h" | |
+#include "lv_video.h" | |
+#include "lv_list.h" | |
+#include "lv_keysym.h" | |
VISUAL_BEGIN_DECLS | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_fourier.c 2012-03-23 03:50:31.061343097 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_fourier.c 2012-03-02 22:05:29.435672445 +0800 | |
@@ -37,6 +37,7 @@ | |
#include "lv_utils.h" | |
#include "lv_math.h" | |
#include "lv_fourier.h" | |
+#include "kiss_fft129/kiss_fft.h" | |
/* Log scale settings */ | |
#define AMP_LOG_SCALE_THRESHOLD0 0.001f | |
@@ -474,22 +475,53 @@ | |
* | |
* @return VISUAL_OK on succes, -VISUAL_ERROR_FOURIER_NULL or -VISUAL_ERROR_NULL on failure. | |
*/ | |
+#define NUMFFTS 128 | |
+ | |
int visual_dft_perform (VisDFT *dft, float *output, float *input) | |
{ | |
- unsigned int i; | |
- | |
visual_log_return_val_if_fail (dft != NULL, -VISUAL_ERROR_FOURIER_NULL); | |
visual_log_return_val_if_fail (output != NULL, -VISUAL_ERROR_NULL); | |
visual_log_return_val_if_fail (input != NULL, -VISUAL_ERROR_NULL); | |
+ int nfft=kiss_fft_next_fast_size(dft->spectrum_size); | |
+ int nbytes = sizeof(kiss_fft_cpx) * nfft; | |
+ int isinverse = FALSE, i; | |
+ kiss_fft_cpx *buf = (kiss_fft_cpx*)KISS_FFT_MALLOC(nbytes); | |
+ kiss_fft_cpx *bufout=(kiss_fft_cpx*)KISS_FFT_MALLOC(nbytes); | |
+ kiss_fft_cfg state = kiss_fft_alloc(nfft, isinverse, 0, 0); | |
+ | |
if (dft->brute_force) | |
perform_dft_brute_force (dft, output, input); | |
else | |
perform_fft_radix2_dit (dft, output, input); | |
+/* | |
+ memset(buf, 0, nbytes); | |
+ | |
+ | |
+ for(i=0; i < nfft; ++i) | |
+ { | |
+ buf[i].r = input[i>>1]; | |
+ buf[i].i = input[(i+nfft)>>1]; | |
+ } | |
+ | |
+ for(i = 0; i < NUMFFTS; i++) | |
+ kiss_fft(state, buf, bufout); | |
+ | |
+ for(i = 0; i < nfft; i++) | |
+ { | |
+ dft->real[i] = bufout[i].r; | |
+ dft->imag[i] = bufout[i].i; | |
+ } | |
+*/ | |
+ | |
visual_math_vectorized_complex_to_norm_scale (output, dft->real, dft->imag, | |
- dft->spectrum_size / 2, | |
- 1.0 / dft->spectrum_size); | |
+ dft->spectrum_size / 2, 1.0 / dft->spectrum_size); | |
+ | |
+ free(state); | |
+ free(buf); | |
+ free(bufout); | |
+ kiss_fft_cleanup(); | |
return VISUAL_OK; | |
} | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_fourier.h 2012-03-22 16:52:33.570363930 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_fourier.h 2012-03-02 22:05:29.435672445 +0800 | |
@@ -25,7 +25,7 @@ | |
#ifndef _LV_FOURIER_H | |
#define _LV_FOURIER_H | |
-#include <libvisual/lv_common.h> | |
+#include "lv_common.h" | |
VISUAL_BEGIN_DECLS | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_gl.h 2012-03-22 16:52:33.570363930 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_gl.h 2012-03-02 22:05:29.435672445 +0800 | |
@@ -24,8 +24,8 @@ | |
#ifndef _LV_GL_H | |
#define _LV_GL_H | |
-#include <libvisual/lv_common.h> | |
-#include <libvisual/lv_hashmap.h> | |
+#include "lv_common.h" | |
+#include "lv_hashmap.h" | |
VISUAL_BEGIN_DECLS | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_hashlist.h 2012-03-23 04:21:43.857294668 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_hashlist.h 2012-03-02 22:05:29.435672445 +0800 | |
@@ -24,10 +24,10 @@ | |
#ifndef _LV_HASHLIST_H | |
#define _LV_HASHLIST_H | |
-#include <libvisual/lv_common.h> | |
-#include <libvisual/lv_time.h> | |
-#include <libvisual/lv_list.h> | |
-#include <libvisual/lv_hashmap.h> | |
+#include "lv_common.h" | |
+#include "lv_time.h" | |
+#include "lv_list.h" | |
+#include "lv_hashmap.h" | |
VISUAL_BEGIN_DECLS | |
@@ -69,10 +69,9 @@ | |
void *visual_hashlist_get (VisHashlist *hashlist, char *key); | |
-int visual_hashlist_size (VisHashlist *hashlist); | |
+int visual_hashlist_get_size (VisHashlist *hashlist); | |
int visual_hashlist_set_size (VisHashlist *hashlist, int size); | |
-int visual_hashlist_get_size (VisHashlist *hashlist); | |
VisList *visual_hashlist_get_list (VisHashlist *hashlist); | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_hashmap.c 2012-03-22 16:52:33.570363930 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_hashmap.c 2012-03-02 22:05:29.435672445 +0800 | |
@@ -64,9 +64,9 @@ | |
static int hashmap_destroy (VisCollection *collection) | |
{ | |
- VisCollectionDestroyerFunc destroyer; | |
+ //VisCollectionDestroyerFunc destroyer; | |
VisHashmap *hashmap = VISUAL_HASHMAP (collection); | |
- VisHashmapEntry *mentry; | |
+ //VisHashmapEntry *mentry; | |
int i; | |
for (i = 0; i < hashmap->size; i++) | |
@@ -126,7 +126,7 @@ | |
{ | |
VisCollectionIter *iter; | |
HashmapIterContext *context; | |
- VisHashmap *hashmap = VISUAL_HASHMAP (collection); | |
+ //VisHashmap *hashmap = VISUAL_HASHMAP (collection); | |
context = visual_mem_new0 (HashmapIterContext, 1); | |
@@ -201,7 +201,7 @@ | |
static void hashmap_iter_next (VisCollectionIter *iter, VisCollection *collection, VisObject *itercontext) | |
{ | |
- VisHashmap *hashmap = VISUAL_HASHMAP (collection); | |
+ //VisHashmap *hashmap = VISUAL_HASHMAP (collection); | |
HashmapIterContext *context = HASHMAP_ITERCONTEXT (itercontext); | |
if (context->retrieved == FALSE) { | |
@@ -503,7 +503,7 @@ | |
int visual_hashmap_set_table_size (VisHashmap *hashmap, int tablesize) | |
{ | |
- int oldsize; | |
+ //int oldsize; | |
visual_log_return_val_if_fail (hashmap != NULL, -VISUAL_ERROR_HASHMAP_NULL); | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_hashmap.h 2012-03-22 16:52:33.570363930 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_hashmap.h 2012-03-02 22:05:29.435672445 +0800 | |
@@ -24,9 +24,9 @@ | |
#ifndef _LV_HASHMAP_H | |
#define _LV_HASHMAP_H | |
-#include <libvisual/lv_common.h> | |
-#include <libvisual/lv_list.h> | |
-#include <libvisual/lv_collection.h> | |
+#include "lv_common.h" | |
+#include "lv_list.h" | |
+#include "lv_collection.h" | |
VISUAL_BEGIN_DECLS | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_input.h 2012-03-22 16:52:33.570363930 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_input.h 2012-03-02 22:05:29.435672445 +0800 | |
@@ -24,9 +24,9 @@ | |
#ifndef _LV_INPUT_H | |
#define _LV_INPUT_H | |
-#include <libvisual/lv_audio.h> | |
-#include <libvisual/lv_plugin.h> | |
-#include <libvisual/lv_common.h> | |
+#include "lv_audio.h" | |
+#include "lv_plugin.h" | |
+#include "lv_common.h" | |
VISUAL_BEGIN_DECLS | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_libvisual.c 2012-03-22 16:52:33.570363930 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_libvisual.c 2012-03-09 04:54:40.758374963 +0800 | |
@@ -41,6 +41,7 @@ | |
#include "lv_thread.h" | |
#include "lv_cpu.h" | |
#include "config.h" | |
+#include "prof.h" | |
/** Set when libvisual is initialized. */ | |
@@ -279,6 +280,13 @@ | |
char *homedir = NULL; | |
int ret = 0; | |
+ /* FIXME Start profiling */ | |
+ /* Change to 500 interrupts per second */ | |
+#ifdef VISUAL_HAVE_PROFILING | |
+ setenv("CPUPROFILE_FREQUENCY", "500", 1); | |
+ monstartup("libvisual.so"); | |
+#endif | |
+ | |
#if ENABLE_NLS | |
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); | |
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); | |
@@ -326,16 +334,16 @@ | |
visual_fourier_initialize (); | |
/* Add the standard plugin paths */ | |
- ret = visual_init_path_add (PLUGPATH"/actor"); | |
+ ret = visual_init_path_add ("plugins/actor"); | |
visual_log_return_val_if_fail (ret == VISUAL_OK, ret); | |
- ret = visual_init_path_add (PLUGPATH"/input"); | |
+ ret = visual_init_path_add ("plugins/input"); | |
visual_log_return_val_if_fail (ret == VISUAL_OK, ret); | |
- ret = visual_init_path_add (PLUGPATH"/morph"); | |
+ ret = visual_init_path_add ("plugins/morph"); | |
visual_log_return_val_if_fail (ret == VISUAL_OK, ret); | |
- ret = visual_init_path_add (PLUGPATH"/transform"); | |
+ ret = visual_init_path_add ("plugins/transform"); | |
visual_log_return_val_if_fail (ret == VISUAL_OK, ret); | |
#if !defined(VISUAL_OS_WIN32) | |
@@ -450,6 +458,11 @@ | |
} | |
__lv_initialized = FALSE; | |
+ | |
+#ifdef VISUAL_HAVE_PROFILING | |
+ moncleanup(); //FIXME End profilng | |
+#endif | |
+ | |
return VISUAL_OK; | |
} | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_list.h 2012-03-22 16:52:33.570363930 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_list.h 2012-03-02 22:05:29.439672446 +0800 | |
@@ -32,8 +32,8 @@ | |
#ifndef _LV_LIST_H | |
#define _LV_LIST_H | |
-#include <libvisual/lv_common.h> | |
-#include <libvisual/lv_collection.h> | |
+#include "lv_common.h" | |
+#include "lv_collection.h" | |
#if defined(__FreeBSD__) || defined(__OpenBSD__) | |
#include <sys/queue.h> | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_log.h 2012-03-22 18:40:50.970195916 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_log.h 2012-03-02 22:05:29.439672446 +0800 | |
@@ -31,7 +31,6 @@ | |
#include <libvisual/lv_defines.h> | |
#include <libvisual/lvconfig.h> | |
-#include <libvisual/lv_error.h> | |
VISUAL_BEGIN_DECLS | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_math.c 2012-03-23 04:13:32.541307371 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_math.c 2012-03-02 22:05:29.439672446 +0800 | |
@@ -30,6 +30,7 @@ | |
#include "lv_bits.h" | |
#include "lv_math.h" | |
+#include "lv_cpu.h" | |
/* 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 | |
* look how we can reduce this. For example by using macros for common blocks. */ | |
@@ -62,8 +63,6 @@ | |
visual_log_return_val_if_fail (dest != NULL, -VISUAL_ERROR_NULL); | |
visual_log_return_val_if_fail (src != NULL, -VISUAL_ERROR_NULL); | |
-#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) | |
- | |
/* FIXME check what is faster on AMD (sse or 3dnow) */ | |
if (visual_cpu_get_sse () && n >= 16) { | |
float packed_multiplier[4]; | |
@@ -73,6 +72,7 @@ | |
packed_multiplier[2] = multiplier; | |
packed_multiplier[3] = multiplier; | |
+#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) | |
while (!VISUAL_ALIGNED(d, 16)) { | |
(*d) = (*s) * multiplier; | |
@@ -86,6 +86,7 @@ | |
("\n\t movups (%0), %%xmm7" | |
:: "r" (packed_multiplier) : "memory"); | |
+ | |
while (n > 16) { | |
__asm __volatile | |
("\n\t prefetchnta 256(%0)" | |
@@ -108,12 +109,14 @@ | |
n -= 16; | |
} | |
+#endif /* VISUAL_ARCH_X86 */ | |
} else if (visual_cpu_get_3dnow ()) { | |
float packed_multiplier[2]; | |
packed_multiplier[0] = multiplier; | |
packed_multiplier[1] = multiplier; | |
+#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) | |
__asm __volatile | |
("\n\t movq %[multiplier], %%mm0" | |
:: [multiplier] "m" (*packed_multiplier)); | |
@@ -152,9 +155,9 @@ | |
__asm __volatile | |
("\n\t emms"); | |
- } | |
+#endif /* VISUAL_ARCH_X86 */ | |
-#endif /* VISUAL_ARCH_X86 || VISUAL_ARCH_X86_64 */ | |
+ } | |
while (n--) { | |
(*d) = (*s) * multiplier; | |
@@ -185,8 +188,6 @@ | |
visual_log_return_val_if_fail (dest != NULL, -VISUAL_ERROR_NULL); | |
visual_log_return_val_if_fail (src != NULL, -VISUAL_ERROR_NULL); | |
-#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) | |
- | |
if (visual_cpu_get_sse () && n >= 16) { | |
float packed_adder[4]; | |
@@ -195,6 +196,7 @@ | |
packed_adder[2] = adder; | |
packed_adder[3] = adder; | |
+#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) | |
while (!VISUAL_ALIGNED(d, 16)) { | |
(*d) = (*s) + adder; | |
@@ -231,12 +233,14 @@ | |
n -= 16; | |
} | |
+#endif /* VISUAL_ARCH_X86 */ | |
} else if (visual_cpu_get_3dnow ()) { | |
float packed_adder[2]; | |
packed_adder[0] = adder; | |
packed_adder[1] = adder; | |
+#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) | |
__asm __volatile | |
("\n\t movq %[adder], %%mm0" | |
:: [adder] "m" (*packed_adder)); | |
@@ -275,9 +279,9 @@ | |
__asm __volatile | |
("\n\t emms"); | |
- } | |
+#endif /* VISUAL_ARCH_X86 */ | |
-#endif /* VISUAL_ARCH_X86 || VISUAL_ARCH_X86_64 */ | |
+ } | |
while (n--) { | |
(*d) = (*s) + adder; | |
@@ -308,7 +312,6 @@ | |
visual_log_return_val_if_fail (dest != NULL, -VISUAL_ERROR_NULL); | |
visual_log_return_val_if_fail (src != NULL, -VISUAL_ERROR_NULL); | |
-#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) | |
if (visual_cpu_get_sse () && n >= 16) { | |
float packed_substracter[4]; | |
@@ -317,6 +320,7 @@ | |
packed_substracter[2] = substracter; | |
packed_substracter[3] = substracter; | |
+#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) | |
while (!VISUAL_ALIGNED(d, 16)) { | |
(*d) = (*s) - substracter; | |
@@ -353,12 +357,14 @@ | |
n -= 16; | |
} | |
+#endif /* VISUAL_ARCH_X86 */ | |
} else if (visual_cpu_get_3dnow ()) { | |
float packed_substracter[2]; | |
packed_substracter[0] = substracter; | |
packed_substracter[1] = substracter; | |
+#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) | |
__asm __volatile | |
("\n\t movq %[substracter], %%mm0" | |
:: [substracter] "m" (*packed_substracter)); | |
@@ -397,9 +403,9 @@ | |
__asm __volatile | |
("\n\t emms"); | |
- } | |
+#endif /* VISUAL_ARCH_X86 */ | |
-#endif /* VISUAL_ARCH_X86 || VISUAL_ARCH_X86_64 */ | |
+ } | |
while (n--) { | |
(*d) = (*s) - substracter; | |
@@ -421,9 +427,8 @@ | |
visual_log_return_val_if_fail (src1 != NULL, -VISUAL_ERROR_NULL); | |
visual_log_return_val_if_fail (src2 != NULL, -VISUAL_ERROR_NULL); | |
-#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) | |
- | |
if (visual_cpu_get_sse () && n >= 16) { | |
+#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) | |
while (!VISUAL_ALIGNED(d, 16)) { | |
(*d) = (*s1) * (*s2); | |
@@ -462,7 +467,9 @@ | |
n -= 16; | |
} | |
+#endif /* VISUAL_ARCH_X86 */ | |
} else if (visual_cpu_get_3dnow ()) { | |
+#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) | |
while (n > 8) { | |
__asm __volatile | |
("\n\t prefetch 256(%0)" | |
@@ -493,9 +500,9 @@ | |
__asm __volatile | |
("\n\t emms"); | |
- } | |
+#endif /* VISUAL_ARCH_X86 */ | |
-#endif /* VISUAL_ARCH_X86) || VISUAL_ARCH_X86_64 */ | |
+ } | |
while (n--) { | |
(*d) = (*s1) * (*s2); | |
@@ -526,9 +533,8 @@ | |
visual_log_return_val_if_fail (flts != NULL, -VISUAL_ERROR_NULL); | |
visual_log_return_val_if_fail (ints != NULL, -VISUAL_ERROR_NULL); | |
-#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) | |
- | |
if (visual_cpu_get_3dnow ()) { | |
+#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) | |
while (n > 16) { | |
__asm __volatile | |
@@ -559,11 +565,10 @@ | |
__asm __volatile | |
("\n\t emms"); | |
+#endif /* VISUAL_ARCH_X86 */ | |
} | |
-#endif /* VISUAL_ARCH_X86 || VISUAL_ARCH_X86_64 */ | |
- | |
while (n--) { | |
*d = *s; | |
@@ -592,9 +597,8 @@ | |
visual_log_return_val_if_fail (flts != NULL, -VISUAL_ERROR_NULL); | |
visual_log_return_val_if_fail (ints != NULL, -VISUAL_ERROR_NULL); | |
-#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) | |
- | |
if (visual_cpu_get_3dnow ()) { | |
+#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) | |
while (n > 16) { | |
__asm __volatile | |
@@ -625,9 +629,9 @@ | |
__asm __volatile | |
("\n\t emms"); | |
- } | |
+#endif /* VISUAL_ARCH_X86 */ | |
-#endif /* VISUAL_ARCH_X86 || VISUAL_ARCH_X86_64 */ | |
+ } | |
while (n--) { | |
*d = *s; | |
@@ -658,14 +662,13 @@ | |
visual_log_return_val_if_fail (flts != NULL, -VISUAL_ERROR_NULL); | |
visual_log_return_val_if_fail (ints != NULL, -VISUAL_ERROR_NULL); | |
-#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) | |
- | |
if (visual_cpu_get_3dnow ()) { | |
float packed_multiplier[2]; | |
packed_multiplier[0] = multiplier; | |
packed_multiplier[1] = multiplier; | |
+#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) | |
__asm __volatile | |
("\n\t movq %[multiplier], %%mm0" | |
:: [multiplier] "m" (*packed_multiplier)); | |
@@ -696,9 +699,9 @@ | |
__asm __volatile | |
("\n\t emms"); | |
- } | |
+#endif /* VISUAL_ARCH_X86 */ | |
-#endif | |
+ } | |
while (n--) { | |
*d = (float) *s * multiplier; | |
@@ -729,13 +732,13 @@ | |
visual_log_return_val_if_fail (flts != NULL, -VISUAL_ERROR_NULL); | |
visual_log_return_val_if_fail (ints != NULL, -VISUAL_ERROR_NULL); | |
-#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) | |
if (visual_cpu_get_3dnow ()) { | |
float packed_multiplier[2]; | |
packed_multiplier[0] = multiplier; | |
packed_multiplier[1] = multiplier; | |
+#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) | |
__asm __volatile | |
("\n\t movq %[multiplier], %%mm0" | |
:: [multiplier] "m" (*packed_multiplier)); | |
@@ -774,8 +777,9 @@ | |
__asm __volatile | |
("\n\t emms"); | |
+#endif /* VISUAL_ARCH_X86 */ | |
+ | |
} | |
-#endif /* VISUAL_ARCH_X86 || VISUAL_ARCH_X86_64 */ | |
while (n--) { | |
*d = (float) *s * multiplier; | |
@@ -807,7 +811,6 @@ | |
visual_log_return_val_if_fail (flts != NULL, -VISUAL_ERROR_NULL); | |
visual_log_return_val_if_fail (ints != NULL, -VISUAL_ERROR_NULL); | |
-#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) | |
if (visual_cpu_get_3dnow ()) { | |
float packed_multiplier[2]; | |
float packed_normalise_mul[2]; | |
@@ -822,6 +825,7 @@ | |
packed_adder[0] = 1; | |
packed_adder[1] = 1; | |
+#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) | |
__asm __volatile | |
("\n\t movq %[multiplier], %%mm0" | |
"\n\t movq %[normalise_mul], %%mm6" | |
@@ -857,9 +861,9 @@ | |
__asm __volatile | |
("\n\t emms"); | |
- } | |
+#endif /* VISUAL_ARCH_X86 */ | |
-#endif /* VISUAL_ARCH_X86 || VISUAL_ARCH_X86_64 */ | |
+ } | |
while (n--) { | |
*d = (float) (((*s) + 1) * 0.5) * multiplier; | |
@@ -889,9 +893,8 @@ | |
visual_log_return_val_if_fail (dest != NULL, -VISUAL_ERROR_NULL); | |
visual_log_return_val_if_fail (src != NULL, -VISUAL_ERROR_NULL); | |
-#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) | |
- | |
if (visual_cpu_get_sse () && n >= 16) { | |
+#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) | |
while (!VISUAL_ALIGNED(d, 16)) { | |
*d = sqrtf (*s); | |
@@ -921,10 +924,9 @@ | |
n -= 16; | |
} | |
+#endif /* VISUAL_ARCH_X86 */ | |
} | |
-#endif /* VISUAL_ARCH_X86 || VISUAL_ARCH_X86_64 */ | |
- | |
while (n--) { | |
*d = sqrtf (*s); | |
@@ -956,10 +958,9 @@ | |
visual_log_return_val_if_fail (real != NULL, -VISUAL_ERROR_NULL); | |
visual_log_return_val_if_fail (imag != NULL, -VISUAL_ERROR_NULL); | |
-#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) | |
- | |
if (visual_cpu_get_sse () && n >= 16) { | |
+#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) | |
while (!VISUAL_ALIGNED(d, 16)) { | |
*d = sqrtf (((*r) * (*r)) + ((*i) * (*i))); | |
@@ -996,10 +997,9 @@ | |
n -= 8; | |
} | |
+#endif /* VISUAL_ARCH_X86 */ | |
} | |
-#endif /* VISUAL_ARCH_X86 || VISUAL_ARCH_X86_64 */ | |
- | |
while (n--) { | |
*d = sqrtf (((*r) * (*r)) + ((*i) * (*i))); | |
@@ -1033,8 +1033,6 @@ | |
visual_log_return_val_if_fail (real != NULL, -VISUAL_ERROR_NULL); | |
visual_log_return_val_if_fail (imag != NULL, -VISUAL_ERROR_NULL); | |
-#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) | |
- | |
if (visual_cpu_get_sse () && n >= 16) { | |
float packed_scaler[4]; | |
@@ -1043,6 +1041,7 @@ | |
packed_scaler[2] = scaler; | |
packed_scaler[3] = scaler; | |
+#if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) | |
while (!VISUAL_ALIGNED(d, 16)) { | |
*d = sqrtf (((*r) * (*r)) + ((*i) * (*i))) * scaler; | |
@@ -1085,11 +1084,9 @@ | |
n -= 8; | |
} | |
+#endif /* VISUAL_ARCH_X86 */ | |
} | |
-#endif /* VISUAL_ARCH_X86 || VISUAL_ARCH_X86_64 */ | |
- | |
- | |
while (n--) { | |
*d = sqrtf (((*r) * (*r)) + ((*i) * (*i))) * scaler; | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_math.h 2012-03-22 16:52:33.574363931 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_math.h 2012-03-02 22:05:29.439672446 +0800 | |
@@ -24,7 +24,7 @@ | |
#ifndef _LV_MATH_H | |
#define _LV_MATH_H | |
-#include <libvisual/lv_common.h> | |
+#include "lv_common.h" | |
VISUAL_BEGIN_DECLS | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_mem.c 2012-03-23 04:36:54.345271124 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_mem.c 2012-03-02 22:05:29.439672446 +0800 | |
@@ -27,6 +27,10 @@ | |
#include <stdlib.h> | |
#include <gettext.h> | |
+#if defined(HAVE_NEON) | |
+# include <arm_neon.h> | |
+#endif | |
+ | |
#include "lv_mem.h" | |
#include "lv_common.h" | |
#include "lv_log.h" | |
@@ -42,21 +46,25 @@ | |
static void *mem_copy_mmx2 (void *dest, const void *src, visual_size_t n); | |
static void *mem_copy_3dnow (void *dest, const void *src, visual_size_t n); | |
static void *mem_copy_altivec (void *dest, const void *src, visual_size_t n); | |
+static void *mem_copy_neon (void *dest, const void *src, visual_size_t n); | |
static void *mem_set8_c (void *dest, int c, visual_size_t n); | |
static void *mem_set8_mmx (void *dest, int c, visual_size_t n); | |
static void *mem_set8_mmx2 (void *dest, int c, visual_size_t n); | |
static void *mem_set8_altivec (void *dest, int c, visual_size_t n); | |
+static void *mem_set8_neon (void *dest, int c, visual_size_t n); | |
static void *mem_set16_c (void *dest, int c, visual_size_t n); | |
static void *mem_set16_mmx (void *dest, int c, visual_size_t n); | |
static void *mem_set16_mmx2 (void *dest, int c, visual_size_t n); | |
static void *mem_set16_altivec (void *dest, int c, visual_size_t n); | |
+static void *mem_set16_neon (void *dest, int c, visual_size_t n); | |
static void *mem_set32_c (void *dest, int c, visual_size_t n); | |
static void *mem_set32_mmx (void *dest, int c, visual_size_t n); | |
static void *mem_set32_mmx2 (void *dest, int c, visual_size_t n); | |
static void *mem_set32_altivec (void *dest, int c, visual_size_t n); | |
+static void *mem_set32_neon (void *dest, int c, visual_size_t n); | |
/* Optimal performance functions set by visual_mem_initialize(). */ | |
VisMemCopyFunc visual_mem_copy = mem_copy_c; | |
@@ -111,6 +119,20 @@ | |
visual_mem_set32 = mem_set32_mmx2; | |
} | |
+ if (visual_cpu_get_altivec() > 0) { | |
+ visual_mem_copy = mem_copy_altivec; | |
+ visual_mem_set = mem_set8_altivec; | |
+ visual_mem_set16 = mem_set16_altivec; | |
+ visual_mem_set32 = mem_set32_altivec; | |
+ } | |
+ | |
+ if (visual_cpu_get_neon() > 0) { | |
+ visual_mem_copy = mem_copy_neon; | |
+ visual_mem_set = mem_set8_neon; | |
+ visual_mem_set16 = mem_set16_neon; | |
+ visual_mem_set32 = mem_set32_neon; | |
+ } | |
+ | |
return VISUAL_OK; | |
} | |
@@ -375,9 +397,49 @@ | |
static void *mem_copy_altivec (void *dest, const void *src, visual_size_t n) | |
{ | |
+ | |
return NULL; | |
} | |
+static void *mem_copy_neon (void *dest, const void *src, visual_size_t n) | |
+{ | |
+ memcpy(dest, src, n); | |
+ return dest; | |
+#if 0 | |
+ uint32_t *d = dest; | |
+ const uint32_t *s = src; | |
+ uint8_t *dc = dest; | |
+ const uint8_t *sc = src; | |
+ | |
+#ifdef VISUAL_ARCH_ARM | |
+ while (n >= 64) { | |
+ __asm __volatile( | |
+ "\n\t ldmia %[source]!, {r4-r7}" | |
+ "\n\t stmia %[dest]!, {r4-r7}" | |
+ "\n\t ldmia %[source]!, {r4-r7}" | |
+ "\n\t stmia %[dest]!, {r4-r7}" | |
+ "\n\t ldmia %[source]!, {r4-r7}" | |
+ "\n\t stmia %[dest]!, {r4-r7}" | |
+ "\n\t ldmia %[source]!, {r4-r7}" | |
+ "\n\t stmia %[dest]!, {r4-r7}" | |
+ :: [dest] "r" (d), [source] "r" (s) : "r4", "r5", "r6", "r7" ); | |
+ | |
+ d+=16; | |
+ s+=16; | |
+ n -= 64; | |
+ } | |
+#endif | |
+ | |
+ dc = (uint8_t *) d; | |
+ sc = (const uint8_t *) s; | |
+ | |
+ while (n--) | |
+ *dc++ = *sc++; | |
+ | |
+ return dest; | |
+#endif | |
+} | |
+ | |
/* Memset functions, 1 byte memset */ | |
static void *mem_set8_c (void *dest, int c, visual_size_t n) | |
{ | |
@@ -525,9 +587,61 @@ | |
static void *mem_set8_altivec (void *dest, int c, visual_size_t n) | |
{ | |
+ | |
return NULL; | |
} | |
+/* Memset functions, 1 byte memset */ | |
+static void *mem_set8_neon (void *dest, int c, visual_size_t n) | |
+{ | |
+ | |
+ memset(dest, c, n); | |
+ return dest; | |
+#if 0 | |
+ uint32_t *d = dest; | |
+ uint8_t *dc = dest; | |
+ uint32_t setflag32 = | |
+ (c & 0xff) | | |
+ ((c << 8) & 0xff00) | | |
+ ((c << 16) & 0xff0000) | | |
+ ((c << 24) & 0xff000000); | |
+ uint8_t setflag8 = c & 0xff; | |
+ | |
+#if defined(VISUAL_ARCH_ARM) | |
+ | |
+ while (n >= 32) { | |
+ __asm __volatile | |
+ ( | |
+ "\n\t mov r4, %[flag]" | |
+ "\n\t mov r5, r4" | |
+ "\n\t mov r6, r4" | |
+ "\n\t mov r7, r4" | |
+ "\n\t stmia %[dst]!,{r4-r7}" | |
+ "\n\t stmia %[dst]!,{r4-r7}" | |
+ :: [dst] "r" (d), [flag] "r" (&setflag32) : "r4", "r5", "r6", "r7"); | |
+ | |
+ d += 8; | |
+ | |
+ n -= 32; | |
+ } | |
+ | |
+#endif /* VISUAL_ARCH_ARM */ | |
+ | |
+ while (n >= 4) { | |
+ *d++ = setflag32; | |
+ n -= 4; | |
+ } | |
+ | |
+ dc = (uint8_t *) d; | |
+ | |
+ while (n--) | |
+ *dc++ = setflag8; | |
+ | |
+ return dest; | |
+#endif | |
+} | |
+ | |
+ | |
/* Memset functions, 2 byte memset */ | |
static void *mem_set16_c (void *dest, int c, visual_size_t n) | |
{ | |
@@ -669,9 +783,33 @@ | |
static void *mem_set16_altivec (void *dest, int c, visual_size_t n) | |
{ | |
+ | |
return NULL; | |
} | |
+/* Memset functions, 2 byte memset */ | |
+static void *mem_set16_neon (void *dest, int c, visual_size_t n) | |
+{ | |
+ memset(dest, c, n); | |
+ return dest; | |
+#if 0 | |
+ uint32_t *d = dest; | |
+ uint16_t *dc = dest; | |
+ uint32_t setflag32 = | |
+ (c & 0xffff) | | |
+ ((c << 16) & 0xffff0000); | |
+ uint16_t setflag16 = c & 0xffff; | |
+ | |
+ | |
+ dc = (uint16_t *) d; | |
+ | |
+ while (n--) | |
+ *dc++ = setflag16; | |
+ | |
+ return dest; | |
+#endif | |
+} | |
+ | |
/* Memset functions, 4 byte memset */ | |
static void *mem_set32_c (void *dest, int c, visual_size_t n) | |
{ | |
@@ -780,9 +918,26 @@ | |
static void *mem_set32_altivec (void *dest, int c, visual_size_t n) | |
{ | |
+ | |
return NULL; | |
} | |
+/* Memset functions, 4 byte memset */ | |
+static void *mem_set32_neon (void *dest, int c, visual_size_t n) | |
+{ | |
+ memset(dest, c, n); | |
+ return dest; | |
+#if 0 | |
+ uint32_t *d = dest; | |
+ uint32_t setflag32 = c; | |
+ | |
+ while (n--) | |
+ *d++ = setflag32; | |
+ | |
+ return dest; | |
+#endif | |
+} | |
+ | |
/** | |
* @} | |
*/ | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_mem.h 2012-03-22 16:52:33.574363931 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_mem.h 2012-03-02 22:05:29.439672446 +0800 | |
@@ -24,9 +24,9 @@ | |
#ifndef _LV_MEM_H | |
#define _LV_MEM_H | |
-#include <libvisual/lvconfig.h> | |
+#include "lvconfig.h" | |
-#include <libvisual/lv_defines.h> | |
+#include "lv_defines.h" | |
VISUAL_BEGIN_DECLS | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_morph.c 2012-03-22 16:52:33.574363931 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_morph.c 2012-03-02 22:05:29.439672446 +0800 | |
@@ -240,7 +240,7 @@ | |
*/ | |
int visual_morph_get_supported_depth (VisMorph *morph) | |
{ | |
- VisPluginData *plugin; | |
+ //VisPluginData *plugin; | |
VisMorphPlugin *morphplugin; | |
visual_log_return_val_if_fail (morph != NULL, -VISUAL_ERROR_MORPH_NULL); | |
@@ -256,7 +256,7 @@ | |
VisVideoAttributeOptions *visual_morph_get_video_attribute_options (VisMorph *morph) | |
{ | |
- VisPluginData *plugin; | |
+ //VisPluginData *plugin; | |
VisMorphPlugin *morphplugin; | |
visual_log_return_val_if_fail (morph != NULL, NULL); | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_morph.h 2012-03-22 16:52:33.574363931 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_morph.h 2012-03-02 22:05:29.443672446 +0800 | |
@@ -24,11 +24,11 @@ | |
#ifndef _LV_MORPH_H | |
#define _LV_MORPH_H | |
-#include <libvisual/lv_palette.h> | |
-#include <libvisual/lv_plugin.h> | |
-#include <libvisual/lv_list.h> | |
-#include <libvisual/lv_video.h> | |
-#include <libvisual/lv_time.h> | |
+#include "lv_palette.h" | |
+#include "lv_plugin.h" | |
+#include "lv_list.h" | |
+#include "lv_video.h" | |
+#include "lv_time.h" | |
VISUAL_BEGIN_DECLS | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_object.h 2012-03-22 16:52:33.574363931 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_object.h 2012-03-02 22:05:29.443672446 +0800 | |
@@ -24,8 +24,8 @@ | |
#ifndef _LV_OBJECT_H | |
#define _LV_OBJECT_H | |
-#include <libvisual/lv_defines.h> | |
-#include <libvisual/lv_types.h> | |
+#include "lv_defines.h" | |
+#include "lv_types.h" | |
VISUAL_BEGIN_DECLS | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_os.h 2012-03-22 16:52:33.574363931 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_os.h 2012-03-02 22:05:29.443672446 +0800 | |
@@ -24,7 +24,7 @@ | |
#ifndef _LV_OS_H | |
#define _LV_OS_H | |
-#include <libvisual/lv_common.h> | |
+#include "lv_common.h" | |
VISUAL_BEGIN_DECLS | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_palette.h 2012-03-22 16:52:33.574363931 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_palette.h 2012-03-02 22:05:29.443672446 +0800 | |
@@ -24,8 +24,8 @@ | |
#ifndef _LV_PALETTE_H | |
#define _LV_PALETTE_H | |
-#include <libvisual/lv_common.h> | |
-#include <libvisual/lv_color.h> | |
+#include "lv_common.h" | |
+#include "lv_color.h" | |
VISUAL_BEGIN_DECLS | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_param.c 2012-03-22 16:52:33.574363931 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_param.c 2012-03-02 22:05:29.443672446 +0800 | |
@@ -205,7 +205,7 @@ | |
visual_mem_copy(¶m->defaultnum, ¶m->numeric, sizeof(param->defaultnum)); | |
if(param->type == VISUAL_PARAM_ENTRY_TYPE_STRING) | |
- param->defaultstring = strdup(param->string); | |
+ ;//param->defaultstring = strdup(param->string); FIXME | |
/* | |
if(param->type == VISUAL_PARAM_ENTRY_TYPE_COLOR) | |
@@ -1346,7 +1346,7 @@ | |
visual_log_return_val_if_fail(param != NULL, -VISUAL_ERROR_PARAM_NULL); | |
if(param->defaultstring) | |
- visual_mem_free(param->defaultstring); | |
+ ;//visual_mem_free(param->defaultstring); | |
param->defaultstring = strdup(str); | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_param.h 2012-03-22 16:52:33.574363931 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_param.h 2012-03-02 22:05:29.443672446 +0800 | |
@@ -24,11 +24,11 @@ | |
#ifndef _LV_PARAM_H | |
#define _LV_PARAM_H | |
-#include <libvisual/lv_common.h> | |
-#include <libvisual/lv_color.h> | |
-#include <libvisual/lv_palette.h> | |
-#include <libvisual/lv_list.h> | |
-#include <libvisual/lv_event.h> | |
+#include "lv_common.h" | |
+#include "lv_color.h" | |
+#include "lv_palette.h" | |
+#include "lv_list.h" | |
+#include "lv_event.h" | |
VISUAL_BEGIN_DECLS | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_plugin.c 2012-03-22 16:52:33.578363931 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_plugin.c 2012-03-02 22:05:29.443672446 +0800 | |
@@ -239,7 +239,6 @@ | |
if (plugin->info->events != NULL) { | |
plugin->info->events (plugin, &plugin->eventqueue); | |
- | |
return VISUAL_OK; | |
} | |
@@ -816,7 +815,7 @@ | |
VisPluginRef **ref; | |
VisPluginInfo *plug_info; | |
VisPluginInfo *dup_info; | |
- const char *plug_name; | |
+ //const char *plug_name; | |
VisPluginGetInfoFunc get_plugin_info; | |
int *plugin_version; | |
#if defined(VISUAL_OS_WIN32) | |
@@ -897,6 +896,8 @@ | |
return NULL; | |
} | |
+ 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); | |
+ | |
ref = visual_mem_new0 (VisPluginRef *, cnt); | |
for (i = 0; i < cnt; i++) { | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_plugin.h 2012-03-22 16:52:33.578363931 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_plugin.h 2012-03-02 22:05:29.443672446 +0800 | |
@@ -24,16 +24,16 @@ | |
#ifndef _LV_PLUGIN_H | |
#define _LV_PLUGIN_H | |
-#include <libvisual/lv_video.h> | |
-#include <libvisual/lv_audio.h> | |
-#include <libvisual/lv_palette.h> | |
-#include <libvisual/lv_list.h> | |
-#include <libvisual/lv_songinfo.h> | |
-#include <libvisual/lv_event.h> | |
-#include <libvisual/lv_param.h> | |
-#include <libvisual/lv_ui.h> | |
-#include <libvisual/lv_random.h> | |
-#include <libvisual/lv_types.h> | |
+#include "lv_video.h" | |
+#include "lv_audio.h" | |
+#include "lv_palette.h" | |
+#include "lv_list.h" | |
+#include "lv_songinfo.h" | |
+#include "lv_event.h" | |
+#include "lv_param.h" | |
+#include "lv_ui.h" | |
+#include "lv_random.h" | |
+#include "lv_types.h" | |
#include "lvconfig.h" | |
@@ -59,9 +59,20 @@ | |
#define VISUAL_PLUGIN_TYPE_NULL "Libvisual:core:null" | |
/** | |
- * Standard defination for GPL plugins, use this for the .license entry in VisPluginInfo | |
+ * Standard defination for GPLv1 plugins, use this for the .license entry in VisPluginInfo | |
*/ | |
-#define VISUAL_PLUGIN_LICENSE_GPL "GPL" | |
+#define VISUAL_PLUGIN_LICENSE_GPLv1 "GPLv1" | |
+ | |
+/** | |
+ * Standard defination for GPLv2 plugins, use this for the .license entry in VisPluginInfo | |
+ */ | |
+#define VISUAL_PLUGIN_LICENSE_GPL "GPLv2" | |
+ | |
+/** | |
+ * Standard defination for GPLv3 plugins, use this for the .license entry in VisPluginInfo | |
+ */ | |
+ | |
+#define VISUAL_PLUGIN_LICENSE_GPLv3 "GPLv3" | |
/** | |
* Standard defination for LGPL plugins, use this for the .license entry in VisPluginInfo | |
*/ | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_random.h 2012-03-22 16:52:33.578363931 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_random.h 2012-03-02 22:05:29.447672445 +0800 | |
@@ -25,7 +25,7 @@ | |
#ifndef _LV_RANDOM_H | |
#define _LV_RANDOM_H | |
-#include <libvisual/lv_common.h> | |
+#include "lv_common.h" | |
VISUAL_BEGIN_DECLS | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_rectangle.c 2012-03-22 16:52:33.578363931 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_rectangle.c 2012-03-02 22:05:29.447672445 +0800 | |
@@ -341,8 +341,6 @@ | |
*/ | |
int visual_rectangle_denormalise_many_values (VisRectangle *rect, float *fxlist, float *fylist, int32_t *xlist, int32_t *ylist, int size) | |
{ | |
- int i; | |
- | |
visual_log_return_val_if_fail (rect != NULL, -VISUAL_ERROR_RECTANGLE_NULL); | |
visual_math_vectorized_floats_to_int32s_multiply (xlist, fxlist, size, rect->width); | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_rectangle.h 2012-03-22 16:52:33.578363931 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_rectangle.h 2012-03-02 22:05:29.447672445 +0800 | |
@@ -24,7 +24,7 @@ | |
#ifndef _LV_RECTANGLE_H | |
#define _LV_RECTANGLE_H | |
-#include <libvisual/lv_common.h> | |
+#include "lv_common.h" | |
VISUAL_BEGIN_DECLS | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_ringbuffer.c 2012-03-23 04:39:05.893267722 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_ringbuffer.c 2012-03-02 22:05:29.447672445 +0800 | |
@@ -21,8 +21,6 @@ | |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
*/ | |
-#include <config.h> | |
- | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
@@ -30,7 +28,7 @@ | |
#include <fcntl.h> | |
#include <gettext.h> | |
-#include "lvconfig.h" | |
+#include <lvconfig.h> | |
#include "lv_ringbuffer.h" | |
#include "lv_log.h" | |
#include "lv_mem.h" | |
@@ -255,8 +253,8 @@ | |
VisListEntry *le = NULL; | |
VisRingBufferEntry *entry; | |
int curposition = 0; | |
- int curoffset = 0; | |
- int positioncorr = 0; | |
+ //int curoffset = 0; | |
+ //int positioncorr = 0; | |
int startat = 0; | |
int buffercorr = 0; | |
@@ -343,7 +341,7 @@ | |
{ | |
VisListEntry *le = NULL; | |
VisRingBufferEntry *entry; | |
- int curposition = 0; | |
+ //int curposition = 0; | |
int curoffset = 0; | |
int startat = 0; | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_ringbuffer.h 2012-03-22 16:52:33.578363931 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_ringbuffer.h 2012-03-02 22:05:29.447672445 +0800 | |
@@ -24,9 +24,9 @@ | |
#ifndef _LV_RINGBUFFER_H | |
#define _LV_RINGBUFFER_H | |
-#include <libvisual/lv_common.h> | |
-#include <libvisual/lv_list.h> | |
-#include <libvisual/lv_buffer.h> | |
+#include "lv_common.h" | |
+#include "lv_list.h" | |
+#include "lv_buffer.h" | |
VISUAL_BEGIN_DECLS | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_songinfo.h 2012-03-22 16:52:33.578363931 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_songinfo.h 2012-03-02 22:05:29.447672445 +0800 | |
@@ -24,8 +24,8 @@ | |
#ifndef _LV_SONGINFO_H | |
#define _LV_SONGINFO_H | |
-#include <libvisual/lv_time.h> | |
-#include <libvisual/lv_video.h> | |
+#include "lv_time.h" | |
+#include "lv_video.h" | |
VISUAL_BEGIN_DECLS | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_thread.c 2012-03-23 04:20:47.197296131 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_thread.c 2012-03-02 22:05:29.447672445 +0800 | |
@@ -80,7 +80,6 @@ | |
static ThreadFuncs __lv_thread_funcs; | |
/* Posix implementation */ | |
-#ifdef VISUAL_THREAD_MODEL_POSIX | |
static VisThread *thread_create_posix (VisThreadFunc func, void *data, int joinable); | |
static int thread_free_posix (VisThread *thread); | |
static void *thread_join_posix (VisThread *thread); | |
@@ -93,10 +92,9 @@ | |
static int mutex_lock_posix (VisMutex *mutex); | |
static int mutex_trylock_posix (VisMutex *mutex); | |
static int mutex_unlock_posix (VisMutex *mutex); | |
-#endif | |
-/* Windows32 implementation */ | |
#ifdef VISUAL_THREAD_MODEL_WIN32 | |
+/* Windows32 implementation */ | |
static VisThread *thread_create_win32 (VisThreadFunc func, void *data, int joinable); | |
static int thread_free_win32 (VisThread *thread); | |
static void *thread_join_win32 (VisThread *thread); | |
@@ -111,8 +109,8 @@ | |
static int mutex_unlock_win32 (VisMutex *mutex); | |
#endif | |
-/* GThread implementation */ | |
#ifdef VISUAL_THREAD_MODEL_GTHREAD2 | |
+/* GThread implementation */ | |
static VisThread *thread_create_gthread (VisThreadFunc func, void *data, int joinable); | |
static int thread_free_gthread (VisThread *thread); | |
static void *thread_join_gthread (VisThread *thread); | |
@@ -457,12 +455,11 @@ | |
/* Native implementations */ | |
-#ifdef VISUAL_THREAD_MODEL_POSIX | |
- | |
/* Posix implementation */ | |
static VisThread *thread_create_posix (VisThreadFunc func, void *data, int joinable) | |
{ | |
VisThread *thread = NULL; | |
+#ifdef VISUAL_THREAD_MODEL_POSIX | |
pthread_attr_t attr; | |
int res; | |
@@ -487,6 +484,7 @@ | |
return NULL; | |
} | |
+#endif | |
return thread; | |
} | |
@@ -499,34 +497,42 @@ | |
static void *thread_join_posix (VisThread *thread) | |
{ | |
void *result = NULL; | |
+#ifdef VISUAL_THREAD_MODEL_POSIX | |
if (pthread_join (thread->thread, &result) < 0) { | |
visual_log (VISUAL_LOG_CRITICAL, _("Error while joining thread")); | |
return NULL; | |
} | |
+#endif | |
return result; | |
} | |
static void thread_exit_posix (void *retval) | |
{ | |
+#ifdef VISUAL_THREAD_MODEL_POSIX | |
pthread_exit (retval); | |
+#endif | |
} | |
static void thread_yield_posix () | |
{ | |
+#ifdef VISUAL_THREAD_MODEL_POSIX | |
sched_yield (); | |
+#endif | |
} | |
static VisMutex *mutex_new_posix () | |
{ | |
VisMutex *mutex; | |
+#ifdef VISUAL_THREAD_MODEL_POSIX | |
mutex = visual_mem_new0 (VisMutex, 1); | |
pthread_mutex_init (&mutex->mutex, NULL); | |
+#endif | |
return mutex; | |
} | |
@@ -539,41 +545,46 @@ | |
static int mutex_init_posix (VisMutex *mutex) | |
{ | |
visual_mem_set (mutex, 0, sizeof (VisMutex)); | |
+#ifdef VISUAL_THREAD_MODEL_POSIX | |
pthread_mutex_init (&mutex->mutex, NULL); | |
+#endif | |
return VISUAL_OK; | |
} | |
static int mutex_lock_posix (VisMutex *mutex) | |
{ | |
+#ifdef VISUAL_THREAD_MODEL_POSIX | |
if (pthread_mutex_lock (&mutex->mutex) < 0) | |
return -VISUAL_ERROR_MUTEX_LOCK_FAILURE; | |
+#endif | |
return VISUAL_OK; | |
} | |
static int mutex_trylock_posix (VisMutex *mutex) | |
{ | |
+#ifdef VISUAL_THREAD_MODEL_POSIX | |
if (pthread_mutex_trylock (&mutex->mutex) < 0) | |
return -VISUAL_ERROR_MUTEX_TRYLOCK_FAILURE; | |
+#endif | |
return VISUAL_OK; | |
} | |
static int mutex_unlock_posix (VisMutex *mutex) | |
{ | |
+#ifdef VISUAL_THREAD_MODEL_POSIX | |
if (pthread_mutex_unlock (&mutex->mutex) < 0) | |
return -VISUAL_ERROR_MUTEX_UNLOCK_FAILURE; | |
+#endif | |
return VISUAL_OK; | |
} | |
-#endif // VISUAL_THREAD_MODEL_POSIX | |
- | |
-/* Windows32 implementation */ | |
#ifdef VISUAL_THREAD_MODEL_WIN32 | |
- | |
+/* Windows32 implementation */ | |
static VisThread *thread_create_win32 (VisThreadFunc func, void *data, int joinable) | |
{ | |
VisThread *thread = NULL; | |
@@ -601,12 +612,16 @@ | |
return thread; | |
} | |
+#endif | |
+#ifdef VISUAL_THREAD_MODEL_WIN32 | |
static int thread_free_win32 (VisThread *thread) | |
{ | |
return visual_mem_free (thread); | |
} | |
+#endif | |
+#ifdef VISUAL_THREAD_MODEL_WIN32 | |
static void *thread_join_win32 (VisThread *thread) | |
{ | |
void *result = NULL; | |
@@ -624,51 +639,72 @@ | |
return result; | |
} | |
+#endif | |
+#ifdef VISUAL_THREAD_MODEL_WIN32 | |
static void thread_exit_win32 (void *retval) | |
{ | |
+ | |
} | |
+#endif | |
+#ifdef VISUAL_THREAD_MODEL_WIN32 | |
static void thread_yield_win32 () | |
{ | |
-} | |
+} | |
+#endif | |
+#ifdef VISUAL_THREAD_MODEL_WIN32 | |
static VisMutex *mutex_new_win32 () | |
{ | |
- return 0; | |
+ | |
+ return NULL; | |
} | |
+#endif | |
+#ifdef VISUAL_THREAD_MODEL_WIN32 | |
static int mutex_free_win32 (VisMutex *mutex) | |
{ | |
+ | |
return 0; | |
} | |
+#endif | |
+#ifdef VISUAL_THREAD_MODEL_WIN32 | |
static int mutex_init_win32 (VisMutex *mutex) | |
{ | |
+ | |
return 0; | |
} | |
+#endif | |
+#ifdef VISUAL_THREAD_MODEL_WIN32 | |
static int mutex_lock_win32 (VisMutex *mutex) | |
{ | |
+ | |
return 0; | |
} | |
+#endif | |
+#ifdef VISUAL_THREAD_MODEL_WIN32 | |
static int mutex_trylock_win32 (VisMutex *mutex) | |
{ | |
+ | |
return 0; | |
} | |
+#endif | |
+#ifdef VISUAL_THREAD_MODEL_WIN32 | |
static int mutex_unlock_win32 (VisMutex *mutex) | |
{ | |
+ | |
return 0; | |
} | |
+#endif | |
-#endif /* VISUAL_THREAD_MODEL_WIN32 */ | |
- | |
-/* GThread implementation */ | |
#ifdef VISUAL_THREAD_MODEL_GTHREAD2 | |
- | |
+/* GThread implementation */ | |
static VisThread *thread_create_gthread (VisThreadFunc func, void *data, int joinable) | |
{ | |
VisThread *thread = NULL; | |
@@ -687,12 +723,16 @@ | |
return thread; | |
} | |
+#endif | |
+#ifdef VISUAL_THREAD_MODEL_GTHREAD2 | |
static int thread_free_gthread (VisThread *thread) | |
{ | |
return visual_mem_free (thread); | |
} | |
+#endif | |
+#ifdef VISUAL_THREAD_MODEL_GTHREAD2 | |
static void *thread_join_gthread (VisThread *thread) | |
{ | |
gpointer result; | |
@@ -703,18 +743,24 @@ | |
return result; | |
} | |
+#endif | |
+#ifdef VISUAL_THREAD_MODEL_GTHREAD2 | |
static void thread_exit_gthread (void *retval) | |
{ | |
g_thread_exit (retval); | |
} | |
+#endif | |
+#ifdef VISUAL_THREAD_MODEL_GTHREAD2 | |
static void thread_yield_gthread () | |
{ | |
g_thread_yield (); | |
} | |
+#endif | |
+#ifdef VISUAL_THREAD_MODEL_GTHREAD2 | |
static VisMutex *mutex_new_gthread () | |
{ | |
VisMutex *mutex; | |
@@ -727,7 +773,9 @@ | |
return mutex; | |
} | |
+#endif | |
+#ifdef VISUAL_THREAD_MODEL_GTHREAD2 | |
static int mutex_free_gthread (VisMutex *mutex) | |
{ | |
visual_log_return_val_if_fail (mutex->mutex != NULL, -VISUAL_ERROR_MUTEX_NULL); | |
@@ -736,7 +784,9 @@ | |
return visual_mem_free (mutex); | |
} | |
+#endif | |
+#ifdef VISUAL_THREAD_MODEL_GTHREAD2 | |
static int mutex_init_gthread (VisMutex *mutex) | |
{ | |
mutex->static_mutex_used = TRUE; | |
@@ -745,7 +795,9 @@ | |
return VISUAL_OK; | |
} | |
+#endif | |
+#ifdef VISUAL_THREAD_MODEL_GTHREAD2 | |
static int mutex_lock_gthread (VisMutex *mutex) | |
{ | |
if (mutex->static_mutex_used == TRUE) | |
@@ -755,7 +807,9 @@ | |
return VISUAL_OK; | |
} | |
+#endif | |
+#ifdef VISUAL_THREAD_MODEL_GTHREAD2 | |
static int mutex_trylock_gthread (VisMutex *mutex) | |
{ | |
if (mutex->static_mutex_used == TRUE) | |
@@ -765,7 +819,9 @@ | |
return VISUAL_OK; | |
} | |
+#endif | |
+#ifdef VISUAL_THREAD_MODEL_GTHREAD2 | |
static int mutex_unlock_gthread (VisMutex *mutex) | |
{ | |
if (mutex->static_mutex_used == TRUE) | |
@@ -775,5 +831,5 @@ | |
return VISUAL_OK; | |
} | |
+#endif | |
-#endif // VISUAL_THREAD_MODEL_GTHREAD2 | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_thread.h 2012-03-22 16:52:33.578363931 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_thread.h 2012-03-02 22:05:29.447672445 +0800 | |
@@ -1,8 +1,8 @@ | |
#ifndef _LV_THREAD_H | |
#define _LV_THREAD_H | |
-#include <libvisual/lvconfig.h> | |
-#include <libvisual/lv_common.h> | |
+#include "lvconfig.h" | |
+#include "lv_common.h" | |
#include "lvconfig.h" | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_time.h 2012-03-22 16:52:33.578363931 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_time.h 2012-03-02 22:05:29.447672445 +0800 | |
@@ -27,7 +27,7 @@ | |
#include <sys/time.h> | |
#include <time.h> | |
-#include <libvisual/lv_common.h> | |
+#include "lv_common.h" | |
VISUAL_BEGIN_DECLS | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_transform.h 2012-03-22 16:52:33.578363931 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_transform.h 2012-03-02 22:05:29.447672445 +0800 | |
@@ -24,12 +24,12 @@ | |
#ifndef _LV_TRANSFORM_H | |
#define _LV_TRANSFORM_H | |
-#include <libvisual/lv_audio.h> | |
-#include <libvisual/lv_video.h> | |
-#include <libvisual/lv_palette.h> | |
-#include <libvisual/lv_plugin.h> | |
-#include <libvisual/lv_songinfo.h> | |
-#include <libvisual/lv_event.h> | |
+#include "lv_audio.h" | |
+#include "lv_video.h" | |
+#include "lv_palette.h" | |
+#include "lv_plugin.h" | |
+#include "lv_songinfo.h" | |
+#include "lv_event.h" | |
VISUAL_BEGIN_DECLS | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_types.h 2012-03-22 16:52:33.578363931 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_types.h 2012-03-02 22:05:29.447672445 +0800 | |
@@ -24,7 +24,7 @@ | |
#ifndef _LV_TYPES_H | |
#define _LV_TYPES_H | |
-#include <libvisual/lv_defines.h> | |
+#include "lv_defines.h" | |
#if defined(VISUAL_OS_WIN32) | |
#include <stdint.h> | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_ui.c 2012-03-22 16:52:33.582363931 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_ui.c 2012-03-02 22:05:29.451672444 +0800 | |
@@ -339,8 +339,8 @@ | |
*/ | |
VisList *visual_ui_box_get_childs (VisUIBox *box) | |
{ | |
- VisUIWidget *next; | |
- VisListEntry *le = NULL; | |
+ //VisUIWidget *next; | |
+ //VisListEntry *le = NULL; | |
visual_log_return_val_if_fail (box != NULL, NULL); | |
@@ -1066,7 +1066,7 @@ | |
*/ | |
int visual_ui_choice_add_many (VisUIChoice *choice, VisParamEntry *paramchoices) | |
{ | |
- VisUIChoiceEntry *centry; | |
+ //VisUIChoiceEntry *centry; | |
int i = 0; | |
visual_log_return_val_if_fail (choice != NULL, -VISUAL_ERROR_UI_CHOICE_NULL); | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_ui.h 2012-03-22 16:52:33.582363931 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_ui.h 2012-03-02 22:05:29.451672444 +0800 | |
@@ -24,10 +24,10 @@ | |
#ifndef _LV_UI_H | |
#define _LV_UI_H | |
-#include <libvisual/lv_list.h> | |
-#include <libvisual/lv_param.h> | |
-#include <libvisual/lv_video.h> | |
-#include <libvisual/lv_common.h> | |
+#include "lv_list.h" | |
+#include "lv_param.h" | |
+#include "lv_video.h" | |
+#include "lv_common.h" | |
VISUAL_BEGIN_DECLS | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_utils.c 2012-03-23 21:09:12.123731556 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_utils.c 2012-03-02 22:05:29.451672444 +0800 | |
@@ -43,7 +43,27 @@ | |
*/ | |
int visual_utils_is_power_of_2 (int n) | |
{ | |
- return (n > 0) && !(n & (n - 1)); | |
+ int bits_found = FALSE; | |
+ | |
+ if (n < 1) | |
+ return FALSE; | |
+ | |
+ do { | |
+ if (n & 1) { | |
+ if (bits_found) | |
+ return FALSE; | |
+ | |
+ bits_found = TRUE; | |
+ } | |
+ | |
+ n >>= 1; | |
+ | |
+ } while (n > 0); | |
+ | |
+ /* Couldn't we use this: */ | |
+ /* FIXME: (n & (n -1)) == 0) */ | |
+ | |
+ return TRUE; | |
} | |
/** | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_utils.h 2012-03-22 16:52:33.582363931 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_utils.h 2012-03-02 22:05:29.451672444 +0800 | |
@@ -24,7 +24,7 @@ | |
#ifndef _LV_UTILS_H | |
#define _LV_UTILS_H | |
-#include <libvisual/lv_common.h> | |
+#include "lv_common.h" | |
VISUAL_BEGIN_DECLS | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_video.c 2012-03-23 03:45:36.209350718 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_video.c 2012-03-07 07:53:09.766566422 +0800 | |
@@ -249,6 +249,11 @@ | |
int visual_video_free_buffer (VisVideo *video) | |
{ | |
visual_log_return_val_if_fail (video != NULL, -VISUAL_ERROR_VIDEO_NULL); | |
+ if(!visual_video_get_pixels(video)) | |
+ { | |
+ int *tmp = NULL; | |
+ *tmp = 0; | |
+ } | |
visual_log_return_val_if_fail (visual_video_get_pixels (video) != NULL, -VISUAL_ERROR_VIDEO_PIXELS_NULL); | |
if (video->pixel_rows != NULL) | |
@@ -1441,16 +1446,23 @@ | |
} else if (dest->depth == VISUAL_VIDEO_DEPTH_16BIT) { | |
for (y = 0; y < src->height; y++) { | |
- _color16 *destr = (_color16 *) destbuf; | |
- _color16 *srcr = (_color16 *) srcbuf; | |
+ //_color16 *destr = (_color16 *) destbuf; | |
+ //_color16 *srcr = (_color16 *) srcbuf; | |
+ _color16 destr; | |
+ _color16 srcr; | |
+ int cnt = 0; | |
for (x = 0; x < src->width; x++) { | |
- destr->r = ((alpha * (srcr->r - destr->r) >> 8) + destr->r); | |
- destr->g = ((alpha * (srcr->g - destr->g) >> 8) + destr->g); | |
- destr->b = ((alpha * (srcr->b - destr->b) >> 8) + destr->b); | |
- | |
- destr += 1; | |
- srcr += 1; | |
+ memcpy(&srcr, srcbuf + cnt, sizeof(_color16)); | |
+ memcpy(&destr, destbuf + cnt, sizeof(_color16)); | |
+ destr.r = ((alpha * (srcr.r - destr.r) >> 8) + destr.r); | |
+ destr.g = ((alpha * (srcr.g - destr.g) >> 8) + destr.g); | |
+ destr.b = ((alpha * (srcr.b - destr.b) >> 8) + destr.b); | |
+ memcpy(destbuf + cnt, &destr, sizeof(uint8_t) * 2); | |
+ | |
+ //destr += 1; | |
+ //srcr += 1; | |
+ cnt += 1; | |
} | |
destbuf += dest->pitch; | |
@@ -1495,9 +1507,10 @@ | |
static int blit_overlay_surfacealphacolorkey (VisVideo *dest, VisVideo *src) | |
{ | |
+ visual_log(VISUAL_LOG_DEBUG, "blit_overlay_surfacealphacolorkey"); | |
int x, y; | |
- uint8_t *destbuf = visual_video_get_pixels (dest); | |
- uint8_t *srcbuf = visual_video_get_pixels (src); | |
+ uint8_t *destbuf __attribute__ ((__aligned__(4))) = visual_video_get_pixels (dest); | |
+ uint8_t *srcbuf __attribute__ ((__aligned__(4))) = visual_video_get_pixels (src); | |
uint8_t alpha = src->density; | |
if (dest->depth == VISUAL_VIDEO_DEPTH_8BIT) { | |
@@ -1528,18 +1541,22 @@ | |
uint16_t color = visual_color_to_uint16 (&src->colorkey); | |
for (y = 0; y < src->height; y++) { | |
- _color16 *destr = (_color16 *) destbuf; | |
- _color16 *srcr = (_color16 *) srcbuf; | |
+ _color16 destr;// = (_color16 *) destbuf; | |
+ _color16 srcr;// = (_color16 *) srcbuf; | |
+ int cnt = 0; | |
for (x = 0; x < src->width; x++) { | |
- if (color != *((uint16_t *) srcr)) { | |
- destr->r = ((alpha * (srcr->r - destr->r) >> 8) + destr->r); | |
- destr->g = ((alpha * (srcr->g - destr->g) >> 8) + destr->g); | |
- destr->b = ((alpha * (srcr->b - destr->b) >> 8) + destr->b); | |
- } | |
- | |
- destr++; | |
- srcr++; | |
+ memcpy(&srcr, srcbuf + cnt, sizeof(_color16)); | |
+ memcpy(&destr, destbuf + cnt, sizeof(_color16)); | |
+ if (color != *((uint16_t *) &srcr)) { | |
+ destr.r = ((alpha * (srcr.r - destr.r) >> 8) + destr.r); | |
+ destr.g = ((alpha * (srcr.g - destr.g) >> 8) + destr.g); | |
+ destr.b = ((alpha * (srcr.b - destr.b) >> 8) + destr.b); | |
+ } | |
+ memcpy(destbuf + cnt, &destr, sizeof(uint16_t)); | |
+ cnt++; | |
+ //destr++; | |
+ //srcr++; | |
} | |
destbuf += dest->pitch; | |
@@ -1572,7 +1589,12 @@ | |
for (y = 0; y < src->height; y++) { | |
for (x = 0; x < src->width; x++) { | |
- if (color == *((uint32_t *) destbuf)) { | |
+ int b = destbuf[0]; | |
+ int g = destbuf[1]; | |
+ int r = destbuf[2]; | |
+ int a = destbuf[3]; | |
+ int point = b | g | r | a; | |
+ if (color == point) { | |
*destbuf = ((alpha * (*srcbuf - *destbuf) >> 8) + *destbuf); | |
*(destbuf + 1) = ((alpha * (*(srcbuf + 1) - *(destbuf + 1)) >> 8) + *(destbuf + 1)); | |
*(destbuf + 2) = ((alpha * (*(srcbuf + 2) - *(destbuf + 2)) >> 8) + *(destbuf + 2)); | |
@@ -1701,7 +1723,7 @@ | |
int visual_video_fill_color (VisVideo *video, VisColor *rcolor) | |
{ | |
VisColor color; | |
- VisRectangle rect; | |
+ //VisRectangle rect; | |
visual_log_return_val_if_fail (video != NULL, -VISUAL_ERROR_VIDEO_NULL); | |
@@ -1763,6 +1785,7 @@ | |
errret = visual_video_fill_color (&svid, color); | |
+//out: | |
visual_object_unref (VISUAL_OBJECT (&svid)); | |
return errret; | |
@@ -1805,6 +1828,8 @@ | |
static int fill_color24 (VisVideo *video, VisColor *color) | |
{ | |
+ visual_log(VISUAL_LOG_DEBUG, "fill_color24 ------------------------------------------ "); | |
+ | |
int x, y; | |
uint32_t *buf; | |
uint8_t *rbuf = visual_video_get_pixels (video); | |
@@ -1827,12 +1852,17 @@ | |
(color->r); | |
for (y = 0; y < video->height; y++) { | |
- buf = (uint32_t *) rbuf; | |
+ buf = malloc(video->pitch);//(uint32_t *) rbuf; | |
+ | |
+ memcpy(buf, rbuf, video->pitch); | |
for (x = video->width; x >= video->bpp; x -= video->bpp) { | |
- *(buf++) = cola; | |
- *(buf++) = colb; | |
- *(buf++) = colc; | |
+ uint8_t b = rbuf[0]; | |
+ uint8_t g = rbuf[1]; | |
+ uint8_t r = rbuf[2]; | |
+ *(rbuf++) = cola; | |
+ *(rbuf++) = colb; | |
+ *(rbuf++) = colc; | |
} | |
buf8 = (uint8_t *) buf; | |
@@ -1842,6 +1872,8 @@ | |
rbuf += video->pitch; | |
+ | |
+ free(buf); | |
} | |
return VISUAL_OK; | |
@@ -2624,6 +2656,7 @@ | |
return VISUAL_OK; | |
} | |
+ | |
static int depth_transform_32_to_24_c (VisVideo *dest, VisVideo *src) | |
{ | |
int x, y; | |
@@ -2711,7 +2744,7 @@ | |
{ | |
uint8_t *destbuf, *srcbuf; | |
int x, y; | |
- int i = 0; | |
+ //int i = 0; | |
int pitchdiff = dest->pitch - (dest->width * dest->bpp); | |
destbuf = visual_video_get_pixels (dest); | |
@@ -3164,7 +3197,7 @@ | |
u = 0; | |
for (x = dest->width - 1; x--; u += du) { | |
- uint8_t cul, cll, cur, clr, b; | |
+ uint8_t cul, cll, cur, clr; | |
uint32_t ul, ll, ur, lr; /* fixed point 16.16 [0,1[ */ | |
uint32_t b0; /* fixed point 16.16 [0,255[ */ | |
@@ -3227,7 +3260,7 @@ | |
for (x = dest->width - 1; x--; u += du) { | |
_color16 cul, cll, cur, clr, b; | |
uint32_t ul, ll, ur, lr; /* fixed point 16.16 [0,1[ */ | |
- uint32_t b3, b2, b1, b0; /* fixed point 16.16 [0,255[ */ | |
+ uint32_t b2, b1, b0; /* fixed point 16.16 [0,255[ */ | |
/* fracU = frac(u) = u & 0xffff */ | |
/* fixed point format convertion: fracU >>= 8) */ | |
@@ -3302,7 +3335,7 @@ | |
for (x = dest->width - 1; x--; u += du) { | |
_color24 cul, cll, cur, clr, b; | |
uint32_t ul, ll, ur, lr; /* fixed point 16.16 [0,1[ */ | |
- uint32_t b3, b2, b1, b0; /* fixed point 16.16 [0,255[ */ | |
+ uint32_t b2, b1, b0; /* fixed point 16.16 [0,255[ */ | |
/* fracU = frac(u) = u & 0xffff */ | |
/* fixed point format convertion: fracU >>= 8) */ | |
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 | |
--- libvisual.master/libvisual/libvisual/lv_video.h 2012-03-22 16:52:33.582363931 +0800 | |
+++ FroyVisuals/jni/libvisual/lv_video.h 2012-03-02 22:05:29.451672444 +0800 | |
@@ -27,11 +27,11 @@ | |
#ifndef _LV_VIDEO_H | |
#define _LV_VIDEO_H | |
-#include <libvisual/lv_common.h> | |
-#include <libvisual/lv_palette.h> | |
-#include <libvisual/lv_rectangle.h> | |
-#include <libvisual/lv_buffer.h> | |
-#include <libvisual/lv_gl.h> | |
+#include "lv_common.h" | |
+#include "lv_palette.h" | |
+#include "lv_rectangle.h" | |
+#include "lv_buffer.h" | |
+#include "lv_gl.h" | |
VISUAL_BEGIN_DECLS | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment