aboutsummaryrefslogtreecommitdiffhomepage
path: root/libvo
diff options
context:
space:
mode:
authorGravatar Uoti Urpala <uau@mplayer2.org>2011-06-29 11:39:06 +0300
committerGravatar Uoti Urpala <uau@mplayer2.org>2011-06-29 11:39:06 +0300
commita77e5f07ed513233314c18f3e45490fdfa11f6ba (patch)
treea369f5e54f1b91729712272f1f73ad3f0e7d7d66 /libvo
parent9caae9b385a6de3f4dae98bebb1be64a997c1472 (diff)
parent27b88a09c5319deb62221b8cd0ecc14cd1136e4a (diff)
Merge branch 'mplayer1_changes'
Diffstat (limited to 'libvo')
-rw-r--r--libvo/gl_common.c6
-rw-r--r--libvo/gl_common.h3
-rw-r--r--libvo/vo_dfbmga.c4
-rw-r--r--libvo/vo_directfb2.c4
-rw-r--r--libvo/vo_gl.c18
-rw-r--r--libvo/vo_gl2.c12
6 files changed, 27 insertions, 20 deletions
diff --git a/libvo/gl_common.c b/libvo/gl_common.c
index ad6fc99a64..cee413d3b3 100644
--- a/libvo/gl_common.c
+++ b/libvo/gl_common.c
@@ -183,7 +183,7 @@ static const struct gl_name_map_struct gl_name_map[] = {
MAP(GL_R3_G3_B2), MAP(GL_RGB4), MAP(GL_RGB5), MAP(GL_RGB8),
MAP(GL_RGB10), MAP(GL_RGB12), MAP(GL_RGB16), MAP(GL_RGBA2),
MAP(GL_RGBA4), MAP(GL_RGB5_A1), MAP(GL_RGBA8), MAP(GL_RGB10_A2),
- MAP(GL_RGBA12), MAP(GL_RGBA16), MAP(GL_LUMINANCE8),
+ MAP(GL_RGBA12), MAP(GL_RGBA16), MAP(GL_LUMINANCE8), MAP(GL_LUMINANCE16),
// format
MAP(GL_RGB), MAP(GL_RGBA), MAP(GL_RED), MAP(GL_GREEN), MAP(GL_BLUE),
@@ -254,7 +254,7 @@ int glFindFormat(uint32_t fmt, int *bpp, GLint *gl_texfmt,
if (!gl_format) gl_format = &dummy2;
if (!gl_type) gl_type = &dummy2;
- if (mp_get_chroma_shift(fmt, NULL, NULL)) {
+ if (mp_get_chroma_shift(fmt, NULL, NULL, NULL)) {
// reduce the possible cases a bit
if (IMGFMT_IS_YUVP16_LE(fmt))
fmt = IMGFMT_420P16_LE;
@@ -282,7 +282,7 @@ int glFindFormat(uint32_t fmt, int *bpp, GLint *gl_texfmt,
break;
case IMGFMT_420P16:
supported = 0; // no native YUV support
- *gl_texfmt = 1;
+ *gl_texfmt = GL_LUMINANCE16;
*bpp = 16;
*gl_format = GL_LUMINANCE;
*gl_type = GL_UNSIGNED_SHORT;
diff --git a/libvo/gl_common.h b/libvo/gl_common.h
index ddf0856956..fa0cffaf74 100644
--- a/libvo/gl_common.h
+++ b/libvo/gl_common.h
@@ -266,6 +266,9 @@
#ifndef GL_FLOAT_RGB32_NV
#define GL_FLOAT_RGB32_NV 0x8889
#endif
+#ifndef GL_LUMINANCE16
+#define GL_LUMINANCE16 0x8042
+#endif
#ifndef GL_UNPACK_CLIENT_STORAGE_APPLE
#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2
#endif
diff --git a/libvo/vo_dfbmga.c b/libvo/vo_dfbmga.c
index 76ae4a46f9..57b798040e 100644
--- a/libvo/vo_dfbmga.c
+++ b/libvo/vo_dfbmga.c
@@ -1335,7 +1335,7 @@ draw_image( mp_image_t *mpi )
}
static int
-set_equalizer( char *data, int value )
+set_equalizer( const char *data, int value )
{
DFBResult res;
DFBColorAdjustment ca;
@@ -1375,7 +1375,7 @@ set_equalizer( char *data, int value )
}
static int
-get_equalizer( char *data, int *value )
+get_equalizer( const char *data, int *value )
{
DFBResult res;
DFBColorAdjustment ca;
diff --git a/libvo/vo_directfb2.c b/libvo/vo_directfb2.c
index de44b2ea51..ae15918b53 100644
--- a/libvo/vo_directfb2.c
+++ b/libvo/vo_directfb2.c
@@ -980,7 +980,7 @@ static void uninit(void)
}
-static uint32_t directfb_set_video_eq(char *data, int value) //data==name
+static uint32_t directfb_set_video_eq(const char *data, int value) //data==name
{
DFBColorAdjustment ca;
@@ -1038,7 +1038,7 @@ if (layer) {
}
-static uint32_t directfb_get_video_eq(char *data, int *value) // data==name
+static uint32_t directfb_get_video_eq(const char *data, int *value) // data==name
{
DFBColorAdjustment ca;
diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c
index e663057beb..bc50e245b3 100644
--- a/libvo/vo_gl.c
+++ b/libvo/vo_gl.c
@@ -258,7 +258,7 @@ static void update_yuvconv(void) {
gl_conversion_params_t params = {gl_target, yuvconvtype,
{colorspace, levelconv, bri, cont, hue, sat, rgamma, ggamma, bgamma},
texture_width, texture_height, 0, 0, filter_strength};
- mp_get_chroma_shift(image_format, &xs, &ys);
+ mp_get_chroma_shift(image_format, &xs, &ys, NULL);
params.chrom_texw = params.texw >> xs;
params.chrom_texh = params.texh >> ys;
glSetupYUVConversion(&params);
@@ -568,7 +568,7 @@ static int initGl(uint32_t d_width, uint32_t d_height) {
int i;
int xs, ys;
scale_type = get_scale_type(1);
- mp_get_chroma_shift(image_format, &xs, &ys);
+ mp_get_chroma_shift(image_format, &xs, &ys, NULL);
mpglGenTextures(21, default_texs);
default_texs[21] = 0;
for (i = 0; i < 7; i++) {
@@ -670,7 +670,7 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
image_height = height;
image_width = width;
image_format = format;
- is_yuv = mp_get_chroma_shift(image_format, &xs, &ys) > 0;
+ is_yuv = mp_get_chroma_shift(image_format, &xs, &ys, NULL) > 0;
is_yuv |= (xs << 8) | (ys << 16);
glFindFormat(format, NULL, &gl_texfmt, &gl_format, &gl_type);
@@ -884,7 +884,7 @@ static int draw_slice(uint8_t *src[], int stride[], int w,int h,int x,int y)
x, y, w, h, slice_height);
if (is_yuv) {
int xs, ys;
- mp_get_chroma_shift(image_format, &xs, &ys);
+ mp_get_chroma_shift(image_format, &xs, &ys, NULL);
mpglActiveTexture(GL_TEXTURE1);
glUploadTex(gl_target, gl_format, gl_type, src[1], stride[1],
x >> xs, y >> ys, w >> xs, h >> ys, slice_height);
@@ -951,7 +951,7 @@ static uint32_t get_image(mp_image_t *mpi) {
if (is_yuv) {
// planar YUV
int xs, ys;
- mp_get_chroma_shift(image_format, &xs, &ys);
+ mp_get_chroma_shift(image_format, &xs, &ys, NULL);
mpi->flags |= MP_IMGFLAG_COMMON_STRIDE | MP_IMGFLAG_COMMON_PLANE;
mpi->stride[0] = mpi->width;
mpi->planes[1] = mpi->planes[0] + mpi->stride[0] * mpi->height;
@@ -1009,7 +1009,7 @@ static uint32_t draw_image(mp_image_t *mpi) {
if (force_pbo && !(mpi->flags & MP_IMGFLAG_DIRECT) && !gl_bufferptr && get_image(&mpi2) == VO_TRUE) {
int bpp = is_yuv ? 8 : mpi->bpp;
int xs, ys;
- mp_get_chroma_shift(image_format, &xs, &ys);
+ mp_get_chroma_shift(image_format, &xs, &ys, NULL);
memcpy_pic(mpi2.planes[0], mpi->planes[0], mpi->w * bpp / 8, mpi->h, mpi2.stride[0], mpi->stride[0]);
if (is_yuv) {
memcpy_pic(mpi2.planes[1], mpi->planes[1], mpi->w >> xs, mpi->h >> ys, mpi2.stride[1], mpi->stride[1]);
@@ -1051,7 +1051,7 @@ static uint32_t draw_image(mp_image_t *mpi) {
mpi->x, mpi->y, w, h, slice);
if (is_yuv) {
int xs, ys;
- mp_get_chroma_shift(image_format, &xs, &ys);
+ mp_get_chroma_shift(image_format, &xs, &ys, NULL);
if ((mpi->flags & MP_IMGFLAG_DIRECT) && !(mpi->flags & MP_IMGFLAG_COMMON_PLANE)) {
mpglBindBuffer(GL_PIXEL_UNPACK_BUFFER, gl_buffer_uv[0]);
mpglUnmapBuffer(GL_PIXEL_UNPACK_BUFFER);
@@ -1088,6 +1088,7 @@ draw_frame(uint8_t *src[])
static int
query_format(uint32_t format)
{
+ int depth;
int caps = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW |
VFCAP_FLIP |
VFCAP_HWSCALE_UP | VFCAP_HWSCALE_DOWN | VFCAP_ACCEPT_STRIDE;
@@ -1095,7 +1096,8 @@ query_format(uint32_t format)
caps |= VFCAP_OSD | VFCAP_EOSD | (scaled_osd ? 0 : VFCAP_EOSD_UNSCALED);
if (format == IMGFMT_RGB24 || format == IMGFMT_RGBA)
return caps;
- if (use_yuv && mp_get_chroma_shift(format, NULL, NULL) &&
+ if (use_yuv && mp_get_chroma_shift(format, NULL, NULL, &depth) &&
+ (depth == 8 || depth == 16) &&
(IMGFMT_IS_YUVP16_NE(format) || !IMGFMT_IS_YUVP16(format)))
return caps;
// HACK, otherwise we get only b&w with some filters (e.g. -vf eq)
diff --git a/libvo/vo_gl2.c b/libvo/vo_gl2.c
index 957125069b..21f779866c 100644
--- a/libvo/vo_gl2.c
+++ b/libvo/vo_gl2.c
@@ -274,7 +274,7 @@ static int initTextures(void)
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
if (is_yuv) {
int xs, ys;
- mp_get_chroma_shift(image_format, &xs, &ys);
+ mp_get_chroma_shift(image_format, &xs, &ys, NULL);
mpglActiveTexture(GL_TEXTURE1);
glCreateClearTex(GL_TEXTURE_2D, gl_internal_format, gl_bitmap_format, gl_bitmap_type, GL_LINEAR,
texture_width >> xs, texture_height >> ys, 128);
@@ -580,7 +580,7 @@ static int initGl(uint32_t d_width, uint32_t d_height)
mpglBindProgram(GL_FRAGMENT_PROGRAM, fragprog);
break;
}
- mp_get_chroma_shift(image_format, &xs, &ys);
+ mp_get_chroma_shift(image_format, &xs, &ys, NULL);
params.chrom_texw = params.texw >> xs;
params.chrom_texh = params.texh >> ys;
glSetupYUVConversion(&params);
@@ -616,7 +616,7 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
image_height = height;
image_width = width;
image_format = format;
- is_yuv = mp_get_chroma_shift(image_format, &xs, &ys) > 0;
+ is_yuv = mp_get_chroma_shift(image_format, &xs, &ys, NULL) > 0;
is_yuv |= (xs << 8) | (ys << 16);
#ifdef CONFIG_GL_WIN32
@@ -741,7 +741,7 @@ static int draw_slice(uint8_t *src[], int stride[], int w,int h,int x,int y)
struct TexSquare *texline = &texgrid[y / texture_height * texnumx];
int subtex_y = y % texture_width;
int xs, ys;
- mp_get_chroma_shift(image_format, &xs, &ys);
+ mp_get_chroma_shift(image_format, &xs, &ys, NULL);
while (rem_h > 0) {
int rem_w = w;
struct TexSquare *tsq = &texline[x / texture_width];
@@ -802,7 +802,9 @@ draw_frame(uint8_t *src[])
static int
query_format(uint32_t format)
{
- if (use_yuv && mp_get_chroma_shift(format, NULL, NULL) &&
+ int depth;
+ if (use_yuv && mp_get_chroma_shift(format, NULL, NULL, &depth) &&
+ (depth == 8 || depth == 16) &&
(IMGFMT_IS_YUVP16_NE(format) || !IMGFMT_IS_YUVP16(format)))
return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_OSD |
VFCAP_HWSCALE_UP | VFCAP_HWSCALE_DOWN | VFCAP_ACCEPT_STRIDE;