aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/dfsound/pulseaudio.c16
-rw-r--r--plugins/gpu-gles/Makefile3
-rw-r--r--plugins/gpulib/cspace.c30
-rw-r--r--plugins/gpulib/cspace.h1
4 files changed, 36 insertions, 14 deletions
diff --git a/plugins/dfsound/pulseaudio.c b/plugins/dfsound/pulseaudio.c
index 057c2c4..8ffd58f 100644
--- a/plugins/dfsound/pulseaudio.c
+++ b/plugins/dfsound/pulseaudio.c
@@ -17,12 +17,10 @@ comment : Much of this was taken from simple.c, in the pulseaudio
* *
***************************************************************************/
-#include "stdafx.h"
+#include <stdio.h>
-#define _IN_OSS
-
-#include "externals.h"
#include <pulse/pulseaudio.h>
+#include "out.h"
////////////////////////////////////////////////////////////////////////
// pulseaudio structs
@@ -134,7 +132,7 @@ static void stream_request_cb (pa_stream *stream, size_t length, void *userdata)
// SETUP SOUND
////////////////////////////////////////////////////////////////////////
-static void pulse_init(void)
+static int pulse_init(void)
{
int error_number;
@@ -227,7 +225,7 @@ static void pulse_init(void)
//pa_stream_flags_t flags = (pa_stream_flags_t) (PA_STREAM_INTERPOLATE_TIMING | PA_STREAM_AUTO_TIMING_UPDATE | PA_STREAM_EARLY_REQUESTS);
if (pa_stream_connect_playback (device.stream, NULL, &buffer_attributes, flags, NULL, NULL) < 0)
{
- pa_context_errno (device.context);
+ error_number = pa_context_errno (device.context);
fprintf (stderr, "Could not connect for playback: %s\n", pa_strerror (error_number));
return -1;
}
@@ -296,9 +294,6 @@ static void pulse_finish(void)
static int pulse_busy(void)
{
int free_space;
- int error_code;
- long latency;
- int playing = 0;
if ((device.mainloop == NULL) || (device.api == NULL) || ( device.context == NULL) || (device.stream == NULL))
return 1;
@@ -329,9 +324,6 @@ static int pulse_busy(void)
static void pulse_feed(void *pSound, int lBytes)
{
- int error_code;
- int size;
-
if (device.mainloop != NULL)
{
pa_threaded_mainloop_lock (device.mainloop);
diff --git a/plugins/gpu-gles/Makefile b/plugins/gpu-gles/Makefile
index 421a6e7..769a68b 100644
--- a/plugins/gpu-gles/Makefile
+++ b/plugins/gpu-gles/Makefile
@@ -12,7 +12,8 @@ ifeq "$(PLATFORM)" "caanoo"
CFLAGS += -DFAKE_WINDOW
LDLIBS += -lopengles_lite -lstdc++
else
-LDLIBS += -lGLES_CM
+CFLAGS += $(CFLAGS_GLES)
+LDLIBS += $(LDLIBS_GLES)
endif
BIN_STANDLALONE = gpuGLES.so
diff --git a/plugins/gpulib/cspace.c b/plugins/gpulib/cspace.c
index 8e3bee9..f0c4912 100644
--- a/plugins/gpulib/cspace.c
+++ b/plugins/gpulib/cspace.c
@@ -91,6 +91,35 @@ void bgr_to_uyvy_init(void)
}
}
+void rgb565_to_uyvy(void *d, const void *s, int pixels)
+{
+ unsigned int *dst = d;
+ const unsigned short *src = s;
+ const unsigned char *yu = yuv_u + 32;
+ const unsigned char *yv = yuv_v + 32;
+ int r0, g0, b0, r1, g1, b1;
+ int y0, y1, u, v;
+
+ for (; pixels > 0; src += 2, dst++, pixels -= 2)
+ {
+ r0 = (src[0] >> 11) & 0x1f;
+ g0 = (src[0] >> 6) & 0x1f;
+ b0 = src[0] & 0x1f;
+ r1 = (src[1] >> 11) & 0x1f;
+ g1 = (src[1] >> 6) & 0x1f;
+ b1 = src[1] & 0x1f;
+ y0 = (yuv_ry[r0] + yuv_gy[g0] + yuv_by[b0]) >> 16;
+ y1 = (yuv_ry[r1] + yuv_gy[g1] + yuv_by[b1]) >> 16;
+ u = yu[b0 - y0];
+ v = yv[r0 - y0];
+ // valid Y range seems to be 16..235
+ y0 = 16 + 219 * y0 / 31;
+ y1 = 16 + 219 * y1 / 31;
+
+ *dst = (y1 << 24) | (v << 16) | (y0 << 8) | u;
+ }
+}
+
void bgr555_to_uyvy(void *d, const void *s, int pixels)
{
unsigned int *dst = d;
@@ -112,7 +141,6 @@ void bgr555_to_uyvy(void *d, const void *s, int pixels)
y1 = (yuv_ry[r1] + yuv_gy[g1] + yuv_by[b1]) >> 16;
u = yu[b0 - y0];
v = yv[r0 - y0];
- // valid Y range seems to be 16..235
y0 = 16 + 219 * y0 / 31;
y1 = 16 + 219 * y1 / 31;
diff --git a/plugins/gpulib/cspace.h b/plugins/gpulib/cspace.h
index 95eae85..1a9e339 100644
--- a/plugins/gpulib/cspace.h
+++ b/plugins/gpulib/cspace.h
@@ -9,6 +9,7 @@ void bgr888_to_rgb565(void *dst, const void *src, int bytes);
void rgb888_to_rgb565(void *dst, const void *src, int bytes);
void bgr_to_uyvy_init(void);
+void rgb565_to_uyvy(void *d, const void *s, int pixels);
void bgr555_to_uyvy(void *d, const void *s, int pixels);
void bgr888_to_uyvy(void *d, const void *s, int pixels);