Web lists-archives.com

Re: [MPlayer-dev-eng] [MPlayer-users] Build regression on FreeBSD




On 2016-01-31 10:35 +0100, Ingo Brückl wrote:
> Alexander Strasser wrote on Sun, 31 Jan 2016 00:51:12 +0100:
> 
> >>Maybe it would be better to omit the #if and ensure it's only inlcude in
> >>case of VDPAU (which should be the case with my suggestion on vd_ffmpeg.c).
> 
> >   Right.  Don't know which is better...
> 
> If possible, I'd prefer to not have any '#if CONFIG_xxx' in a header file.

  Updated patch attached.

  Also added a reference to ticket #2265

If no one objects I will apply this soon'ish,
  Alexander
From 9f8e2d0b6ca91502d05f207944fdd0f556b80705 Mon Sep 17 00:00:00 2001
Message-Id: <9f8e2d0b6ca91502d05f207944fdd0f556b80705.1454848742.git.eclipse7@xxxxxxx>
From: Alexander Strasser <eclipse7@xxxxxxx>
Date: Fri, 29 Jan 2016 02:24:24 +0100
Subject: [PATCH] vdpau: Move struct vdpau_frame_data into a separate header

After recent changes the vdpau_frame_data struct uses structures
from libvdpau directly. This is unfortunate if it is declared in
img_format.h header file because that is also included from
codec-cfg.c which is compiled with the host compiler.

Avoid vdpau dep in img_format.h by moving the vdpau_frame_data
struct into a header of its own.

Fix ticket #2265

Signed-off-by: Alexander Strasser <eclipse7@xxxxxxx>
---
 libmpcodecs/img_format.h       | 12 ------------
 libmpcodecs/vd_ffmpeg.c        |  1 +
 libmpcodecs/vdpau_frame_data.h | 31 +++++++++++++++++++++++++++++++
 libvo/vo_vdpau.c               |  1 +
 4 files changed, 33 insertions(+), 12 deletions(-)
 create mode 100644 libmpcodecs/vdpau_frame_data.h

diff --git a/libmpcodecs/img_format.h b/libmpcodecs/img_format.h
index 1aa47bc..3479fd4 100644
--- a/libmpcodecs/img_format.h
+++ b/libmpcodecs/img_format.h
@@ -20,9 +20,6 @@
 #define MPLAYER_IMG_FORMAT_H
 
 #include "config.h"
-#if CONFIG_VDPAU
-#include <vdpau/vdpau.h>
-#endif
 
 /* RGB/BGR Formats */
 
@@ -304,15 +301,6 @@ typedef struct {
     int timestamp; // pts, 90000 Hz counter based
 } vo_mpegpes_t;
 
-#if CONFIG_VDPAU
-struct vdpau_frame_data {
-    VdpVideoSurface surface;
-    const void *info;
-    unsigned bitstream_buffers_used;
-    const void *bitstream_buffers;
-};
-#endif
-
 const char *vo_format_name(int format);
 
 /**
diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c
index 6a5885d..75f8d1a 100644
--- a/libmpcodecs/vd_ffmpeg.c
+++ b/libmpcodecs/vd_ffmpeg.c
@@ -39,6 +39,7 @@
 
 #if CONFIG_VDPAU
 #include "libavcodec/vdpau.h"
+#include "vdpau_frame_data.h"
 #endif
 #include "libavutil/pixdesc.h"
 
diff --git a/libmpcodecs/vdpau_frame_data.h b/libmpcodecs/vdpau_frame_data.h
new file mode 100644
index 0000000..9ff120e
--- /dev/null
+++ b/libmpcodecs/vdpau_frame_data.h
@@ -0,0 +1,31 @@
+/*
+ * This file is part of MPlayer.
+ *
+ * MPlayer is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * MPlayer is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with MPlayer; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef MPLAYER_VDPAU_FRAME_DATA_H
+#define MPLAYER_VDPAU_FRAME_DATA_H
+
+#include <vdpau/vdpau.h>
+
+struct vdpau_frame_data {
+    VdpVideoSurface surface;
+    const void *info;
+    unsigned bitstream_buffers_used;
+    const void *bitstream_buffers;
+};
+
+#endif /* MPLAYER_VDPAU_FRAME_DATA_H */
diff --git a/libvo/vo_vdpau.c b/libvo/vo_vdpau.c
index c6fb6f0..7b94cad 100644
--- a/libvo/vo_vdpau.c
+++ b/libvo/vo_vdpau.c
@@ -41,6 +41,7 @@
 #include "video_out.h"
 #define NO_DRAW_FRAME
 #include "video_out_internal.h"
+#include "libmpcodecs/vdpau_frame_data.h"
 #include "libmpcodecs/vf.h"
 #include "x11_common.h"
 #include "aspect.h"
-- 

Attachment: signature.asc
Description: PGP signature

_______________________________________________
MPlayer-dev-eng mailing list
MPlayer-dev-eng@xxxxxxxxxxxx
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng