summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README-VDPAU42
-rw-r--r--debian/control1
-rw-r--r--m4/audio_out.m42
-rw-r--r--m4/summary.m44
-rw-r--r--src/demuxers/demux_ts.c34
-rw-r--r--src/video_dec/libvdpau/vdpau_mpeg12.c3
-rw-r--r--src/video_out/video_out_vdpau.c90
7 files changed, 102 insertions, 74 deletions
diff --git a/README-VDPAU b/README-VDPAU
index 51e087f09..c664e36af 100644
--- a/README-VDPAU
+++ b/README-VDPAU
@@ -1,38 +1,3 @@
-xine-vdpau README:
-------------------------------------------------------------------------------
-
-So, you want to give it a try, but wonder which steps are required.
-Ok, so here it is:
-
-0) you need nvidia's driver 180.22 or later.
-
-1) get the sources:
-svn co svn://jusst.de/xine-vdpau
-
-2) compile the sources:
-cd xine-vdpau
-./autogen.sh
-./configure
-make
-make install (as root)
- **(make sure that no other xine-lib installation will conflict with this one)
-
-3) edit your xine configuration
-nano $HOME/.xine/config (if it does not exist, first run "xine --no-logo" then quit.
-search for "engine.buffers.video_num_frames" and set it to 22
-
-4) running the beast:
-xine -verbose /path/to/a/working/sample
- ** --verbose will print some usefull things in your console (in case of problems,
- the developers will ask you to give this output, at least)
-
-5) update your svn copy quite often
-
-6) don't blame us if it crashes, burn you gpu (unlikely:) or anything else.
-
-
-------------------------------------------------------------------------------
-
FAQ:
Q:
@@ -67,4 +32,9 @@ A:
MAIL: http://lists.kafic.ba/mailman/listinfo/xine-vdpau
Eventually, nvnews.
-----------------------------------------------------------------------------
+Q:
+ What information do I need if there's a problem?
+A:
+ Run 'xine --verbose /path/to/a/working/sample' (or equivalent for your
+ chosen front end). You will probably be asked for this anyway, so it
+ helps to have it handy.
diff --git a/debian/control b/debian/control
index e69284d9b..078bd7090 100644
--- a/debian/control
+++ b/debian/control
@@ -12,6 +12,7 @@ Build-Depends: debhelper (>= 5.0.1), binutils (>= 2.12.90.0.9), pkg-config,
libxcb-shm0-dev | libxv-dev (<< 1:1.0.3),
libxcb-shape0-dev | libxv-dev (<< 1:1.0.3),
libxinerama-dev, libxv-dev, libxvmc-dev, libxt-dev,
+ libvdpau-dev | nvidia-libvdpau-dev,
libasound2-dev [!kfreebsd-i386 !kfreebsd-amd64 !hurd-i386],
libcam-dev [kfreebsd-i386 kfreebsd-amd64],
libaa1-dev, libcaca-dev, libmodplug-dev,
diff --git a/m4/audio_out.m4 b/m4/audio_out.m4
index 4edb4b691..569d72cc2 100644
--- a/m4/audio_out.m4
+++ b/m4/audio_out.m4
@@ -233,7 +233,7 @@ AC_DEFUN([XINE_AUDIO_OUT_PLUGINS], [
AC_ARG_ENABLE([sndio],
[AS_HELP_STRING([--without-sndio], [Build without sndio support])],
[test x"$enableval" != x"no" && enable_sndio="yes"],
- [test $default_enable_sndio = disable && enable_sndio="no"])
+ [test x"$default_enable_sndio" = x"disable" && enable_sndio="no"])
if test "x$enable_sndio" != "xno"; then
AC_CHECK_LIB([sndio], [sio_open], [SNDIO_LIBS=-lsndio; have_sndio=yes],
[have_sndio=no])
diff --git a/m4/summary.m4 b/m4/summary.m4
index d405f136c..2d1bc6fdc 100644
--- a/m4/summary.m4
+++ b/m4/summary.m4
@@ -78,7 +78,7 @@ AC_DEFUN([XINE_LIB_SUMMARY], [
test x"$have_imagemagick" = x"yes" && echo " - image"
test x"$have_theora" = x"yes" && echo " - theora"
test x"$have_w32dll" = x"yes" && echo " - w32dll"
- test x$"have_vdpau" = x"yes" && echo " - vdpau"
+ test x"$have_vdpau" = x"yes" && echo " - vdpau"
if test x"$with_external_ffmpeg" != x"no"; then
echo " - ffmpeg (external library)"
else
@@ -204,7 +204,7 @@ AC_DEFUN([XINE_LIB_SUMMARY], [
echo " - OpenGL"
fi
fi
- test x$"have_vdpau" = x"yes" && echo " - vdpau (X11 VDPAU)"
+ test x"$have_vdpau" = x"yes" && echo " - vdpau (X11 Video Decode and Presentation API for Unix)"
if test x"$have_sunfb" = x"yes"; then
if test x"$have_sundga" = x"yes"; then
echo " - PGX64 (for Sun XVR100/PGX64/PGX24 cards)"
diff --git a/src/demuxers/demux_ts.c b/src/demuxers/demux_ts.c
index 6f5053a37..79c802cc5 100644
--- a/src/demuxers/demux_ts.c
+++ b/src/demuxers/demux_ts.c
@@ -1,3 +1,4 @@
+
/*
* Copyright (C) 2000-2003 the xine project
*
@@ -233,6 +234,8 @@
STREAM_VIDEO_MPEG = 0x80,
STREAM_AUDIO_AC3 = 0x81,
STREAM_SPU_BITMAP_HDMV = 0x90,
+
+ STREAM_VIDEO_VC1 = 0xea, /* VC-1 Video */
} streamType;
#define WRAP_THRESHOLD 270000
@@ -272,7 +275,7 @@ typedef struct {
} demux_ts_media;
/* DVBSUB */
-#define MAX_SPU_LANGS 16
+#define MAX_SPU_LANGS 32
typedef struct {
spu_dvb_descriptor_t desc;
@@ -281,7 +284,7 @@ typedef struct {
} demux_ts_spu_lang;
/* Audio Channels */
-#define MAX_AUDIO_TRACKS 16
+#define MAX_AUDIO_TRACKS 32
typedef struct {
int pid;
@@ -652,13 +655,12 @@ static void demux_ts_parse_pat (demux_ts_t*this, unsigned char *original_pkt,
this->last_pmt_crc = 0;
this->videoPid = INVALID_PID;
this->spu_pid = INVALID_PID;
- }
- this->pmt_pid[program_count] = pmt_pid;
- if (this->pmt[program_count] != NULL) {
- free(this->pmt[program_count]);
- this->pmt[program_count] = NULL;
- this->pmt_write_ptr[program_count] = NULL;
+ if (this->pmt[program_count] != NULL) {
+ free(this->pmt[program_count]);
+ this->pmt[program_count] = NULL;
+ this->pmt_write_ptr[program_count] = NULL;
+ }
}
#ifdef TS_PAT_LOG
if (this->program_number[program_count] != INVALID_PROGRAM)
@@ -746,6 +748,13 @@ static int demux_ts_parse_pes_header (xine_t *xine, demux_ts_media *m,
p += header_len + 9;
packet_len -= header_len + 3;
+ if (m->descriptor_tag == STREAM_VIDEO_VC1) {
+ m->content = p;
+ m->size = packet_len;
+ m->type = BUF_VIDEO_VC1;
+ return 1;
+ }
+
if (m->descriptor_tag == STREAM_SPU_BITMAP_HDMV) {
long payload_len = ((buf[4] << 8) | buf[5]) - header_len - 3;
@@ -1316,6 +1325,7 @@ printf("Program Number is %i, looking for %i\n",program_number,this->program_num
case ISO_13818_VIDEO:
case ISO_14496_PART2_VIDEO:
case ISO_14496_PART10_VIDEO:
+ case STREAM_VIDEO_VC1:
if (this->videoPid == INVALID_PID) {
#ifdef TS_PMT_LOG
printf ("demux_ts: PMT video pid 0x%.4x type %2.2x\n", pid, stream[0]);
@@ -1446,6 +1456,14 @@ printf("Program Number is %i, looking for %i\n",program_number,this->program_num
if (this->hdmv > 0) {
if (pid >= 0x1200 && pid < 0x1300) {
/* HDMV Presentation Graphics / SPU */
+
+ if (this->spu_langs_count >= MAX_SPU_LANGS) {
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG,
+ "demux_ts: too many SPU tracks! ignoring pid 0x%.4x\n",
+ pid);
+ break;
+ }
+
demux_ts_spu_lang *lang = &this->spu_langs[this->spu_langs_count];
memset(lang->desc.lang, 0, sizeof(lang->desc.lang));
diff --git a/src/video_dec/libvdpau/vdpau_mpeg12.c b/src/video_dec/libvdpau/vdpau_mpeg12.c
index d12557ced..09399ac3b 100644
--- a/src/video_dec/libvdpau/vdpau_mpeg12.c
+++ b/src/video_dec/libvdpau/vdpau_mpeg12.c
@@ -794,7 +794,8 @@ static void vdpau_mpeg12_decode_data (video_decoder_t *this_gen, buf_element_t *
if ( !buf->size )
return;
- seq->cur_pts = buf->pts;
+ if ( buf->pts )
+ seq->cur_pts = buf->pts;
int size = seq->bufpos+buf->size;
if ( seq->bufsize < size ) {
diff --git a/src/video_out/video_out_vdpau.c b/src/video_out/video_out_vdpau.c
index d458b3a0f..4a8758bdb 100644
--- a/src/video_out/video_out_vdpau.c
+++ b/src/video_out/video_out_vdpau.c
@@ -352,6 +352,7 @@ typedef struct {
int enable_inverse_telecine;
int honor_progressive;
int skip_chroma;
+ int studio_levels;
int vdp_runtime_nr;
int reinit_needed;
@@ -1350,15 +1351,58 @@ static void vdpau_update_csc( vdpau_driver_t *this_gen )
float contrast = this_gen->contrast/100.0;
float brightness = this_gen->brightness/100.0;
- printf( "vo_vdpau: vdpau_update_csc: hue=%f, saturation=%f, contrast=%f, brightness=%f, color_standard=%d\n", hue, saturation, contrast, brightness, this_gen->color_standard );
+ printf( "vo_vdpau: vdpau_update_csc: hue=%f, saturation=%f, contrast=%f, brightness=%f, color_standard=%d studio_levels=%d\n", hue, saturation, contrast, brightness, this_gen->color_standard, this_gen->studio_levels );
+ VdpStatus st;
VdpCSCMatrix matrix;
VdpProcamp procamp = { VDP_PROCAMP_VERSION, brightness, contrast, saturation, hue };
- VdpStatus st = vdp_generate_csc_matrix( &procamp, this_gen->color_standard, &matrix );
- if ( st != VDP_STATUS_OK ) {
- printf( "vo_vdpau: error, can't generate csc matrix !!\n" );
- return;
+ if ( this_gen->studio_levels ) {
+ int i;
+ float Kr, Kg, Kb;
+ float uvcos = procamp.saturation * cos(procamp.hue);
+ float uvsin = procamp.saturation * sin(procamp.hue);
+ int rgbmin = 16;
+ int rgbr = 235 - 16;
+ switch ( this_gen->color_standard ) {
+ case VDP_COLOR_STANDARD_SMPTE_240M:
+ Kr = 0.2122;
+ Kg = 0.7013;
+ Kb = 0.0865;
+ break;
+ case VDP_COLOR_STANDARD_ITUR_BT_709:
+ Kr = 0.2125;
+ Kg = 0.7154;
+ Kb = 0.0721;
+ break;
+ case VDP_COLOR_STANDARD_ITUR_BT_601:
+ default:
+ Kr = 0.299;
+ Kg = 0.587;
+ Kb = 0.114;
+ break;
+ }
+ float uv_coeffs[3][2] = {{ 0.000, (rgbr / 112.0) * (1 - Kr) },
+ {-(rgbr / 112.0) * (1 - Kb) * Kb / Kg, -(rgbr / 112.0) * (1 - Kr) * Kr / Kg },
+ { (rgbr / 112.0) * (1 - Kb), 0.000 }};
+ for (i = 0; i < 3; ++i) {
+ matrix[i][3] = procamp.brightness;
+ matrix[i][0] = rgbr * procamp.contrast / 219;
+ matrix[i][3] += (-16 / 255.0) * matrix[i][0];
+ matrix[i][1] = uv_coeffs[i][0] * uvcos + uv_coeffs[i][1] * uvsin;
+ matrix[i][3] += (-128 / 255.0) * matrix[i][1];
+ matrix[i][2] = uv_coeffs[i][0] * uvsin + uv_coeffs[i][1] * uvcos;
+ matrix[i][3] += (-128 / 255.0) * matrix[i][2];
+ matrix[i][3] += rgbmin / 255.0;
+ matrix[i][3] += 0.5 - procamp.contrast / 2.0;
+ }
+ }
+ else {
+ st = vdp_generate_csc_matrix( &procamp, this_gen->color_standard, &matrix );
+ if ( st != VDP_STATUS_OK ) {
+ printf( "vo_vdpau: error, can't generate csc matrix !!\n" );
+ return;
+ }
}
VdpVideoMixerAttribute attributes [] = { VDP_VIDEO_MIXER_ATTRIBUTE_CSC_MATRIX };
void* attribute_values[] = { &matrix };
@@ -1394,6 +1438,15 @@ static void vdpau_set_skip_chroma( void *this_gen, xine_cfg_entry_t *entry )
+static void vdpau_set_studio_levels( void *this_gen, xine_cfg_entry_t *entry )
+{
+ vdpau_driver_t *this = (vdpau_driver_t *) this_gen;
+ this->studio_levels = entry->num_value;
+ vdpau_update_csc( this );
+}
+
+
+
static void vdpau_shift_queue( vo_driver_t *this_gen )
{
vdpau_driver_t *this = (vdpau_driver_t *) this_gen;
@@ -2536,6 +2589,11 @@ static vo_driver_t *vdpau_open_plugin (video_driver_class_t *class_gen, const vo
10, vdpau_set_skip_chroma, this );
}
+ this->studio_levels = config->register_bool( config, "video.output.vdpau_studio_levels", 0,
+ _("vdpau: disable studio level"),
+ _("Setting to true enables studio levels (16-219) instead of PC levels (0-255) in RGB colors.\n\n"),
+ 10, vdpau_set_studio_levels, this );
+
/* number of video frames from config - register it with the default value. */
int frame_num = config->register_num (config, "engine.buffers.video_num_frames", 15, /* default */
_("default number of video frames"),
@@ -2598,26 +2656,6 @@ static vo_driver_t *vdpau_open_plugin (video_driver_class_t *class_gen, const vo
* class functions
*/
-static char* vdpau_get_identifier (video_driver_class_t *this_gen)
-{
-}
-
-
-
-static char* vdpau_get_description (video_driver_class_t *this_gen)
-{
-}
-
-
-
-static void vdpau_dispose_class (video_driver_class_t *this_gen)
-{
- vdpau_class_t *this = (vdpau_class_t *) this_gen;
- free (this);
-}
-
-
-
static void *vdpau_init_class (xine_t *xine, void *visual_gen)
{
vdpau_class_t *this = (vdpau_class_t *) calloc(1, sizeof(vdpau_class_t));
@@ -2647,4 +2685,4 @@ const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
{ PLUGIN_VIDEO_OUT, 22, "vdpau", XINE_VERSION_CODE, &vo_info_vdpau, vdpau_init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
-}; \ No newline at end of file
+};