Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a mpv output module to playing video fullscreen #259

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,27 @@ fi
AC_SUBST(HAVE_GST)
AM_CONDITIONAL(HAVE_GST, test x$HAVE_GST = xyes)

AC_ARG_WITH( mpv,
AC_HELP_STRING([--without-mpv],[compile without MPV support]),
try_mpv=$withval, try_mpv=yes )
HAVE_MPV=no
if test x$try_mpv = xyes; then
dnl check for MPV
PKG_CHECK_MODULES(MPV, mpv >= 1.0.0,
[
HAVE_MPV=yes
AC_SUBST(MPV_CFLAGS)
AC_SUBST(MPV_LIBS)
],
[
HAVE_MPV=no
])
fi
if test x$HAVE_MPV = xyes; then
AC_DEFINE(HAVE_MPV, , [Use MPV])
fi
AC_SUBST(HAVE_MPV)
AM_CONDITIONAL(HAVE_MPV, test x$HAVE_MPV = xyes)

LIBUPNP_REQUIRED=1.6.0
AC_ARG_WITH( libupnp,
Expand Down
9 changes: 7 additions & 2 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ gmediarender_SOURCES += \
output_gstreamer.c output_gstreamer.h
endif

if HAVE_MPV
gmediarender_SOURCES += \
output_mpv.c output_mpv.h
endif

main.c : git-version.h

git-version.h: .FORCE
Expand All @@ -27,5 +32,5 @@ git-version.h: .FORCE

.FORCE:

AM_CPPFLAGS = $(GLIB_CFLAGS) $(GST_CFLAGS) $(LIBUPNP_CFLAGS) -DPKG_DATADIR=\"$(datadir)/gmediarender\"
gmediarender_LDADD = $(GLIB_LIBS) $(GST_LIBS) $(LIBUPNP_LIBS)
AM_CPPFLAGS = $(GLIB_CFLAGS) $(GST_CFLAGS) $(MPV_CFLAGS) $(LIBUPNP_CFLAGS) -DPKG_DATADIR=\"$(datadir)/gmediarender\"
gmediarender_LDADD = $(GLIB_LIBS) $(GST_LIBS) $(MPV_LIBS) $(LIBUPNP_LIBS)
2 changes: 2 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <assert.h>
#include <glib.h>
#include <limits.h>
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down Expand Up @@ -170,6 +171,7 @@ static gboolean process_cmdline(int argc, char **argv)
return FALSE;
}

setlocale(LC_ALL, "");
if (!g_option_context_parse (ctx, &argc, &argv, &err)) {
fprintf(stderr, "Failed to initialize: %s\n", err->message);
g_error_free (err);
Expand Down
16 changes: 12 additions & 4 deletions src/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,23 @@
#ifdef HAVE_GST
#include "output_gstreamer.h"
#endif
#ifdef HAVE_MPV
#include "output_mpv.h"
#endif
#include "output.h"

#if !defined(HAVE_GST) && !defined(HAVE_MPV)
// this will be a runtime error, but there is not much point
// in waiting till then.
#error "No output configured. You need to ./configure --with-gstreamer"
#endif

static struct output_module *modules[] = {
#ifdef HAVE_GST
&gstreamer_output,
#else
// this will be a runtime error, but there is not much point
// in waiting till then.
#error "No output configured. You need to ./configure --with-gstreamer"
#endif
#ifdef HAVE_MPV
&mpv_output,
#endif
};

Expand Down
Loading