Permalink
Browse files

Merge branch 'master' of https://github.com/huceke/xine-lib-vaapi int…

…o vaapi-testing

Conflicts:
	include/xine/video_out.h
  • Loading branch information...
2 parents 302ea6f + 2ba4228 commit 7f02d7d2c915a5b594d6f25a66ad895d9f7c555a @huceke committed Aug 4, 2012
View
@@ -448,6 +448,13 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[asm(".align 3");]])],
[AC_DEFINE([ASMALIGN_1SLN], [1],
[define if '.align n' means alignment to (1 << n) - byte boundaries])])
+dnl avx instruction set support
+AC_MSG_CHECKING([for AVX assembler])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[asm("vmovaps %ymm1, %ymm0");]])],
+ [AC_DEFINE([HAVE_AVX], [1],
+ [define if compiler supports avx inline assembler])
+ AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)])
+
CC_ATTRIBUTE_ALIGNED
CC_ATTRIBUTE_VISIBILITY([protected],
@@ -293,6 +293,11 @@ struct xine_video_port_s {
#define VO_CHROMA_422 32 /* used by VDPAU, default is chroma_420 */
#define VO_STILL_IMAGE 64
+/* ((mpeg_color_matrix << 1) | color_range) inside frame.flags bits 11-8 */
+#define VO_FULLRANGE 0x100
+#define VO_GET_FLAGS_CM(flags) ((flags >> 8) & 15)
+#define VO_SET_FLAGS_CM(cm,flags) flags = ((flags) & ~0xf00) | (((cm) & 15) << 8)
+
/* video driver capabilities */
#define VO_CAP_YV12 0x00000001 /* driver can handle YUV 4:2:0 pictures */
#define VO_CAP_YUY2 0x00000002 /* driver can handle YUY2 pictures */
@@ -306,6 +311,8 @@ struct xine_video_port_s {
#define VO_CAP_VDPAU_VC1 0x00000200 /* driver can use VDPAU for VC1 */
#define VO_CAP_VDPAU_MPEG4 0x00000400 /* driver can use VDPAU for mpeg4-part2 */
#define VO_CAP_VAAPI 0x00000600 /* driver can use VAAPI */
+#define VO_CAP_COLOR_MATRIX 0x00004000 /* driver can use alternative yuv->rgb matrices */
+#define VO_CAP_FULLRANGE 0x00008000 /* driver handles fullrange yuv */
#define VO_CAP_HUE 0x00010000
#define VO_CAP_SATURATION 0x00020000
#define VO_CAP_CONTRAST 0x00040000
View
@@ -92,13 +92,15 @@ AC_DEFUN([XINE_DECODER_PLUGINS], [
dnl Check presence of ffmpeg/avutil.h to see if it's old or new
dnl style for headers. The new style would be preferred actually...
+ ac_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $FFMPEG_CFLAGS"
AC_CHECK_HEADERS([ffmpeg/avutil.h])
AC_CHECK_HEADERS([libavutil/avutil.h])
AC_CHECK_HEADERS([libavutil/sha1.h])
AC_CHECK_HEADERS([libavutil/sha.h])
if test "$ac_cv_header_ffmpeg_avutil_h" = "yes" && test "$ac_cv_header_libavutil_avutil_h" = "yes"; then
AC_MSG_ERROR([old & new ffmpeg headers found - you need to clean up!])
fi
+ CFLAGS="$ac_save_CFLAGS"
dnl gdk-pixbuf (optional; enabled by default)
AC_ARG_ENABLE([gdkpixbuf],
View
@@ -208,6 +208,9 @@ AC_DEFUN([XINE_LIB_SUMMARY], [
echo " - OpenGL"
fi
fi
+ if test x"$have_opengl2" = x"yes"; then
+ echo " - OpenGL 2.0 (with bicubic scaling)"
+ fi
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
View
@@ -202,6 +202,33 @@ AC_DEFUN([XINE_VIDEO_OUT_PLUGINS], [
AC_CHECK_LIB([GL], [glBegin],
[AC_CHECK_HEADERS([GL/gl.h], [have_opengl=yes], [have_opengl=no])], [have_opengl=no],
[$X_LIBS -lm])
+ have_opengl2=$have_opengl
+ if test x"$have_opengl2" = x"yes" ; then
+ AC_MSG_CHECKING([for OpenGL 2.0])
+ ac_save_LIBS="$LIBS"
+ LIBS="$LIBS $X_LIBS -lGL -lm"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+ #define GL_GLEXT_PROTOTYPES
+ #include <GL/gl.h>
+ #include <GL/glext.h>
+ #include <GL/glx.h>
+ ]],[[
+ GLint i = 0;
+ /* GLX ARB 2.0 */
+ glXGetProcAddressARB ("proc");
+ /* GL_VERSION_1_5 */
+ glDeleteBuffers (1024, &i);
+ /* GL_VERSION_2_0 */
+ glCreateProgram ();
+ glCompileShader (1);
+ /* GL_ARB_framebuffer_object */
+ glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_RECTANGLE_ARB, 2, 0);
+ /* GL_ARB_shader_objects */
+ glGetUniformLocationARB (3, "tex");]])],
+ [have_opengl2=yes], [have_opengl2=no])
+ LIBS="$ac_save_LIBS"
+ AC_MSG_RESULT($have_opengl2)
+ fi
if test x"$hard_enable_opengl" = x"yes" && test x"$have_opengl" != x"yes"; then
AC_MSG_ERROR([OpenGL support requested, but OpenGL not found])
elif test x"$have_opengl" = x"yes"; then
@@ -234,7 +261,7 @@ AC_DEFUN([XINE_VIDEO_OUT_PLUGINS], [
AC_SUBST(GLU_LIBS)
fi
AM_CONDITIONAL([ENABLE_OPENGL], [test x"$have_opengl" = x"yes"])
-
+ AM_CONDITIONAL([ENABLE_OPENGL2], [test x"$have_opengl2" = x"yes"])
dnl SDL
XINE_ARG_WITH([sdl], [Enable support for SDL video output])
View
@@ -14,14 +14,14 @@ if [ `expr $RPMVERSION` -lt 100 ]; then
fi
if [ `expr $RPMVERSION` -lt 400 ]; then
- RPM_BA="rpm -ba -ta ./@PACKAGE@-@VERSION@.tar.gz"
- RPM_BB="rpm -bb -ta ./@PACKAGE@-@VERSION@.tar.gz"
+ RPM_BA="rpm -ba -ta ./@PACKAGE@-@VERSION@.tar.bz2"
+ RPM_BB="rpm -bb -ta ./@PACKAGE@-@VERSION@.tar.bz2"
elif [ `expr $RPMVERSION` -lt 420 ]; then
- RPM_BA="rpm -ta ./@PACKAGE@-@VERSION@.tar.gz -ba"
- RPM_BB="rpm -ta ./@PACKAGE@-@VERSION@.tar.gz -bb"
+ RPM_BA="rpm -ta ./@PACKAGE@-@VERSION@.tar.bz2 -ba"
+ RPM_BB="rpm -ta ./@PACKAGE@-@VERSION@.tar.bz2 -bb"
else
- RPM_BA="rpmbuild -ta ./@PACKAGE@-@VERSION@.tar.gz -ba"
- RPM_BB="rpmbuild -ta ./@PACKAGE@-@VERSION@.tar.gz -bb"
+ RPM_BA="rpmbuild -ta ./@PACKAGE@-@VERSION@.tar.bz2 -ba"
+ RPM_BB="rpmbuild -ta ./@PACKAGE@-@VERSION@.tar.bz2 -bb"
fi
##VERSION="@XINE_MAJOR@.@XINE_MINOR@.@XINE_SUB@"
View
@@ -1,6 +1,6 @@
%define shortname libxine
-%define name libxine2
-%define version @SPEC_VERSION@
+%define name libxine1
+%define version @PACKAGE_VERSION@
%define release 0
%define major 1
@@ -15,6 +15,9 @@
%if %{?BUILD_ALSA:0}%{!?BUILD_ALSA:1}
%define BUILD_ALSA 0
%endif
+%if %{?BUILD_ARTS:0}%{!?BUILD_ARTS:1}
+%define BUILD_ARTS 0
+%endif
%if %{?BUILD_DEVEL:0}%{!?BUILD_DEVEL:1}
%define BUILD_DEVEL 1
%endif
@@ -659,7 +662,7 @@ libxine Soundausgabeplugin für den pulseaudio-Soundserver
%prep
-%setup -q -n @TAR_NAME@
+%setup -q -n @PACKAGE_TARNAME@-@PACKAGE_VERSION@
%build
export CFLAGS="${RPM_OPT_FLAGS}"
@@ -686,7 +689,7 @@ fi
%if %BUILD_STK
--with-libstk \
%endif
- --enable-syncfb --without-internal-vcdlibs
+ --without-internal-vcdlibs
# Error in libfaad when compiling with mmx or sse enabled, remove it
%{__mv} contrib/libfaad/Makefile contrib/libfaad/Makefile_save
@@ -704,7 +707,7 @@ echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_%{name}_zw
%if %BUILD_DEVEL
echo "%doc README TODO AUTHORS COPYING ChangeLog" >> ${RPM_BUILD_DIR}/filelist_%{name}_zw
%else
-echo "%doc README TODO AUTHORS COPYING ChangeLog doc/hackersguide/*.sgml doc/hackersguide/*.fig doc/hackersguide/README" >> ${RPM_BUILD_DIR}/filelist_%{name}_zw
+echo "%doc README TODO AUTHORS COPYING ChangeLog doc/hackersguide/*.html doc/hackersguide/*.png doc/hackersguide/README" >> ${RPM_BUILD_DIR}/filelist_%{name}_zw
%endif
find . -type f | %{__sed} 's,^\.%{_datadir}/doc,\%doc %{_datadir}/doc,' | %{__sed} 's,^\.,,' >> ${RPM_BUILD_DIR}/filelist_%{name}_zw
find . -type l | %{__sed} 's,^\.%{_datadir}/doc,\%doc %{_datadir}/doc,' | %{__sed} 's,^\.,,' >> ${RPM_BUILD_DIR}/filelist_%{name}_zw
@@ -715,7 +718,7 @@ find . -type d | %{__grep} xine | %{__sed} 's,^\.,\%dir ,' >> ${RPM_BUILD_DIR}/f
%if %BUILD_DEVEL
echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_%{name}_devel
-echo "%doc doc/hackersguide/*.sgml doc/hackersguide/*.fig doc/hackersguide/README" >> ${RPM_BUILD_DIR}/filelist_%{name}_devel
+echo "%doc doc/hackersguide/*.html doc/hackersguide/*.png doc/hackersguide/README" >> ${RPM_BUILD_DIR}/filelist_%{name}_devel
%{__mv} ${RPM_BUILD_DIR}/filelist_%{name} ${RPM_BUILD_DIR}/filelist_%{name}_old
%{__grep} -E "/include/|dhahelper\.o|libxine*\.(so|la)$|\.m4$" ${RPM_BUILD_DIR}/filelist_%{name}_old | %{__cat} - >> ${RPM_BUILD_DIR}/filelist_%{name}_devel
%{__grep} -v -E "/include/|dhahelper\.o|libxine*\.(so|la)$|\.m4$" ${RPM_BUILD_DIR}/filelist_%{name}_old | %{__cat} - > ${RPM_BUILD_DIR}/filelist_%{name}
@@ -150,8 +150,11 @@ struct ff_video_decoder_s {
uint8_t set_stream_info;
};
+/* import color matrix names */
+#include "../../video_out/color_matrix.c"
+
static void ff_check_colorspace (ff_video_decoder_t *this) {
- int i, cm;
+ int i, cm, caps;
#ifdef AVCODEC_HAS_COLORSPACE
cm = this->context->colorspace << 1;
@@ -172,17 +175,27 @@ static void ff_check_colorspace (ff_video_decoder_t *this) {
if (cm != this->color_matrix) {
this->color_matrix = cm;
xprintf (this->stream->xine, XINE_VERBOSITY_LOG,
- "ffmpeg_video_dec: color matrix #%d\n", cm >> 1);
+ "ffmpeg_video_dec: color matrix #%d [%s]\n", cm >> 1, cm_names[cm & 15]);
+
+ caps = this->stream->video_out->get_capabilities (this->stream->video_out);
+
+ if (!(caps & VO_CAP_COLOR_MATRIX)) {
+ xprintf (this->stream->xine, XINE_VERBOSITY_LOG,
+ "ffmpeg_video_dec: video out plugin does not support color matrix switching\n");
+ cm &= 1;
+ }
this->full2mpeg = 0;
- if (cm & 1) {
+ if ((cm & 1) && !(caps & VO_CAP_FULLRANGE)) {
/* sigh. fall back to manual conversion */
+ cm &= ~1;
this->full2mpeg = 1;
for (i = 0; i < 256; i++) {
this->ytab[i] = (219 * i + 127) / 255 + 16;
this->ctab[i] = 112 * (i - 128) / 127 + 128;
}
}
+ VO_SET_FLAGS_CM (cm, this->frame_flags);
}
}
@@ -48,7 +48,7 @@
#define LOG_MODULE "input_bluray"
#define LOG_VERBOSE
-#define LOG
+/*#define LOG*/
#define LOGMSG(x...) xine_log (this->stream->xine, XINE_LOG_MSG, "input_bluray: " x);
@@ -1142,6 +1142,8 @@ static void parse_pmt(dvb_input_plugin_t *this, const unsigned char *buf, int se
switch (buf[0]) {
case 0x01:
case 0x02:
+ case 0x10:
+ case 0x1b:
if(!has_video) {
xprintf(this->stream->xine,XINE_VERBOSITY_LOG,"input_dvb: Adding VIDEO : PID 0x%04x\n", elementary_pid);
dvb_set_pidfilter(this, VIDFILTER, elementary_pid, DMX_PES_VIDEO, DMX_OUT_TS_TAP);
@@ -1151,6 +1153,8 @@ static void parse_pmt(dvb_input_plugin_t *this, const unsigned char *buf, int se
case 0x03:
case 0x04:
+ case 0x0f:
+ case 0x11:
if(!has_audio) {
xprintf(this->stream->xine,XINE_VERBOSITY_LOG,"input_dvb: Adding AUDIO : PID 0x%04x\n", elementary_pid);
dvb_set_pidfilter(this, AUDFILTER, elementary_pid, DMX_PES_AUDIO, DMX_OUT_TS_TAP);
@@ -62,7 +62,7 @@ typedef struct {
int width, height, type;
} test_input_plugin_t;
-static const char * const test_names[TEST_MAX_NAMES + 1] = {
+static const char * const test_names[TEST_MAX_NAMES + 1 + 1] = {
"test://",
"test://color_circle.bmp",
"test://rgb_levels.bmp",
@@ -73,7 +73,21 @@ static const char * const test_names[TEST_MAX_NAMES + 1] = {
"test://rgb_levels.y4m",
"test://saturation_levels.y4m",
"test://uv_square.y4m",
- "test://y_resolution.y4m"
+ "test://y_resolution.y4m",
+ NULL
+};
+
+const char * const test_titles[TEST_MAX_NAMES/2] = {
+ N_("Color Circle"),
+ N_("RGB Levels"),
+ N_("Saturation Levels"),
+ N_("UV Square"),
+ N_("Luminance Resolution"),
+};
+
+static const char * const test_cm[] = {
+ " ITU-R 470 BG / SDTV",
+ " ITU-R 709 / HDTV",
};
/* TJ. the generator code - actually a cut down version of my "testvideo" project */
@@ -419,6 +433,16 @@ static int test_make (test_input_plugin_t * this) {
}
}
+ /* human-friendly title */
+ if (type > 0 && type <= TEST_MAX_NAMES / 2) {
+ char *title = _x_asprintf("%s (%s)%s",
+ _(test_titles[type-1]),
+ yuv ? "YUV" : "RGB",
+ yuv ? test_cm[!!hdtv] : "");
+ _x_meta_info_set(this->stream, XINE_META_INFO_TITLE, title);
+ free(title);
+ }
+
return (1);
}
@@ -579,7 +603,7 @@ static input_plugin_t *test_class_get_instance (input_class_t *cls_gen,
static const char * const *test_class_get_autoplay_list (input_class_t *this_gen, int *num_files)
{
- *num_files = sizeof(test_names) / sizeof(test_names[0]) - 1;
+ *num_files = sizeof(test_names) / sizeof(test_names[0]) - 2;
return test_names + 1;
}
View
@@ -111,7 +111,7 @@ static void yuv_decode_data (video_decoder_t *this_gen,
free (this->buf);
this->buf = NULL;
- this->bufsize = this->width = this->height;
+ this->bufsize = 0;
this->size = 0;
this->decoder_ok = 1;
@@ -12,7 +12,7 @@ if ENABLE_MACOSX_VIDEO
SUBDIRS += macosx
endif
-EXTRA_DIST = video_out_directx.c video_out_macosx.m
+EXTRA_DIST = video_out_directx.c video_out_macosx.m color_matrix.c
noinst_HEADERS = yuv2rgb.h x11osd.h xcbosd.h xv_common.h
@@ -30,6 +30,9 @@ xxmc_module = xineplug_vo_out_xxmc.la
endif
if ENABLE_OPENGL
opengl_module = xineplug_vo_out_opengl.la
+if ENABLE_OPENGL2
+opengl2_module = xineplug_vo_out_opengl2.la
+endif
endif
if ENABLE_SUNFB
if ENABLE_SUNDGA
@@ -106,6 +109,7 @@ YUV_LIBS = libyuv2rgb.la $(XINE_LIB) $(MLIB_LIBS) $(AVUTIL_LIBS)
xineplug_LTLIBRARIES = $(xshm_module) $(xv_module) $(xvmc_module) \
$(opengl_module) \
+ $(opengl2_module) \
$(pgx64_module) $(pgx32_module)\
$(vidix_module) \
$(aa_module) \
@@ -161,6 +165,10 @@ xineplug_vo_out_opengl_la_LIBADD = $(YUV_LIBS) $(OPENGL_LIBS) $(GLUT_LIBS) \
$(GLUT_LIBS) $(GLU_LIBS) $(X_LIBS) $(PTHREAD_LIBS) $(DYNAMIC_LD_LIBS) $(LTLIBINTL)
xineplug_vo_out_opengl_la_CFLAGS = $(AM_CFLAGS) $(X_CFLAGS) $(AVUTIL_CFLAGS) -fno-strict-aliasing
+xineplug_vo_out_opengl2_la_SOURCES = video_out_opengl2.c
+xineplug_vo_out_opengl2_la_LIBADD = $(YUV_LIBS) $(OPENGL_LIBS) $(X_LIBS) $(PTHREAD_LIBS) $(DYNAMIC_LD_LIBS) $(LTLIBINTL)
+xineplug_vo_out_opengl2_la_CFLAGS = $(AM_CFLAGS) $(X_CFLAGS) $(AVUTIL_CFLAGS) -fno-strict-aliasing
+
xineplug_vo_out_pgx64_la_SOURCES = video_out_pgx64.c
xineplug_vo_out_pgx64_la_LIBADD = $(XINE_LIB) $(X_LIBS) $(SUNDGA_LIBS) $(PTHREAD_LIBS) $(LTLIBINTL)
xineplug_vo_out_pgx64_la_CFLAGS = $(AM_CFLAGS) $(X_CFLAGS)
Oops, something went wrong.

0 comments on commit 7f02d7d

Please sign in to comment.