Re: [MPlayer-users] Build regression on FreeBSD

Alexander Strasser <[email protected]>
Newsgroups gmane.comp.video.mplayer.devel
Message-ID <[email protected]>
On 2016-01-15 23:52 +0100, Roberto Togni wrote:
> On Sun, 10 Jan 2016 02:49:18 +0100
> Alexander Strasser <[email protected]> wrote:
> > On 2015-12-21 22:20 +0100, Alexander Strasser wrote:
> > > On 2015-12-21 21:43 +0100, Roberto Togni wrote:
[...]
> > > > If you can confirm that the problem is only with codec-cfg.c I'll just
> > > > move the struct and the include; best candidates are vo_out.h, vd.h or a
> > > > dedicated header.
> > > 
> > >   I would favour this solutions too.
> > 
> >   If I didn't miss something, this was also reported by a non-BSD user on
> > our bug tracker:
> > 
> >   https://trac.mplayerhq.hu/ticket/2265
> > 
> >   Tell me if I should give it a try. I just don't want to end up doing
> > duplicate work.
> > 
> I haven't touched it yet, feel free to do it.

  What do you and others think about attached patch?

  Alexander

_______________________________________________
MPlayer-dev-eng mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
0001-vdpau-Move-struct-vdpau_frame_data-into-a-separate-h.patch (text/x-diff, 3.5 KB)
From f9581dabc772eb0402d23c7fb6beae05a2c75456 Mon Sep 17 00:00:00 2001
Message-Id: <f9581dabc772eb0402d23c7fb6beae05a2c75456.1454097318.git.eclipse7@gmx.net>
From: Alexander Strasser <[email protected]>
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.

Signed-off-by: Alexander Strasser <[email protected]>
---
 libmpcodecs/img_format.h       | 12 ------------
 libmpcodecs/vd_ffmpeg.c        |  1 +
 libmpcodecs/vdpau_frame_data.h | 35 +++++++++++++++++++++++++++++++++++
 libvo/vo_vdpau.c               |  1 +
 4 files changed, 37 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..59752fe 100644
--- a/libmpcodecs/vd_ffmpeg.c
+++ b/libmpcodecs/vd_ffmpeg.c
@@ -36,6 +36,7 @@
 #include "fmt-conversion.h"
 
 #include "vd_internal.h"
+#include "vdpau_frame_data.h"
 
 #if CONFIG_VDPAU
 #include "libavcodec/vdpau.h"
diff --git a/libmpcodecs/vdpau_frame_data.h b/libmpcodecs/vdpau_frame_data.h
new file mode 100644
index 0000000..cb188ad
--- /dev/null
+++ b/libmpcodecs/vdpau_frame_data.h
@@ -0,0 +1,35 @@
+/*
+ * 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
+
+#if CONFIG_VDPAU
+
+#include <vdpau/vdpau.h>
+
+struct vdpau_frame_data {
+    VdpVideoSurface surface;
+    const void *info;
+    unsigned bitstream_buffers_used;
+    const void *bitstream_buffers;
+};
+
+#endif
+
+#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"
--
signature.asc (application/pgp-signature, 181 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAlar1EcACgkQp9ile6h25Y8TMwCfewxQBqq1VckIxGkUrBQbdxPL
odUAoLMPZXbqllXqhetzleXbTMyZMwZZ
=9awn
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.