mirror of
https://github.com/mpv-player/mpv
synced 2025-01-03 05:22:23 +00:00
configure: uniform the defines to #define HAVE_xxx (0|1)
The configure followed 5 different convetions of defines because the next guy always wanted to introduce a new better way to uniform it[1]. For an hypothetic feature 'hurr' you could have had: * #define HAVE_HURR 1 / #undef HAVE_DURR * #define HAVE_HURR / #undef HAVE_DURR * #define CONFIG_HURR 1 / #undef CONFIG_DURR * #define HAVE_HURR 1 / #define HAVE_DURR 0 * #define CONFIG_HURR 1 / #define CONFIG_DURR 0 All is now uniform and uses: * #define HAVE_HURR 1 * #define HAVE_DURR 0 We like definining to 0 as opposed to `undef` bcause it can help spot typos and is very helpful when doing big reorganizations in the code. [1]: http://xkcd.com/927/ related
This commit is contained in:
parent
891a2a1f47
commit
37388ebb0e
@ -46,7 +46,7 @@ extern const struct ad_functions ad_lavc;
|
|||||||
extern const struct ad_functions ad_spdif;
|
extern const struct ad_functions ad_spdif;
|
||||||
|
|
||||||
static const struct ad_functions * const ad_drivers[] = {
|
static const struct ad_functions * const ad_drivers[] = {
|
||||||
#ifdef CONFIG_MPG123
|
#if HAVE_MPG123
|
||||||
&ad_mpg123,
|
&ad_mpg123,
|
||||||
#endif
|
#endif
|
||||||
&ad_lavc,
|
&ad_lavc,
|
||||||
|
@ -65,7 +65,7 @@ static struct af_info* filter_list[] = {
|
|||||||
&af_info_pan,
|
&af_info_pan,
|
||||||
&af_info_surround,
|
&af_info_surround,
|
||||||
&af_info_sub,
|
&af_info_sub,
|
||||||
#ifdef HAVE_SYS_MMAN_H
|
#if HAVE_SYS_MMAN_H
|
||||||
&af_info_export,
|
&af_info_export,
|
||||||
#endif
|
#endif
|
||||||
&af_info_drc,
|
&af_info_drc,
|
||||||
@ -74,17 +74,17 @@ static struct af_info* filter_list[] = {
|
|||||||
&af_info_lavrresample,
|
&af_info_lavrresample,
|
||||||
&af_info_sweep,
|
&af_info_sweep,
|
||||||
&af_info_hrtf,
|
&af_info_hrtf,
|
||||||
#ifdef CONFIG_LADSPA
|
#if HAVE_LADSPA
|
||||||
&af_info_ladspa,
|
&af_info_ladspa,
|
||||||
#endif
|
#endif
|
||||||
&af_info_center,
|
&af_info_center,
|
||||||
&af_info_sinesuppress,
|
&af_info_sinesuppress,
|
||||||
&af_info_karaoke,
|
&af_info_karaoke,
|
||||||
&af_info_scaletempo,
|
&af_info_scaletempo,
|
||||||
#ifdef CONFIG_LIBBS2B
|
#if HAVE_LIBBS2B
|
||||||
&af_info_bs2b,
|
&af_info_bs2b,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_AF_LAVFI
|
#if HAVE_AF_LAVFI
|
||||||
&af_info_lavfi,
|
&af_info_lavfi,
|
||||||
#endif
|
#endif
|
||||||
// Must come last, because they're fallback format conversion filter
|
// Must come last, because they're fallback format conversion filter
|
||||||
|
@ -33,10 +33,10 @@
|
|||||||
#include "talloc.h"
|
#include "talloc.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#if defined(CONFIG_LIBAVRESAMPLE)
|
#if HAVE_LIBAVRESAMPLE
|
||||||
#include <libavresample/avresample.h>
|
#include <libavresample/avresample.h>
|
||||||
#define USE_SET_CHANNEL_MAPPING HAVE_AVRESAMPLE_SET_CHANNEL_MAPPING
|
#define USE_SET_CHANNEL_MAPPING HAVE_AVRESAMPLE_SET_CHANNEL_MAPPING
|
||||||
#elif defined(CONFIG_LIBSWRESAMPLE)
|
#elif HAVE_LIBSWRESAMPLE
|
||||||
#include <libswresample/swresample.h>
|
#include <libswresample/swresample.h>
|
||||||
#define AVAudioResampleContext SwrContext
|
#define AVAudioResampleContext SwrContext
|
||||||
#define avresample_alloc_context swr_alloc
|
#define avresample_alloc_context swr_alloc
|
||||||
@ -49,7 +49,7 @@
|
|||||||
#define avresample_set_channel_mapping swr_set_channel_mapping
|
#define avresample_set_channel_mapping swr_set_channel_mapping
|
||||||
#define USE_SET_CHANNEL_MAPPING 1
|
#define USE_SET_CHANNEL_MAPPING 1
|
||||||
#else
|
#else
|
||||||
#error "config.h broken"
|
#error "config.h broken or no resampler found"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mpvcore/mp_msg.h"
|
#include "mpvcore/mp_msg.h"
|
||||||
@ -86,7 +86,7 @@ struct af_resample {
|
|||||||
uint8_t *reorder_buffer;
|
uint8_t *reorder_buffer;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef CONFIG_LIBAVRESAMPLE
|
#if HAVE_LIBAVRESAMPLE
|
||||||
static int get_delay(struct af_resample *s)
|
static int get_delay(struct af_resample *s)
|
||||||
{
|
{
|
||||||
return avresample_get_delay(s->avrctx);
|
return avresample_get_delay(s->avrctx);
|
||||||
|
@ -50,47 +50,47 @@ extern const struct ao_driver audio_out_sdl;
|
|||||||
|
|
||||||
static const struct ao_driver * const audio_out_drivers[] = {
|
static const struct ao_driver * const audio_out_drivers[] = {
|
||||||
// native:
|
// native:
|
||||||
#ifdef CONFIG_COREAUDIO
|
#if HAVE_COREAUDIO
|
||||||
&audio_out_coreaudio,
|
&audio_out_coreaudio,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_PULSE
|
#if HAVE_PULSE
|
||||||
&audio_out_pulse,
|
&audio_out_pulse,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_SNDIO
|
#if HAVE_SNDIO
|
||||||
&audio_out_sndio,
|
&audio_out_sndio,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_ALSA
|
#if HAVE_ALSA
|
||||||
&audio_out_alsa,
|
&audio_out_alsa,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_WASAPI
|
#if HAVE_WASAPI
|
||||||
&audio_out_wasapi,
|
&audio_out_wasapi,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_OSS_AUDIO
|
#if HAVE_OSS_AUDIO
|
||||||
&audio_out_oss,
|
&audio_out_oss,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_DSOUND
|
#if HAVE_DSOUND
|
||||||
&audio_out_dsound,
|
&audio_out_dsound,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_PORTAUDIO
|
#if HAVE_PORTAUDIO
|
||||||
&audio_out_portaudio,
|
&audio_out_portaudio,
|
||||||
#endif
|
#endif
|
||||||
// wrappers:
|
// wrappers:
|
||||||
#ifdef CONFIG_JACK
|
#if HAVE_JACK
|
||||||
&audio_out_jack,
|
&audio_out_jack,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_OPENAL
|
#if HAVE_OPENAL
|
||||||
&audio_out_openal,
|
&audio_out_openal,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_SDL
|
#if HAVE_SDL || HAVE_SDL2
|
||||||
&audio_out_sdl,
|
&audio_out_sdl,
|
||||||
#endif
|
#endif
|
||||||
&audio_out_null,
|
&audio_out_null,
|
||||||
// should not be auto-selected:
|
// should not be auto-selected:
|
||||||
&audio_out_pcm,
|
&audio_out_pcm,
|
||||||
#ifdef CONFIG_ENCODING
|
#if HAVE_ENCODING
|
||||||
&audio_out_lavc,
|
&audio_out_lavc,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_RSOUND
|
#if HAVE_RSOUND
|
||||||
&audio_out_rsound,
|
&audio_out_rsound,
|
||||||
#endif
|
#endif
|
||||||
NULL
|
NULL
|
||||||
|
@ -38,10 +38,10 @@
|
|||||||
#include "mpvcore/options.h"
|
#include "mpvcore/options.h"
|
||||||
#include "mpvcore/mp_msg.h"
|
#include "mpvcore/mp_msg.h"
|
||||||
|
|
||||||
#ifdef HAVE_SYS_SOUNDCARD_H
|
#if HAVE_SYS_SOUNDCARD_H
|
||||||
#include <sys/soundcard.h>
|
#include <sys/soundcard.h>
|
||||||
#else
|
#else
|
||||||
#ifdef HAVE_SOUNDCARD_H
|
#if HAVE_SOUNDCARD_H
|
||||||
#include <soundcard.h>
|
#include <soundcard.h>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@ -349,7 +349,7 @@ ac3_retry:
|
|||||||
// Measuring buffer size:
|
// Measuring buffer size:
|
||||||
void *data;
|
void *data;
|
||||||
p->buffersize = 0;
|
p->buffersize = 0;
|
||||||
#ifdef HAVE_AUDIO_SELECT
|
#if HAVE_AUDIO_SELECT
|
||||||
data = malloc(p->outburst);
|
data = malloc(p->outburst);
|
||||||
memset(data, 0, p->outburst);
|
memset(data, 0, p->outburst);
|
||||||
while (p->buffersize < 0x40000) {
|
while (p->buffersize < 0x40000) {
|
||||||
@ -367,7 +367,7 @@ ac3_retry:
|
|||||||
free(data);
|
free(data);
|
||||||
if (p->buffersize == 0) {
|
if (p->buffersize == 0) {
|
||||||
MP_ERR(ao, "*** Your audio driver DOES NOT support select() ***\n");
|
MP_ERR(ao, "*** Your audio driver DOES NOT support select() ***\n");
|
||||||
MP_ERR(ao, "Recompile mpv with #undef HAVE_AUDIO_SELECT in config.h!\n");
|
MP_ERR(ao, "Recompile mpv with #define HAVE_AUDIO_SELECT 0 in config.h!\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -456,7 +456,7 @@ static int get_space(struct ao *ao)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// check buffer
|
// check buffer
|
||||||
#ifdef HAVE_AUDIO_SELECT
|
#if HAVE_AUDIO_SELECT
|
||||||
{
|
{
|
||||||
fd_set rfds;
|
fd_set rfds;
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
|
@ -70,16 +70,16 @@ const demuxer_desc_t *const demuxer_list[] = {
|
|||||||
&demuxer_desc_cue,
|
&demuxer_desc_cue,
|
||||||
&demuxer_desc_rawaudio,
|
&demuxer_desc_rawaudio,
|
||||||
&demuxer_desc_rawvideo,
|
&demuxer_desc_rawvideo,
|
||||||
#ifdef CONFIG_TV
|
#if HAVE_TV
|
||||||
&demuxer_desc_tv,
|
&demuxer_desc_tv,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_ASS
|
#if HAVE_LIBASS
|
||||||
&demuxer_desc_libass,
|
&demuxer_desc_libass,
|
||||||
#endif
|
#endif
|
||||||
&demuxer_desc_matroska,
|
&demuxer_desc_matroska,
|
||||||
&demuxer_desc_lavf,
|
&demuxer_desc_lavf,
|
||||||
&demuxer_desc_mf,
|
&demuxer_desc_mf,
|
||||||
#ifdef CONFIG_MNG
|
#if HAVE_MNG
|
||||||
&demuxer_desc_mng,
|
&demuxer_desc_mng,
|
||||||
#endif
|
#endif
|
||||||
&demuxer_desc_playlist,
|
&demuxer_desc_playlist,
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#if CONFIG_ZLIB
|
#if HAVE_ZLIB
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -267,7 +267,7 @@ static bstr demux_mkv_decode(mkv_track_t *track, bstr data, uint32_t type)
|
|||||||
src = dest; // output from last iteration is new source
|
src = dest; // output from last iteration is new source
|
||||||
|
|
||||||
if (enc->comp_algo == 0) {
|
if (enc->comp_algo == 0) {
|
||||||
#if CONFIG_ZLIB
|
#if HAVE_ZLIB
|
||||||
/* zlib encoded track */
|
/* zlib encoded track */
|
||||||
|
|
||||||
if (size == 0)
|
if (size == 0)
|
||||||
@ -457,7 +457,7 @@ static void parse_trackencodings(struct demuxer *demuxer,
|
|||||||
"[mkv] algorithm (%" PRIu64 "). Skipping track.\n",
|
"[mkv] algorithm (%" PRIu64 "). Skipping track.\n",
|
||||||
track->tnum, e.comp_algo);
|
track->tnum, e.comp_algo);
|
||||||
}
|
}
|
||||||
#if !CONFIG_ZLIB
|
#if !HAVE_ZLIB
|
||||||
else if (e.comp_algo == 0) {
|
else if (e.comp_algo == 0) {
|
||||||
mp_tmsg(MSGT_DEMUX, MSGL_WARN,
|
mp_tmsg(MSGT_DEMUX, MSGL_WARN,
|
||||||
"[mkv] Track %u was compressed with zlib "
|
"[mkv] Track %u was compressed with zlib "
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#ifdef HAVE_GLOB
|
#if HAVE_GLOB
|
||||||
#include <glob.h>
|
#include <glob.h>
|
||||||
#else
|
#else
|
||||||
#include "osdep/glob.h"
|
#include "osdep/glob.h"
|
||||||
|
@ -33,18 +33,18 @@
|
|||||||
#include <libavformat/avformat.h>
|
#include <libavformat/avformat.h>
|
||||||
#include <libswscale/swscale.h>
|
#include <libswscale/swscale.h>
|
||||||
|
|
||||||
#ifdef CONFIG_LIBAVDEVICE
|
#if HAVE_LIBAVDEVICE
|
||||||
#include <libavdevice/avdevice.h>
|
#include <libavdevice/avdevice.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_LIBAVFILTER
|
#if HAVE_LIBAVFILTER
|
||||||
#include <libavfilter/avfilter.h>
|
#include <libavfilter/avfilter.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_LIBAVRESAMPLE
|
#if HAVE_LIBAVRESAMPLE
|
||||||
#include <libavresample/avresample.h>
|
#include <libavresample/avresample.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_LIBSWRESAMPLE
|
#if HAVE_LIBSWRESAMPLE
|
||||||
#include <libswresample/swresample.h>
|
#include <libswresample/swresample.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -138,10 +138,10 @@ void init_libav(void)
|
|||||||
av_register_all();
|
av_register_all();
|
||||||
avformat_network_init();
|
avformat_network_init();
|
||||||
|
|
||||||
#ifdef CONFIG_LIBAVFILTER
|
#if HAVE_LIBAVFILTER
|
||||||
avfilter_register_all();
|
avfilter_register_all();
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_LIBAVDEVICE
|
#if HAVE_LIBAVDEVICE
|
||||||
avdevice_register_all();
|
avdevice_register_all();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -164,13 +164,13 @@ void print_libav_versions(int v)
|
|||||||
print_version(v, "libavcodec", LIBAVCODEC_VERSION_INT, avcodec_version());
|
print_version(v, "libavcodec", LIBAVCODEC_VERSION_INT, avcodec_version());
|
||||||
print_version(v, "libavformat", LIBAVFORMAT_VERSION_INT, avformat_version());
|
print_version(v, "libavformat", LIBAVFORMAT_VERSION_INT, avformat_version());
|
||||||
print_version(v, "libswscale", LIBSWSCALE_VERSION_INT, swscale_version());
|
print_version(v, "libswscale", LIBSWSCALE_VERSION_INT, swscale_version());
|
||||||
#ifdef CONFIG_LIBAVFILTER
|
#if HAVE_LIBAVFILTER
|
||||||
print_version(v, "libavfilter", LIBAVFILTER_VERSION_INT, avfilter_version());
|
print_version(v, "libavfilter", LIBAVFILTER_VERSION_INT, avfilter_version());
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_LIBAVRESAMPLE
|
#if HAVE_LIBAVRESAMPLE
|
||||||
print_version(v, "libavresample", LIBAVRESAMPLE_VERSION_INT, avresample_version());
|
print_version(v, "libavresample", LIBAVRESAMPLE_VERSION_INT, avresample_version());
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_LIBSWRESAMPLE
|
#if HAVE_LIBSWRESAMPLE
|
||||||
print_version(v, "libswresample", LIBSWRESAMPLE_VERSION_INT, swresample_version());
|
print_version(v, "libswresample", LIBSWRESAMPLE_VERSION_INT, swresample_version());
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -27,15 +27,15 @@
|
|||||||
|
|
||||||
#include "mpvcore/mp_msg.h"
|
#include "mpvcore/mp_msg.h"
|
||||||
|
|
||||||
#ifdef CONFIG_ENCA
|
#if HAVE_ENCA
|
||||||
#include <enca.h>
|
#include <enca.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_LIBGUESS
|
#if HAVE_LIBGUESS
|
||||||
#include <libguess.h>
|
#include <libguess.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_ICONV
|
#if HAVE_ICONV
|
||||||
#include <iconv.h>
|
#include <iconv.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -85,7 +85,7 @@ bool mp_charset_requires_guess(const char *user_cp)
|
|||||||
(r > 1 && bstrcasecmp0(res[0], "utf8") == 0);
|
(r > 1 && bstrcasecmp0(res[0], "utf8") == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_ENCA
|
#if HAVE_ENCA
|
||||||
static const char *enca_guess(bstr buf, const char *language)
|
static const char *enca_guess(bstr buf, const char *language)
|
||||||
{
|
{
|
||||||
if (!language || !language[0])
|
if (!language || !language[0])
|
||||||
@ -117,7 +117,7 @@ static const char *enca_guess(bstr buf, const char *language)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_LIBGUESS
|
#if HAVE_LIBGUESS
|
||||||
static const char *libguess_guess(bstr buf, const char *language)
|
static const char *libguess_guess(bstr buf, const char *language)
|
||||||
{
|
{
|
||||||
if (!language || !language[0] || strcmp(language, "help") == 0) {
|
if (!language || !language[0] || strcmp(language, "help") == 0) {
|
||||||
@ -157,11 +157,11 @@ const char *mp_charset_guess(bstr buf, const char *user_cp, int flags)
|
|||||||
|
|
||||||
const char *res = NULL;
|
const char *res = NULL;
|
||||||
|
|
||||||
#ifdef CONFIG_ENCA
|
#if HAVE_ENCA
|
||||||
if (bstrcasecmp0(type, "enca") == 0)
|
if (bstrcasecmp0(type, "enca") == 0)
|
||||||
res = enca_guess(buf, lang);
|
res = enca_guess(buf, lang);
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_LIBGUESS
|
#if HAVE_LIBGUESS
|
||||||
if (bstrcasecmp0(type, "guess") == 0)
|
if (bstrcasecmp0(type, "guess") == 0)
|
||||||
res = libguess_guess(buf, lang);
|
res = libguess_guess(buf, lang);
|
||||||
#endif
|
#endif
|
||||||
@ -212,7 +212,7 @@ bstr mp_charset_guess_and_conv_to_utf8(bstr buf, const char *user_cp, int flags)
|
|||||||
// returns: buf (no conversion), .start==NULL (error), or allocated buffer
|
// returns: buf (no conversion), .start==NULL (error), or allocated buffer
|
||||||
bstr mp_iconv_to_utf8(bstr buf, const char *cp, int flags)
|
bstr mp_iconv_to_utf8(bstr buf, const char *cp, int flags)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_ICONV
|
#if HAVE_ICONV
|
||||||
if (!cp || !cp[0] || mp_charset_is_utf8(cp))
|
if (!cp || !cp[0] || mp_charset_is_utf8(cp))
|
||||||
return buf;
|
return buf;
|
||||||
|
|
||||||
|
@ -53,15 +53,15 @@
|
|||||||
|
|
||||||
#include "joystick.h"
|
#include "joystick.h"
|
||||||
|
|
||||||
#ifdef CONFIG_LIRC
|
#if HAVE_LIRC
|
||||||
#include "lirc.h"
|
#include "lirc.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_LIRCC
|
#if HAVE_LIRCC
|
||||||
#include <lirc/lircc.h>
|
#include <lirc/lircc.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_COCOA
|
#if HAVE_COCOA
|
||||||
#include "osdep/macosx_events.h"
|
#include "osdep/macosx_events.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -616,7 +616,7 @@ const m_option_t mp_input_opts[] = {
|
|||||||
OPT_FLAG("joystick", input.use_joystick, CONF_GLOBAL),
|
OPT_FLAG("joystick", input.use_joystick, CONF_GLOBAL),
|
||||||
OPT_FLAG("lirc", input.use_lirc, CONF_GLOBAL),
|
OPT_FLAG("lirc", input.use_lirc, CONF_GLOBAL),
|
||||||
OPT_FLAG("lircc", input.use_lircc, CONF_GLOBAL),
|
OPT_FLAG("lircc", input.use_lircc, CONF_GLOBAL),
|
||||||
#ifdef CONFIG_COCOA
|
#if HAVE_COCOA
|
||||||
OPT_FLAG("ar", input.use_ar, CONF_GLOBAL),
|
OPT_FLAG("ar", input.use_ar, CONF_GLOBAL),
|
||||||
OPT_FLAG("media-keys", input.use_media_keys, CONF_GLOBAL),
|
OPT_FLAG("media-keys", input.use_media_keys, CONF_GLOBAL),
|
||||||
#endif
|
#endif
|
||||||
@ -1734,7 +1734,7 @@ static void remove_dead_fds(struct input_ctx *ictx)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_POSIX_SELECT
|
#if HAVE_POSIX_SELECT
|
||||||
|
|
||||||
static void input_wait_read(struct input_ctx *ictx, int time)
|
static void input_wait_read(struct input_ctx *ictx, int time)
|
||||||
{
|
{
|
||||||
@ -2310,7 +2310,7 @@ struct input_ctx *mp_input_init(struct mpv_global *global)
|
|||||||
"input config\n");
|
"input config\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_JOYSTICK
|
#if HAVE_JOYSTICK
|
||||||
if (input_conf->use_joystick) {
|
if (input_conf->use_joystick) {
|
||||||
int fd = mp_input_joystick_init(input_conf->js_dev);
|
int fd = mp_input_joystick_init(input_conf->js_dev);
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
@ -2321,7 +2321,7 @@ struct input_ctx *mp_input_init(struct mpv_global *global)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_LIRC
|
#if HAVE_LIRC
|
||||||
if (input_conf->use_lirc) {
|
if (input_conf->use_lirc) {
|
||||||
int fd = mp_input_lirc_init();
|
int fd = mp_input_lirc_init();
|
||||||
if (fd > 0)
|
if (fd > 0)
|
||||||
@ -2330,7 +2330,7 @@ struct input_ctx *mp_input_init(struct mpv_global *global)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_LIRCC
|
#if HAVE_LIRCC
|
||||||
if (input_conf->use_lircc) {
|
if (input_conf->use_lircc) {
|
||||||
int fd = lircc_init("mpv", NULL);
|
int fd = lircc_init("mpv", NULL);
|
||||||
if (fd >= 0)
|
if (fd >= 0)
|
||||||
@ -2338,7 +2338,7 @@ struct input_ctx *mp_input_init(struct mpv_global *global)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_COCOA
|
#if HAVE_COCOA
|
||||||
if (input_conf->use_ar) {
|
if (input_conf->use_ar) {
|
||||||
cocoa_init_apple_remote();
|
cocoa_init_apple_remote();
|
||||||
ictx->using_ar = true;
|
ictx->using_ar = true;
|
||||||
@ -2386,7 +2386,7 @@ void mp_input_uninit(struct input_ctx *ictx)
|
|||||||
if (!ictx)
|
if (!ictx)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef CONFIG_COCOA
|
#if HAVE_COCOA
|
||||||
if (ictx->using_ar) {
|
if (ictx->using_ar) {
|
||||||
cocoa_uninit_apple_remote();
|
cocoa_uninit_apple_remote();
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ static int print_version_opt(const m_option_t *opt, const char *name,
|
|||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_RADIO
|
#if HAVE_RADIO
|
||||||
static const m_option_t radioopts_conf[]={
|
static const m_option_t radioopts_conf[]={
|
||||||
{"device", &stream_radio_defaults.device, CONF_TYPE_STRING, 0, 0 ,0, NULL},
|
{"device", &stream_radio_defaults.device, CONF_TYPE_STRING, 0, 0 ,0, NULL},
|
||||||
{"driver", &stream_radio_defaults.driver, CONF_TYPE_STRING, 0, 0 ,0, NULL},
|
{"driver", &stream_radio_defaults.driver, CONF_TYPE_STRING, 0, 0 ,0, NULL},
|
||||||
@ -83,9 +83,9 @@ static const m_option_t radioopts_conf[]={
|
|||||||
{"achannels", &stream_radio_defaults.achannels, CONF_TYPE_INT, CONF_MIN, 0 ,0, NULL},
|
{"achannels", &stream_radio_defaults.achannels, CONF_TYPE_INT, CONF_MIN, 0 ,0, NULL},
|
||||||
{NULL, NULL, 0, 0, 0, 0, NULL}
|
{NULL, NULL, 0, 0, 0, 0, NULL}
|
||||||
};
|
};
|
||||||
#endif /* CONFIG_RADIO */
|
#endif /* HAVE_RADIO */
|
||||||
|
|
||||||
#ifdef CONFIG_TV
|
#if HAVE_TV
|
||||||
static const m_option_t tvopts_conf[]={
|
static const m_option_t tvopts_conf[]={
|
||||||
{"immediatemode", &stream_tv_defaults.immediate, CONF_TYPE_INT, CONF_RANGE, 0, 1, NULL},
|
{"immediatemode", &stream_tv_defaults.immediate, CONF_TYPE_INT, CONF_RANGE, 0, 1, NULL},
|
||||||
{"audio", &stream_tv_defaults.noaudio, CONF_TYPE_FLAG, 0, 1, 0, NULL},
|
{"audio", &stream_tv_defaults.noaudio, CONF_TYPE_FLAG, 0, 1, 0, NULL},
|
||||||
@ -97,7 +97,7 @@ static const m_option_t tvopts_conf[]={
|
|||||||
{"chanlist", &stream_tv_defaults.chanlist, CONF_TYPE_STRING, 0, 0, 0, NULL},
|
{"chanlist", &stream_tv_defaults.chanlist, CONF_TYPE_STRING, 0, 0, 0, NULL},
|
||||||
{"norm", &stream_tv_defaults.norm, CONF_TYPE_STRING, 0, 0, 0, NULL},
|
{"norm", &stream_tv_defaults.norm, CONF_TYPE_STRING, 0, 0, 0, NULL},
|
||||||
{"automute", &stream_tv_defaults.automute, CONF_TYPE_INT, CONF_RANGE, 0, 255, NULL},
|
{"automute", &stream_tv_defaults.automute, CONF_TYPE_INT, CONF_RANGE, 0, 255, NULL},
|
||||||
#if defined(CONFIG_TV_V4L2)
|
#if HAVE_TV_V4L2
|
||||||
{"normid", &stream_tv_defaults.normid, CONF_TYPE_INT, 0, 0, 0, NULL},
|
{"normid", &stream_tv_defaults.normid, CONF_TYPE_INT, 0, 0, 0, NULL},
|
||||||
#endif
|
#endif
|
||||||
{"width", &stream_tv_defaults.width, CONF_TYPE_INT, 0, 0, 4096, NULL},
|
{"width", &stream_tv_defaults.width, CONF_TYPE_INT, 0, 0, 4096, NULL},
|
||||||
@ -111,7 +111,7 @@ static const m_option_t tvopts_conf[]={
|
|||||||
{"hue", &stream_tv_defaults.hue, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL},
|
{"hue", &stream_tv_defaults.hue, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL},
|
||||||
{"saturation", &stream_tv_defaults.saturation, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL},
|
{"saturation", &stream_tv_defaults.saturation, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL},
|
||||||
{"gain", &stream_tv_defaults.gain, CONF_TYPE_INT, CONF_RANGE, -1, 100, NULL},
|
{"gain", &stream_tv_defaults.gain, CONF_TYPE_INT, CONF_RANGE, -1, 100, NULL},
|
||||||
#if defined(CONFIG_TV_V4L2)
|
#if HAVE_TV_V4L2
|
||||||
{"amode", &stream_tv_defaults.amode, CONF_TYPE_INT, CONF_RANGE, 0, 3, NULL},
|
{"amode", &stream_tv_defaults.amode, CONF_TYPE_INT, CONF_RANGE, 0, 3, NULL},
|
||||||
{"volume", &stream_tv_defaults.volume, CONF_TYPE_INT, CONF_RANGE, 0, 65535, NULL},
|
{"volume", &stream_tv_defaults.volume, CONF_TYPE_INT, CONF_RANGE, 0, 65535, NULL},
|
||||||
{"bass", &stream_tv_defaults.bass, CONF_TYPE_INT, CONF_RANGE, 0, 65535, NULL},
|
{"bass", &stream_tv_defaults.bass, CONF_TYPE_INT, CONF_RANGE, 0, 65535, NULL},
|
||||||
@ -123,15 +123,15 @@ static const m_option_t tvopts_conf[]={
|
|||||||
{"mjpeg", &stream_tv_defaults.mjpeg, CONF_TYPE_FLAG, 0, 0, 1, NULL},
|
{"mjpeg", &stream_tv_defaults.mjpeg, CONF_TYPE_FLAG, 0, 0, 1, NULL},
|
||||||
{"decimation", &stream_tv_defaults.decimation, CONF_TYPE_INT, CONF_RANGE, 1, 4, NULL},
|
{"decimation", &stream_tv_defaults.decimation, CONF_TYPE_INT, CONF_RANGE, 1, 4, NULL},
|
||||||
{"quality", &stream_tv_defaults.quality, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL},
|
{"quality", &stream_tv_defaults.quality, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL},
|
||||||
#ifdef CONFIG_ALSA
|
#if HAVE_ALSA
|
||||||
{"alsa", &stream_tv_defaults.alsa, CONF_TYPE_FLAG, 0, 0, 1, NULL},
|
{"alsa", &stream_tv_defaults.alsa, CONF_TYPE_FLAG, 0, 0, 1, NULL},
|
||||||
#endif /* CONFIG_ALSA */
|
#endif /* HAVE_ALSA */
|
||||||
#endif /* defined(CONFIG_TV_V4L2) */
|
#endif /* HAVE_TV_V4L2 */
|
||||||
{"adevice", &stream_tv_defaults.adevice, CONF_TYPE_STRING, 0, 0, 0, NULL},
|
{"adevice", &stream_tv_defaults.adevice, CONF_TYPE_STRING, 0, 0, 0, NULL},
|
||||||
{"audioid", &stream_tv_defaults.audio_id, CONF_TYPE_INT, CONF_RANGE, 0, 9, NULL},
|
{"audioid", &stream_tv_defaults.audio_id, CONF_TYPE_INT, CONF_RANGE, 0, 9, NULL},
|
||||||
{NULL, NULL, 0, 0, 0, 0, NULL}
|
{NULL, NULL, 0, 0, 0, 0, NULL}
|
||||||
};
|
};
|
||||||
#endif /* CONFIG_TV */
|
#endif /* HAVE_TV */
|
||||||
|
|
||||||
extern int pvr_param_aspect_ratio;
|
extern int pvr_param_aspect_ratio;
|
||||||
extern int pvr_param_sample_rate;
|
extern int pvr_param_sample_rate;
|
||||||
@ -143,7 +143,7 @@ extern char *pvr_param_bitrate_mode;
|
|||||||
extern int pvr_param_bitrate_peak;
|
extern int pvr_param_bitrate_peak;
|
||||||
extern char *pvr_param_stream_type;
|
extern char *pvr_param_stream_type;
|
||||||
|
|
||||||
#ifdef CONFIG_PVR
|
#if HAVE_PVR
|
||||||
static const m_option_t pvropts_conf[]={
|
static const m_option_t pvropts_conf[]={
|
||||||
{"aspect", &pvr_param_aspect_ratio, CONF_TYPE_INT, 0, 1, 4, NULL},
|
{"aspect", &pvr_param_aspect_ratio, CONF_TYPE_INT, 0, 1, 4, NULL},
|
||||||
{"arate", &pvr_param_sample_rate, CONF_TYPE_INT, 0, 32000, 48000, NULL},
|
{"arate", &pvr_param_sample_rate, CONF_TYPE_INT, 0, 32000, 48000, NULL},
|
||||||
@ -156,7 +156,7 @@ static const m_option_t pvropts_conf[]={
|
|||||||
{"fmt", &pvr_param_stream_type, CONF_TYPE_STRING, 0, 0, 0, NULL},
|
{"fmt", &pvr_param_stream_type, CONF_TYPE_STRING, 0, 0, 0, NULL},
|
||||||
{NULL, NULL, 0, 0, 0, 0, NULL}
|
{NULL, NULL, 0, 0, 0, 0, NULL}
|
||||||
};
|
};
|
||||||
#endif /* CONFIG_PVR */
|
#endif /* HAVE_PVR */
|
||||||
|
|
||||||
extern const m_option_t dvbin_opts_conf[];
|
extern const m_option_t dvbin_opts_conf[];
|
||||||
extern const m_option_t lavfdopts_conf[];
|
extern const m_option_t lavfdopts_conf[];
|
||||||
@ -290,7 +290,7 @@ static const m_option_t msgl_config[]={
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef CONFIG_TV
|
#if HAVE_TV
|
||||||
static const m_option_t tvscan_conf[]={
|
static const m_option_t tvscan_conf[]={
|
||||||
{"autostart", &stream_tv_defaults.scan, CONF_TYPE_FLAG, 0, 0, 1, NULL},
|
{"autostart", &stream_tv_defaults.scan, CONF_TYPE_FLAG, 0, 0, 1, NULL},
|
||||||
{"threshold", &stream_tv_defaults.scan_threshold, CONF_TYPE_INT, CONF_RANGE, 1, 100, NULL},
|
{"threshold", &stream_tv_defaults.scan_threshold, CONF_TYPE_INT, CONF_RANGE, 1, 100, NULL},
|
||||||
@ -340,20 +340,20 @@ const m_option_t mp_opts[] = {
|
|||||||
{"msglevel", (void *) msgl_config, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
|
{"msglevel", (void *) msgl_config, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
|
||||||
{"msgcolor", &mp_msg_color, CONF_TYPE_FLAG, CONF_GLOBAL | CONF_PRE_PARSE, 0, 1, NULL},
|
{"msgcolor", &mp_msg_color, CONF_TYPE_FLAG, CONF_GLOBAL | CONF_PRE_PARSE, 0, 1, NULL},
|
||||||
{"msgmodule", &mp_msg_module, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL},
|
{"msgmodule", &mp_msg_module, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL},
|
||||||
#ifdef CONFIG_PRIORITY
|
#if HAVE_PRIORITY
|
||||||
{"priority", &proc_priority, CONF_TYPE_STRING, 0, 0, 0, NULL},
|
{"priority", &proc_priority, CONF_TYPE_STRING, 0, 0, 0, NULL},
|
||||||
#endif
|
#endif
|
||||||
OPT_FLAG("config", load_config, CONF_GLOBAL | CONF_NOCFG | CONF_PRE_PARSE),
|
OPT_FLAG("config", load_config, CONF_GLOBAL | CONF_NOCFG | CONF_PRE_PARSE),
|
||||||
OPT_STRINGLIST("reset-on-next-file", reset_options, CONF_GLOBAL),
|
OPT_STRINGLIST("reset-on-next-file", reset_options, CONF_GLOBAL),
|
||||||
|
|
||||||
#ifdef CONFIG_LUA
|
#if HAVE_LUA
|
||||||
OPT_STRINGLIST("lua", lua_files, CONF_GLOBAL),
|
OPT_STRINGLIST("lua", lua_files, CONF_GLOBAL),
|
||||||
OPT_FLAG("osc", lua_load_osc, CONF_GLOBAL),
|
OPT_FLAG("osc", lua_load_osc, CONF_GLOBAL),
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ------------------------- stream options --------------------
|
// ------------------------- stream options --------------------
|
||||||
|
|
||||||
#ifdef CONFIG_STREAM_CACHE
|
#if HAVE_STREAM_CACHE
|
||||||
OPT_CHOICE_OR_INT("cache", stream_cache_size, 0, 32, 0x7fffffff,
|
OPT_CHOICE_OR_INT("cache", stream_cache_size, 0, 32, 0x7fffffff,
|
||||||
({"no", 0},
|
({"no", 0},
|
||||||
{"auto", -1}),
|
{"auto", -1}),
|
||||||
@ -365,20 +365,20 @@ const m_option_t mp_opts[] = {
|
|||||||
OPT_FLOATRANGE("cache-seek-min", stream_cache_seek_min_percent, 0, 0, 99),
|
OPT_FLOATRANGE("cache-seek-min", stream_cache_seek_min_percent, 0, 0, 99),
|
||||||
OPT_CHOICE_OR_INT("cache-pause", stream_cache_pause, 0,
|
OPT_CHOICE_OR_INT("cache-pause", stream_cache_pause, 0,
|
||||||
0, 40, ({"no", -1})),
|
0, 40, ({"no", -1})),
|
||||||
#endif /* CONFIG_STREAM_CACHE */
|
#endif /* HAVE_STREAM_CACHE */
|
||||||
{"cdrom-device", &cdrom_device, CONF_TYPE_STRING, 0, 0, 0, NULL},
|
{"cdrom-device", &cdrom_device, CONF_TYPE_STRING, 0, 0, 0, NULL},
|
||||||
#ifdef CONFIG_DVDREAD
|
#if HAVE_DVDREAD
|
||||||
{"dvd-device", &dvd_device, CONF_TYPE_STRING, 0, 0, 0, NULL},
|
{"dvd-device", &dvd_device, CONF_TYPE_STRING, 0, 0, 0, NULL},
|
||||||
{"dvd-speed", &dvd_speed, CONF_TYPE_INT, 0, 0, 0, NULL},
|
{"dvd-speed", &dvd_speed, CONF_TYPE_INT, 0, 0, 0, NULL},
|
||||||
{"dvdangle", &dvd_angle, CONF_TYPE_INT, CONF_RANGE, 1, 99, NULL},
|
{"dvdangle", &dvd_angle, CONF_TYPE_INT, CONF_RANGE, 1, 99, NULL},
|
||||||
#endif /* CONFIG_DVDREAD */
|
#endif /* HAVE_DVDREAD */
|
||||||
OPT_INTPAIR("chapter", chapterrange, 0),
|
OPT_INTPAIR("chapter", chapterrange, 0),
|
||||||
OPT_CHOICE_OR_INT("edition", edition_id, 0, 0, 8190,
|
OPT_CHOICE_OR_INT("edition", edition_id, 0, 0, 8190,
|
||||||
({"auto", -1})),
|
({"auto", -1})),
|
||||||
#ifdef CONFIG_LIBBLURAY
|
#if HAVE_LIBBLURAY
|
||||||
{"bluray-device", &bluray_device, CONF_TYPE_STRING, 0, 0, 0, NULL},
|
{"bluray-device", &bluray_device, CONF_TYPE_STRING, 0, 0, 0, NULL},
|
||||||
{"bluray-angle", &bluray_angle, CONF_TYPE_INT, CONF_RANGE, 0, 999, NULL},
|
{"bluray-angle", &bluray_angle, CONF_TYPE_INT, CONF_RANGE, 0, 999, NULL},
|
||||||
#endif /* CONFIG_LIBBLURAY */
|
#endif /* HAVE_LIBBLURAY */
|
||||||
|
|
||||||
{"http-header-fields", &network_http_header_fields, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL},
|
{"http-header-fields", &network_http_header_fields, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL},
|
||||||
{"user-agent", &network_useragent, CONF_TYPE_STRING, 0, 0, 0, NULL},
|
{"user-agent", &network_useragent, CONF_TYPE_STRING, 0, 0, 0, NULL},
|
||||||
@ -426,7 +426,7 @@ const m_option_t mp_opts[] = {
|
|||||||
|
|
||||||
OPT_STRING("quvi-format", quvi_format, 0),
|
OPT_STRING("quvi-format", quvi_format, 0),
|
||||||
|
|
||||||
#ifdef CONFIG_CDDA
|
#if HAVE_CDDA
|
||||||
{ "cdda", (void *)&cdda_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
|
{ "cdda", (void *)&cdda_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -438,16 +438,16 @@ const m_option_t mp_opts[] = {
|
|||||||
OPT_STRING("sub-demuxer", sub_demuxer_name, 0),
|
OPT_STRING("sub-demuxer", sub_demuxer_name, 0),
|
||||||
|
|
||||||
{"mf", (void *) mfopts_conf, CONF_TYPE_SUBCONFIG, 0,0,0, NULL},
|
{"mf", (void *) mfopts_conf, CONF_TYPE_SUBCONFIG, 0,0,0, NULL},
|
||||||
#ifdef CONFIG_RADIO
|
#if HAVE_RADIO
|
||||||
{"radio", (void *) radioopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
|
{"radio", (void *) radioopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
|
||||||
#endif /* CONFIG_RADIO */
|
#endif /* HAVE_RADIO */
|
||||||
#ifdef CONFIG_TV
|
#if HAVE_TV
|
||||||
{"tv", (void *) tvopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
|
{"tv", (void *) tvopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
|
||||||
#endif /* CONFIG_TV */
|
#endif /* HAVE_TV */
|
||||||
#ifdef CONFIG_PVR
|
#if HAVE_PVR
|
||||||
{"pvr", (void *) pvropts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
|
{"pvr", (void *) pvropts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
|
||||||
#endif /* CONFIG_PVR */
|
#endif /* HAVE_PVR */
|
||||||
#ifdef CONFIG_DVBIN
|
#if HAVE_DVBIN
|
||||||
{"dvbin", (void *) dvbin_opts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
|
{"dvbin", (void *) dvbin_opts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -494,7 +494,7 @@ const m_option_t mp_opts[] = {
|
|||||||
|
|
||||||
// postprocessing:
|
// postprocessing:
|
||||||
OPT_INT("pp", divx_quality, 0),
|
OPT_INT("pp", divx_quality, 0),
|
||||||
#ifdef CONFIG_LIBPOSTPROC
|
#if HAVE_LIBPOSTPROC
|
||||||
{"pphelp", (void *) &pp_help, CONF_TYPE_PRINT, CONF_GLOBAL | CONF_NOCFG, 0, 0, NULL},
|
{"pphelp", (void *) &pp_help, CONF_TYPE_PRINT, CONF_GLOBAL | CONF_NOCFG, 0, 0, NULL},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -633,7 +633,7 @@ const m_option_t mp_opts[] = {
|
|||||||
OPT_FLAG("stop-screensaver", stop_screensaver, 0),
|
OPT_FLAG("stop-screensaver", stop_screensaver, 0),
|
||||||
|
|
||||||
OPT_INT64("wid", vo.WinID, CONF_GLOBAL),
|
OPT_INT64("wid", vo.WinID, CONF_GLOBAL),
|
||||||
#ifdef CONFIG_X11
|
#if HAVE_X11
|
||||||
OPT_STRINGLIST("fstype", vo.fstype_list, 0),
|
OPT_STRINGLIST("fstype", vo.fstype_list, 0),
|
||||||
#endif
|
#endif
|
||||||
OPT_STRING("heartbeat-cmd", heartbeat_cmd, 0),
|
OPT_STRING("heartbeat-cmd", heartbeat_cmd, 0),
|
||||||
@ -645,7 +645,7 @@ const m_option_t mp_opts[] = {
|
|||||||
OPT_CHOICE_OR_INT("fs-screen", vo.fsscreen_id, 0, 0, 32,
|
OPT_CHOICE_OR_INT("fs-screen", vo.fsscreen_id, 0, 0, 32,
|
||||||
({"all", -2}, {"current", -1})),
|
({"all", -2}, {"current", -1})),
|
||||||
|
|
||||||
#ifdef CONFIG_COCOA
|
#if HAVE_COCOA
|
||||||
OPT_FLAG("native-fs", vo.native_fs, 0),
|
OPT_FLAG("native-fs", vo.native_fs, 0),
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -677,7 +677,7 @@ const m_option_t mp_opts[] = {
|
|||||||
OPT_STRING("stream-capture", stream_capture, 0),
|
OPT_STRING("stream-capture", stream_capture, 0),
|
||||||
OPT_STRING("stream-dump", stream_dump, 0),
|
OPT_STRING("stream-dump", stream_dump, 0),
|
||||||
|
|
||||||
#ifdef CONFIG_LIRC
|
#if HAVE_LIRC
|
||||||
{"lircconf", &lirc_configfile, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL},
|
{"lircconf", &lirc_configfile, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -724,9 +724,9 @@ const m_option_t mp_opts[] = {
|
|||||||
OPT_INTRANGE("key-fifo-size", input.key_fifo_size, CONF_GLOBAL, 2, 65000),
|
OPT_INTRANGE("key-fifo-size", input.key_fifo_size, CONF_GLOBAL, 2, 65000),
|
||||||
OPT_FLAG("consolecontrols", consolecontrols, CONF_GLOBAL),
|
OPT_FLAG("consolecontrols", consolecontrols, CONF_GLOBAL),
|
||||||
OPT_FLAG("mouse-movements", vo.enable_mouse_movements, CONF_GLOBAL),
|
OPT_FLAG("mouse-movements", vo.enable_mouse_movements, CONF_GLOBAL),
|
||||||
#ifdef CONFIG_TV
|
#if HAVE_TV
|
||||||
{"tvscan", (void *) tvscan_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
|
{"tvscan", (void *) tvscan_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
|
||||||
#endif /* CONFIG_TV */
|
#endif /* HAVE_TV */
|
||||||
|
|
||||||
{"screenshot", (void *) screenshot_conf, CONF_TYPE_SUBCONFIG},
|
{"screenshot", (void *) screenshot_conf, CONF_TYPE_SUBCONFIG},
|
||||||
|
|
||||||
@ -739,7 +739,7 @@ const m_option_t mp_opts[] = {
|
|||||||
{"version", (void *)print_version_opt, CONF_TYPE_PRINT_FUNC, CONF_NOCFG|CONF_GLOBAL|M_OPT_PRE_PARSE},
|
{"version", (void *)print_version_opt, CONF_TYPE_PRINT_FUNC, CONF_NOCFG|CONF_GLOBAL|M_OPT_PRE_PARSE},
|
||||||
{"V", (void *)print_version_opt, CONF_TYPE_PRINT_FUNC, CONF_NOCFG|CONF_GLOBAL|M_OPT_PRE_PARSE},
|
{"V", (void *)print_version_opt, CONF_TYPE_PRINT_FUNC, CONF_NOCFG|CONF_GLOBAL|M_OPT_PRE_PARSE},
|
||||||
|
|
||||||
#ifdef CONFIG_ENCODING
|
#if HAVE_ENCODING
|
||||||
OPT_STRING("o", encode_output.file, CONF_GLOBAL),
|
OPT_STRING("o", encode_output.file, CONF_GLOBAL),
|
||||||
OPT_STRING("of", encode_output.format, CONF_GLOBAL),
|
OPT_STRING("of", encode_output.format, CONF_GLOBAL),
|
||||||
OPT_STRINGLIST("ofopts*", encode_output.fopts, CONF_GLOBAL),
|
OPT_STRINGLIST("ofopts*", encode_output.fopts, CONF_GLOBAL),
|
||||||
@ -836,7 +836,7 @@ const struct MPOpts mp_default_opts = {
|
|||||||
.field_dominance = -1,
|
.field_dominance = -1,
|
||||||
.sub_auto = 1,
|
.sub_auto = 1,
|
||||||
.osd_bar_visible = 1,
|
.osd_bar_visible = 1,
|
||||||
#ifdef CONFIG_ASS
|
#if HAVE_LIBASS
|
||||||
.ass_enabled = 1,
|
.ass_enabled = 1,
|
||||||
#endif
|
#endif
|
||||||
.sub_scale = 1,
|
.sub_scale = 1,
|
||||||
@ -847,7 +847,7 @@ const struct MPOpts mp_default_opts = {
|
|||||||
.ass_shaper = 1,
|
.ass_shaper = 1,
|
||||||
.use_embedded_fonts = 1,
|
.use_embedded_fonts = 1,
|
||||||
.suboverlap_enabled = 0,
|
.suboverlap_enabled = 0,
|
||||||
#ifdef CONFIG_ENCA
|
#if HAVE_ENCA
|
||||||
.sub_cp = "enca",
|
.sub_cp = "enca",
|
||||||
#else
|
#else
|
||||||
.sub_cp = "UTF-8:UTF-8-BROKEN",
|
.sub_cp = "UTF-8:UTF-8-BROKEN",
|
||||||
@ -875,7 +875,7 @@ const struct MPOpts mp_default_opts = {
|
|||||||
.use_joystick = 1,
|
.use_joystick = 1,
|
||||||
.use_lirc = 1,
|
.use_lirc = 1,
|
||||||
.use_lircc = 1,
|
.use_lircc = 1,
|
||||||
#ifdef CONFIG_COCOA
|
#if HAVE_COCOA
|
||||||
.use_ar = 1,
|
.use_ar = 1,
|
||||||
.use_media_keys = 1,
|
.use_media_keys = 1,
|
||||||
#endif
|
#endif
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
typedef char *(*lookup_fun)(const char *);
|
typedef char *(*lookup_fun)(const char *);
|
||||||
static const lookup_fun config_lookup_functions[] = {
|
static const lookup_fun config_lookup_functions[] = {
|
||||||
mp_find_user_config_file,
|
mp_find_user_config_file,
|
||||||
#ifdef CONFIG_COCOA
|
#if HAVE_COCOA
|
||||||
mp_get_macosx_bundled_path,
|
mp_get_macosx_bundled_path,
|
||||||
#endif
|
#endif
|
||||||
mp_find_global_config_file,
|
mp_find_global_config_file,
|
||||||
|
@ -56,11 +56,11 @@
|
|||||||
#include "stream/tv.h"
|
#include "stream/tv.h"
|
||||||
#include "stream/stream_radio.h"
|
#include "stream/stream_radio.h"
|
||||||
#include "stream/pvr.h"
|
#include "stream/pvr.h"
|
||||||
#ifdef CONFIG_DVBIN
|
#if HAVE_DVBIN
|
||||||
#include "stream/dvbin.h"
|
#include "stream/dvbin.h"
|
||||||
#endif
|
#endif
|
||||||
#include "screenshot.h"
|
#include "screenshot.h"
|
||||||
#ifdef HAVE_SYS_MMAN_H
|
#if HAVE_SYS_MMAN_H
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1137,11 +1137,11 @@ static int mp_property_fullscreen(m_option_t *prop,
|
|||||||
#define VF_DEINTERLACE_LABEL "deinterlace"
|
#define VF_DEINTERLACE_LABEL "deinterlace"
|
||||||
|
|
||||||
static const char *deint_filters[] = {
|
static const char *deint_filters[] = {
|
||||||
#ifdef CONFIG_VF_LAVFI
|
#if HAVE_VF_LAVFI
|
||||||
"lavfi=yadif",
|
"lavfi=yadif",
|
||||||
#endif
|
#endif
|
||||||
"yadif",
|
"yadif",
|
||||||
#if CONFIG_VAAPI_VPP
|
#if HAVE_VAAPI_VPP
|
||||||
"vavpp",
|
"vavpp",
|
||||||
#endif
|
#endif
|
||||||
NULL
|
NULL
|
||||||
@ -1608,7 +1608,7 @@ static int mp_property_sub_pos(m_option_t *prop, int action, void *arg,
|
|||||||
return property_osd_helper(prop, action, arg, mpctx);
|
return property_osd_helper(prop, action, arg, mpctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_TV
|
#if HAVE_TV
|
||||||
|
|
||||||
static tvi_handle_t *get_tvh(struct MPContext *mpctx)
|
static tvi_handle_t *get_tvh(struct MPContext *mpctx)
|
||||||
{
|
{
|
||||||
@ -1955,7 +1955,7 @@ static const m_option_t mp_properties[] = {
|
|||||||
M_OPTION_PROPERTY_CUSTOM("sub-visibility", property_osd_helper),
|
M_OPTION_PROPERTY_CUSTOM("sub-visibility", property_osd_helper),
|
||||||
M_OPTION_PROPERTY_CUSTOM("sub-forced-only", property_osd_helper),
|
M_OPTION_PROPERTY_CUSTOM("sub-forced-only", property_osd_helper),
|
||||||
M_OPTION_PROPERTY_CUSTOM("sub-scale", property_osd_helper),
|
M_OPTION_PROPERTY_CUSTOM("sub-scale", property_osd_helper),
|
||||||
#ifdef CONFIG_ASS
|
#if HAVE_LIBASS
|
||||||
M_OPTION_PROPERTY_CUSTOM("ass-use-margins", property_osd_helper),
|
M_OPTION_PROPERTY_CUSTOM("ass-use-margins", property_osd_helper),
|
||||||
M_OPTION_PROPERTY_CUSTOM("ass-vsfilter-aspect-compat", property_osd_helper),
|
M_OPTION_PROPERTY_CUSTOM("ass-vsfilter-aspect-compat", property_osd_helper),
|
||||||
M_OPTION_PROPERTY_CUSTOM("ass-style-override", property_osd_helper),
|
M_OPTION_PROPERTY_CUSTOM("ass-style-override", property_osd_helper),
|
||||||
@ -1964,7 +1964,7 @@ static const m_option_t mp_properties[] = {
|
|||||||
M_OPTION_PROPERTY_CUSTOM("vf*", mp_property_vf),
|
M_OPTION_PROPERTY_CUSTOM("vf*", mp_property_vf),
|
||||||
M_OPTION_PROPERTY_CUSTOM("af*", mp_property_af),
|
M_OPTION_PROPERTY_CUSTOM("af*", mp_property_af),
|
||||||
|
|
||||||
#ifdef CONFIG_TV
|
#if HAVE_TV
|
||||||
{ "tv-brightness", mp_property_tv_color, CONF_TYPE_INT,
|
{ "tv-brightness", mp_property_tv_color, CONF_TYPE_INT,
|
||||||
M_OPT_RANGE, -100, 100, .offset = TV_COLOR_BRIGHTNESS },
|
M_OPT_RANGE, -100, 100, .offset = TV_COLOR_BRIGHTNESS },
|
||||||
{ "tv-contrast", mp_property_tv_color, CONF_TYPE_INT,
|
{ "tv-contrast", mp_property_tv_color, CONF_TYPE_INT,
|
||||||
@ -2071,7 +2071,7 @@ static struct property_osd_display {
|
|||||||
{ "ass-style-override", _("ASS subtitle style override")},
|
{ "ass-style-override", _("ASS subtitle style override")},
|
||||||
{ "vf*", _("Video filters"), .msg = "Video filters:\n${vf}"},
|
{ "vf*", _("Video filters"), .msg = "Video filters:\n${vf}"},
|
||||||
{ "af*", _("Audio filters"), .msg = "Audio filters:\n${af}"},
|
{ "af*", _("Audio filters"), .msg = "Audio filters:\n${af}"},
|
||||||
#ifdef CONFIG_TV
|
#if HAVE_TV
|
||||||
{ "tv-brightness", _("Brightness"), .osd_progbar = OSD_BRIGHTNESS },
|
{ "tv-brightness", _("Brightness"), .osd_progbar = OSD_BRIGHTNESS },
|
||||||
{ "tv-hue", _("Hue"), .osd_progbar = OSD_HUE},
|
{ "tv-hue", _("Hue"), .osd_progbar = OSD_HUE},
|
||||||
{ "tv-saturation", _("Saturation"), .osd_progbar = OSD_SATURATION },
|
{ "tv-saturation", _("Saturation"), .osd_progbar = OSD_SATURATION },
|
||||||
@ -2272,7 +2272,7 @@ static int edit_filters_osd(struct MPContext *mpctx, enum stream_type mediatype,
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_SYS_MMAN_H
|
#if HAVE_SYS_MMAN_H
|
||||||
|
|
||||||
static int ext2_sub_find(struct MPContext *mpctx, int id)
|
static int ext2_sub_find(struct MPContext *mpctx, int id)
|
||||||
{
|
{
|
||||||
@ -2723,7 +2723,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
|
|||||||
(bar_osd ? OSD_SEEK_INFO_BAR : 0);
|
(bar_osd ? OSD_SEEK_INFO_BAR : 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef CONFIG_RADIO
|
#if HAVE_RADIO
|
||||||
case MP_CMD_RADIO_STEP_CHANNEL:
|
case MP_CMD_RADIO_STEP_CHANNEL:
|
||||||
if (mpctx->stream && mpctx->stream->type == STREAMTYPE_RADIO) {
|
if (mpctx->stream && mpctx->stream->type == STREAMTYPE_RADIO) {
|
||||||
int v = cmd->args[0].v.i;
|
int v = cmd->args[0].v.i;
|
||||||
@ -2761,7 +2761,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_TV
|
#if HAVE_TV
|
||||||
case MP_CMD_TV_START_SCAN:
|
case MP_CMD_TV_START_SCAN:
|
||||||
if (get_tvh(mpctx))
|
if (get_tvh(mpctx))
|
||||||
tv_start_scan(get_tvh(mpctx), 1);
|
tv_start_scan(get_tvh(mpctx), 1);
|
||||||
@ -2769,27 +2769,27 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
|
|||||||
case MP_CMD_TV_SET_FREQ:
|
case MP_CMD_TV_SET_FREQ:
|
||||||
if (get_tvh(mpctx))
|
if (get_tvh(mpctx))
|
||||||
tv_set_freq(get_tvh(mpctx), cmd->args[0].v.f * 16.0);
|
tv_set_freq(get_tvh(mpctx), cmd->args[0].v.f * 16.0);
|
||||||
#ifdef CONFIG_PVR
|
#if HAVE_PVR
|
||||||
else if (mpctx->stream && mpctx->stream->type == STREAMTYPE_PVR) {
|
else if (mpctx->stream && mpctx->stream->type == STREAMTYPE_PVR) {
|
||||||
pvr_set_freq(mpctx->stream, ROUND(cmd->args[0].v.f));
|
pvr_set_freq(mpctx->stream, ROUND(cmd->args[0].v.f));
|
||||||
set_osd_msg(mpctx, OSD_MSG_TV_CHANNEL, osdl, osd_duration, "%s: %s",
|
set_osd_msg(mpctx, OSD_MSG_TV_CHANNEL, osdl, osd_duration, "%s: %s",
|
||||||
pvr_get_current_channelname(mpctx->stream),
|
pvr_get_current_channelname(mpctx->stream),
|
||||||
pvr_get_current_stationname(mpctx->stream));
|
pvr_get_current_stationname(mpctx->stream));
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_PVR */
|
#endif /* HAVE_PVR */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MP_CMD_TV_STEP_FREQ:
|
case MP_CMD_TV_STEP_FREQ:
|
||||||
if (get_tvh(mpctx))
|
if (get_tvh(mpctx))
|
||||||
tv_step_freq(get_tvh(mpctx), cmd->args[0].v.f * 16.0);
|
tv_step_freq(get_tvh(mpctx), cmd->args[0].v.f * 16.0);
|
||||||
#ifdef CONFIG_PVR
|
#if HAVE_PVR
|
||||||
else if (mpctx->stream && mpctx->stream->type == STREAMTYPE_PVR) {
|
else if (mpctx->stream && mpctx->stream->type == STREAMTYPE_PVR) {
|
||||||
pvr_force_freq_step(mpctx->stream, ROUND(cmd->args[0].v.f));
|
pvr_force_freq_step(mpctx->stream, ROUND(cmd->args[0].v.f));
|
||||||
set_osd_msg(mpctx, OSD_MSG_TV_CHANNEL, osdl, osd_duration, "%s: f %d",
|
set_osd_msg(mpctx, OSD_MSG_TV_CHANNEL, osdl, osd_duration, "%s: f %d",
|
||||||
pvr_get_current_channelname(mpctx->stream),
|
pvr_get_current_channelname(mpctx->stream),
|
||||||
pvr_get_current_frequency(mpctx->stream));
|
pvr_get_current_frequency(mpctx->stream));
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_PVR */
|
#endif /* HAVE_PVR */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MP_CMD_TV_SET_NORM:
|
case MP_CMD_TV_SET_NORM:
|
||||||
@ -2810,7 +2810,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
|
|||||||
"Channel: %s", tv_channel_current->name);
|
"Channel: %s", tv_channel_current->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef CONFIG_PVR
|
#if HAVE_PVR
|
||||||
else if (mpctx->stream &&
|
else if (mpctx->stream &&
|
||||||
mpctx->stream->type == STREAMTYPE_PVR) {
|
mpctx->stream->type == STREAMTYPE_PVR) {
|
||||||
pvr_set_channel_step(mpctx->stream, cmd->args[0].v.i);
|
pvr_set_channel_step(mpctx->stream, cmd->args[0].v.i);
|
||||||
@ -2818,8 +2818,8 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
|
|||||||
pvr_get_current_channelname(mpctx->stream),
|
pvr_get_current_channelname(mpctx->stream),
|
||||||
pvr_get_current_stationname(mpctx->stream));
|
pvr_get_current_stationname(mpctx->stream));
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_PVR */
|
#endif /* HAVE_PVR */
|
||||||
#ifdef CONFIG_DVBIN
|
#if HAVE_DVBIN
|
||||||
if (mpctx->stream->type == STREAMTYPE_DVB) {
|
if (mpctx->stream->type == STREAMTYPE_DVB) {
|
||||||
int dir;
|
int dir;
|
||||||
int v = cmd->args[0].v.i;
|
int v = cmd->args[0].v.i;
|
||||||
@ -2836,7 +2836,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
|
|||||||
mpctx->dvbin_reopen = 1;
|
mpctx->dvbin_reopen = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_DVBIN */
|
#endif /* HAVE_DVBIN */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MP_CMD_TV_SET_CHANNEL:
|
case MP_CMD_TV_SET_CHANNEL:
|
||||||
@ -2847,17 +2847,17 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
|
|||||||
"Channel: %s", tv_channel_current->name);
|
"Channel: %s", tv_channel_current->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef CONFIG_PVR
|
#if HAVE_PVR
|
||||||
else if (mpctx->stream && mpctx->stream->type == STREAMTYPE_PVR) {
|
else if (mpctx->stream && mpctx->stream->type == STREAMTYPE_PVR) {
|
||||||
pvr_set_channel(mpctx->stream, cmd->args[0].v.s);
|
pvr_set_channel(mpctx->stream, cmd->args[0].v.s);
|
||||||
set_osd_msg(mpctx, OSD_MSG_TV_CHANNEL, osdl, osd_duration, "%s: %s",
|
set_osd_msg(mpctx, OSD_MSG_TV_CHANNEL, osdl, osd_duration, "%s: %s",
|
||||||
pvr_get_current_channelname(mpctx->stream),
|
pvr_get_current_channelname(mpctx->stream),
|
||||||
pvr_get_current_stationname(mpctx->stream));
|
pvr_get_current_stationname(mpctx->stream));
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_PVR */
|
#endif /* HAVE_PVR */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef CONFIG_DVBIN
|
#if HAVE_DVBIN
|
||||||
case MP_CMD_DVB_SET_CHANNEL:
|
case MP_CMD_DVB_SET_CHANNEL:
|
||||||
if (mpctx->stream->type == STREAMTYPE_DVB) {
|
if (mpctx->stream->type == STREAMTYPE_DVB) {
|
||||||
mpctx->last_dvb_step = 1;
|
mpctx->last_dvb_step = 1;
|
||||||
@ -2869,7 +2869,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif /* CONFIG_DVBIN */
|
#endif /* HAVE_DVBIN */
|
||||||
|
|
||||||
case MP_CMD_TV_LAST_CHANNEL:
|
case MP_CMD_TV_LAST_CHANNEL:
|
||||||
if (get_tvh(mpctx)) {
|
if (get_tvh(mpctx)) {
|
||||||
@ -2879,14 +2879,14 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
|
|||||||
"Channel: %s", tv_channel_current->name);
|
"Channel: %s", tv_channel_current->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef CONFIG_PVR
|
#if HAVE_PVR
|
||||||
else if (mpctx->stream && mpctx->stream->type == STREAMTYPE_PVR) {
|
else if (mpctx->stream && mpctx->stream->type == STREAMTYPE_PVR) {
|
||||||
pvr_set_lastchannel(mpctx->stream);
|
pvr_set_lastchannel(mpctx->stream);
|
||||||
set_osd_msg(mpctx, OSD_MSG_TV_CHANNEL, osdl, osd_duration, "%s: %s",
|
set_osd_msg(mpctx, OSD_MSG_TV_CHANNEL, osdl, osd_duration, "%s: %s",
|
||||||
pvr_get_current_channelname(mpctx->stream),
|
pvr_get_current_channelname(mpctx->stream),
|
||||||
pvr_get_current_stationname(mpctx->stream));
|
pvr_get_current_stationname(mpctx->stream));
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_PVR */
|
#endif /* HAVE_PVR */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MP_CMD_TV_STEP_NORM:
|
case MP_CMD_TV_STEP_NORM:
|
||||||
@ -2898,7 +2898,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
|
|||||||
if (get_tvh(mpctx))
|
if (get_tvh(mpctx))
|
||||||
tv_step_chanlist(get_tvh(mpctx));
|
tv_step_chanlist(get_tvh(mpctx));
|
||||||
break;
|
break;
|
||||||
#endif /* CONFIG_TV */
|
#endif /* HAVE_TV */
|
||||||
|
|
||||||
case MP_CMD_SUB_ADD:
|
case MP_CMD_SUB_ADD:
|
||||||
mp_add_subtitles(mpctx, cmd->args[0].v.s);
|
mp_add_subtitles(mpctx, cmd->args[0].v.s);
|
||||||
@ -2978,14 +2978,14 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
|
|||||||
|
|
||||||
case MP_CMD_SCRIPT_DISPATCH:
|
case MP_CMD_SCRIPT_DISPATCH:
|
||||||
if (mpctx->lua_ctx) {
|
if (mpctx->lua_ctx) {
|
||||||
#ifdef CONFIG_LUA
|
#if HAVE_LUA
|
||||||
mp_lua_script_dispatch(mpctx, cmd->args[0].v.s, cmd->args[1].v.i,
|
mp_lua_script_dispatch(mpctx, cmd->args[0].v.s, cmd->args[1].v.i,
|
||||||
cmd->key_up_follows ? "keyup_follows" : "press");
|
cmd->key_up_follows ? "keyup_follows" : "press");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef HAVE_SYS_MMAN_H
|
#if HAVE_SYS_MMAN_H
|
||||||
case MP_CMD_OVERLAY_ADD:
|
case MP_CMD_OVERLAY_ADD:
|
||||||
overlay_add(mpctx,
|
overlay_add(mpctx,
|
||||||
cmd->args[0].v.i, cmd->args[1].v.i, cmd->args[2].v.i,
|
cmd->args[0].v.i, cmd->args[1].v.i, cmd->args[2].v.i,
|
||||||
@ -3052,7 +3052,7 @@ void mp_notify(struct MPContext *mpctx, enum mp_event event, void *arg)
|
|||||||
static void handle_script_event(struct MPContext *mpctx, const char *name,
|
static void handle_script_event(struct MPContext *mpctx, const char *name,
|
||||||
const char *arg)
|
const char *arg)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_LUA
|
#if HAVE_LUA
|
||||||
mp_lua_event(mpctx, name, arg);
|
mp_lua_event(mpctx, name, arg);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -202,11 +202,11 @@ char *mp_get_playback_resume_config_filename(const char *fname,
|
|||||||
goto exit;
|
goto exit;
|
||||||
realpath = mp_path_join(tmp, bstr0(cwd), bstr0(fname));
|
realpath = mp_path_join(tmp, bstr0(cwd), bstr0(fname));
|
||||||
}
|
}
|
||||||
#ifdef CONFIG_DVDREAD
|
#if HAVE_DVDREAD
|
||||||
if (bstr_startswith0(bfname, "dvd://"))
|
if (bstr_startswith0(bfname, "dvd://"))
|
||||||
realpath = talloc_asprintf(tmp, "%s - %s", realpath, dvd_device);
|
realpath = talloc_asprintf(tmp, "%s - %s", realpath, dvd_device);
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_LIBBLURAY
|
#if HAVE_LIBBLURAY
|
||||||
if (bstr_startswith0(bfname, "br://") || bstr_startswith0(bfname, "bd://") ||
|
if (bstr_startswith0(bfname, "br://") || bstr_startswith0(bfname, "bd://") ||
|
||||||
bstr_startswith0(bfname, "bluray://"))
|
bstr_startswith0(bfname, "bluray://"))
|
||||||
realpath = talloc_asprintf(tmp, "%s - %s", realpath, bluray_device);
|
realpath = talloc_asprintf(tmp, "%s - %s", realpath, bluray_device);
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
#include "mp_core.h"
|
#include "mp_core.h"
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
|
|
||||||
#ifdef CONFIG_DVBIN
|
#if HAVE_DVBIN
|
||||||
#include "stream/dvbin.h"
|
#include "stream/dvbin.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -85,7 +85,7 @@ void uninit_player(struct MPContext *mpctx, unsigned int mask)
|
|||||||
|
|
||||||
if (mask & INITIALIZED_LIBASS) {
|
if (mask & INITIALIZED_LIBASS) {
|
||||||
mpctx->initialized_flags &= ~INITIALIZED_LIBASS;
|
mpctx->initialized_flags &= ~INITIALIZED_LIBASS;
|
||||||
#ifdef CONFIG_ASS
|
#if HAVE_LIBASS
|
||||||
if (mpctx->osd->ass_renderer)
|
if (mpctx->osd->ass_renderer)
|
||||||
ass_renderer_done(mpctx->osd->ass_renderer);
|
ass_renderer_done(mpctx->osd->ass_renderer);
|
||||||
mpctx->osd->ass_renderer = NULL;
|
mpctx->osd->ass_renderer = NULL;
|
||||||
@ -472,7 +472,7 @@ void add_demuxer_tracks(struct MPContext *mpctx, struct demuxer *demuxer)
|
|||||||
|
|
||||||
static void add_dvd_tracks(struct MPContext *mpctx)
|
static void add_dvd_tracks(struct MPContext *mpctx)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_DVDREAD
|
#if HAVE_DVDREAD
|
||||||
struct demuxer *demuxer = mpctx->demuxer;
|
struct demuxer *demuxer = mpctx->demuxer;
|
||||||
struct stream *stream = demuxer->stream;
|
struct stream *stream = demuxer->stream;
|
||||||
struct stream_dvd_info_req info;
|
struct stream_dvd_info_req info;
|
||||||
@ -818,7 +818,7 @@ static bool attachment_is_font(struct demux_attachment *att)
|
|||||||
|
|
||||||
static void add_subtitle_fonts_from_sources(struct MPContext *mpctx)
|
static void add_subtitle_fonts_from_sources(struct MPContext *mpctx)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_ASS
|
#if HAVE_LIBASS
|
||||||
if (mpctx->opts->ass_enabled) {
|
if (mpctx->opts->ass_enabled) {
|
||||||
for (int j = 0; j < mpctx->num_sources; j++) {
|
for (int j = 0; j < mpctx->num_sources; j++) {
|
||||||
struct demuxer *d = mpctx->sources[j];
|
struct demuxer *d = mpctx->sources[j];
|
||||||
@ -835,7 +835,7 @@ static void add_subtitle_fonts_from_sources(struct MPContext *mpctx)
|
|||||||
|
|
||||||
static void init_sub_renderer(struct MPContext *mpctx)
|
static void init_sub_renderer(struct MPContext *mpctx)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_ASS
|
#if HAVE_LIBASS
|
||||||
assert(!(mpctx->initialized_flags & INITIALIZED_LIBASS));
|
assert(!(mpctx->initialized_flags & INITIALIZED_LIBASS));
|
||||||
assert(!mpctx->osd->ass_renderer);
|
assert(!mpctx->osd->ass_renderer);
|
||||||
|
|
||||||
@ -853,7 +853,7 @@ static struct mp_resolve_result *resolve_url(const char *filename,
|
|||||||
{
|
{
|
||||||
if (!mp_is_url(bstr0(filename)))
|
if (!mp_is_url(bstr0(filename)))
|
||||||
return NULL;
|
return NULL;
|
||||||
#if defined(CONFIG_LIBQUVI) || defined(CONFIG_LIBQUVI9)
|
#if HAVE_LIBQUVI4 || HAVE_LIBQUVI9
|
||||||
return mp_resolve_quvi(filename, opts);
|
return mp_resolve_quvi(filename, opts);
|
||||||
#else
|
#else
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -979,7 +979,7 @@ static void play_current_file(struct MPContext *mpctx)
|
|||||||
if (!mpctx->filename)
|
if (!mpctx->filename)
|
||||||
goto terminate_playback;
|
goto terminate_playback;
|
||||||
|
|
||||||
#ifdef CONFIG_ENCODING
|
#if HAVE_ENCODING
|
||||||
encode_lavc_discontinuity(mpctx->encode_lavc_ctx);
|
encode_lavc_discontinuity(mpctx->encode_lavc_ctx);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1026,7 +1026,7 @@ static void play_current_file(struct MPContext *mpctx)
|
|||||||
MP_DBG(mpctx, "\n[[[init getch2]]]\n");
|
MP_DBG(mpctx, "\n[[[init getch2]]]\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_ASS
|
#if HAVE_LIBASS
|
||||||
if (opts->ass_style_override)
|
if (opts->ass_style_override)
|
||||||
ass_set_style_overrides(mpctx->ass_library, opts->ass_force_style_list);
|
ass_set_style_overrides(mpctx->ass_library, opts->ass_force_style_list);
|
||||||
#endif
|
#endif
|
||||||
@ -1077,7 +1077,7 @@ static void play_current_file(struct MPContext *mpctx)
|
|||||||
|
|
||||||
stream_set_capture_file(mpctx->stream, opts->stream_capture);
|
stream_set_capture_file(mpctx->stream, opts->stream_capture);
|
||||||
|
|
||||||
#ifdef CONFIG_DVBIN
|
#if HAVE_DVBIN
|
||||||
goto_reopen_demuxer: ;
|
goto_reopen_demuxer: ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1164,7 +1164,7 @@ goto_reopen_demuxer: ;
|
|||||||
|
|
||||||
preselect_demux_streams(mpctx);
|
preselect_demux_streams(mpctx);
|
||||||
|
|
||||||
#ifdef CONFIG_ENCODING
|
#if HAVE_ENCODING
|
||||||
if (mpctx->encode_lavc_ctx && mpctx->current_track[STREAM_VIDEO])
|
if (mpctx->encode_lavc_ctx && mpctx->current_track[STREAM_VIDEO])
|
||||||
encode_lavc_expect_stream(mpctx->encode_lavc_ctx, AVMEDIA_TYPE_VIDEO);
|
encode_lavc_expect_stream(mpctx->encode_lavc_ctx, AVMEDIA_TYPE_VIDEO);
|
||||||
if (mpctx->encode_lavc_ctx && mpctx->current_track[STREAM_AUDIO])
|
if (mpctx->encode_lavc_ctx && mpctx->current_track[STREAM_AUDIO])
|
||||||
@ -1186,7 +1186,7 @@ goto_reopen_demuxer: ;
|
|||||||
|
|
||||||
if (!mpctx->sh_video && !mpctx->sh_audio) {
|
if (!mpctx->sh_video && !mpctx->sh_audio) {
|
||||||
MP_FATAL(mpctx, "No video or audio streams selected.\n");
|
MP_FATAL(mpctx, "No video or audio streams selected.\n");
|
||||||
#ifdef CONFIG_DVBIN
|
#if HAVE_DVBIN
|
||||||
if (mpctx->stream->type == STREAMTYPE_DVB) {
|
if (mpctx->stream->type == STREAMTYPE_DVB) {
|
||||||
int dir;
|
int dir;
|
||||||
int v = mpctx->last_dvb_step;
|
int v = mpctx->last_dvb_step;
|
||||||
@ -1262,7 +1262,7 @@ goto_reopen_demuxer: ;
|
|||||||
|
|
||||||
MP_VERBOSE(mpctx, "EOF code: %d \n", mpctx->stop_play);
|
MP_VERBOSE(mpctx, "EOF code: %d \n", mpctx->stop_play);
|
||||||
|
|
||||||
#ifdef CONFIG_DVBIN
|
#if HAVE_DVBIN
|
||||||
if (mpctx->dvbin_reopen) {
|
if (mpctx->dvbin_reopen) {
|
||||||
mpctx->stop_play = 0;
|
mpctx->stop_play = 0;
|
||||||
uninit_player(mpctx, INITIALIZED_ALL - (INITIALIZED_STREAM | INITIALIZED_GETCH2 | (opts->fixed_vo ? INITIALIZED_VO : 0)));
|
uninit_player(mpctx, INITIALIZED_ALL - (INITIALIZED_STREAM | INITIALIZED_GETCH2 | (opts->fixed_vo ? INITIALIZED_VO : 0)));
|
||||||
|
@ -64,11 +64,11 @@
|
|||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "screenshot.h"
|
#include "screenshot.h"
|
||||||
|
|
||||||
#ifdef CONFIG_X11
|
#if HAVE_X11
|
||||||
#include "video/out/x11_common.h"
|
#include "video/out/x11_common.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_COCOA
|
#if HAVE_COCOA
|
||||||
#include "osdep/macosx_application.h"
|
#include "osdep/macosx_application.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -109,14 +109,14 @@ static MP_NORETURN void exit_player(struct MPContext *mpctx,
|
|||||||
int rc;
|
int rc;
|
||||||
uninit_player(mpctx, INITIALIZED_ALL);
|
uninit_player(mpctx, INITIALIZED_ALL);
|
||||||
|
|
||||||
#ifdef CONFIG_ENCODING
|
#if HAVE_ENCODING
|
||||||
encode_lavc_finish(mpctx->encode_lavc_ctx);
|
encode_lavc_finish(mpctx->encode_lavc_ctx);
|
||||||
encode_lavc_free(mpctx->encode_lavc_ctx);
|
encode_lavc_free(mpctx->encode_lavc_ctx);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mpctx->encode_lavc_ctx = NULL;
|
mpctx->encode_lavc_ctx = NULL;
|
||||||
|
|
||||||
#ifdef CONFIG_LUA
|
#if HAVE_LUA
|
||||||
mp_lua_uninit(mpctx);
|
mp_lua_uninit(mpctx);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -124,7 +124,7 @@ static MP_NORETURN void exit_player(struct MPContext *mpctx,
|
|||||||
timeEndPeriod(1);
|
timeEndPeriod(1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_COCOA
|
#if HAVE_COCOA
|
||||||
cocoa_set_input_context(NULL);
|
cocoa_set_input_context(NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -134,7 +134,7 @@ static MP_NORETURN void exit_player(struct MPContext *mpctx,
|
|||||||
|
|
||||||
osd_free(mpctx->osd);
|
osd_free(mpctx->osd);
|
||||||
|
|
||||||
#ifdef CONFIG_ASS
|
#if HAVE_LIBASS
|
||||||
ass_library_done(mpctx->ass_library);
|
ass_library_done(mpctx->ass_library);
|
||||||
mpctx->ass_library = NULL;
|
mpctx->ass_library = NULL;
|
||||||
#endif
|
#endif
|
||||||
@ -179,7 +179,7 @@ static MP_NORETURN void exit_player(struct MPContext *mpctx,
|
|||||||
mp_msg_uninit(mpctx->global);
|
mp_msg_uninit(mpctx->global);
|
||||||
talloc_free(mpctx);
|
talloc_free(mpctx);
|
||||||
|
|
||||||
#ifdef CONFIG_COCOA
|
#if HAVE_COCOA
|
||||||
terminate_cocoa_application();
|
terminate_cocoa_application();
|
||||||
// never reach here:
|
// never reach here:
|
||||||
// terminate calls exit itself, just silence compiler warning
|
// terminate calls exit itself, just silence compiler warning
|
||||||
@ -205,7 +205,7 @@ static bool handle_help_options(struct MPContext *mpctx)
|
|||||||
talloc_free(list);
|
talloc_free(list);
|
||||||
opt_exit = 1;
|
opt_exit = 1;
|
||||||
}
|
}
|
||||||
#ifdef CONFIG_X11
|
#if HAVE_X11
|
||||||
if (opts->vo.fstype_list && strcmp(opts->vo.fstype_list[0], "help") == 0) {
|
if (opts->vo.fstype_list && strcmp(opts->vo.fstype_list[0], "help") == 0) {
|
||||||
fstype_help();
|
fstype_help();
|
||||||
mp_msg(MSGT_FIXME, MSGL_FIXME, "\n");
|
mp_msg(MSGT_FIXME, MSGL_FIXME, "\n");
|
||||||
@ -223,7 +223,7 @@ static bool handle_help_options(struct MPContext *mpctx)
|
|||||||
property_print_help();
|
property_print_help();
|
||||||
opt_exit = 1;
|
opt_exit = 1;
|
||||||
}
|
}
|
||||||
#ifdef CONFIG_ENCODING
|
#if HAVE_ENCODING
|
||||||
if (encode_lavc_showhelp(mpctx->opts))
|
if (encode_lavc_showhelp(mpctx->opts))
|
||||||
opt_exit = 1;
|
opt_exit = 1;
|
||||||
#endif
|
#endif
|
||||||
@ -284,7 +284,7 @@ static void init_input(struct MPContext *mpctx)
|
|||||||
// Set the libstream interrupt callback
|
// Set the libstream interrupt callback
|
||||||
stream_set_interrupt_callback(mp_input_check_interrupt, mpctx->input);
|
stream_set_interrupt_callback(mp_input_check_interrupt, mpctx->input);
|
||||||
|
|
||||||
#ifdef CONFIG_COCOA
|
#if HAVE_COCOA
|
||||||
cocoa_set_input_context(mpctx->input);
|
cocoa_set_input_context(mpctx->input);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -366,13 +366,13 @@ static int mpv_main(int argc, char *argv[])
|
|||||||
exit_player(mpctx, EXIT_NONE);
|
exit_player(mpctx, EXIT_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PRIORITY
|
#if HAVE_PRIORITY
|
||||||
set_priority();
|
set_priority();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
init_input(mpctx);
|
init_input(mpctx);
|
||||||
|
|
||||||
#ifdef CONFIG_ENCODING
|
#if HAVE_ENCODING
|
||||||
if (opts->encode_output.file && *opts->encode_output.file) {
|
if (opts->encode_output.file && *opts->encode_output.file) {
|
||||||
mpctx->encode_lavc_ctx = encode_lavc_init(&opts->encode_output);
|
mpctx->encode_lavc_ctx = encode_lavc_init(&opts->encode_output);
|
||||||
if(!mpctx->encode_lavc_ctx) {
|
if(!mpctx->encode_lavc_ctx) {
|
||||||
@ -388,7 +388,7 @@ static int mpv_main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_ASS
|
#if HAVE_LIBASS
|
||||||
mpctx->ass_library = mp_ass_init(opts);
|
mpctx->ass_library = mp_ass_init(opts);
|
||||||
#else
|
#else
|
||||||
MP_WARN(mpctx, "Compiled without libass.\n");
|
MP_WARN(mpctx, "Compiled without libass.\n");
|
||||||
@ -410,7 +410,7 @@ static int mpv_main(int argc, char *argv[])
|
|||||||
mpctx->initialized_flags |= INITIALIZED_VO;
|
mpctx->initialized_flags |= INITIALIZED_VO;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_LUA
|
#if HAVE_LUA
|
||||||
// Lua user scripts can call arbitrary functions. Load them at a point
|
// Lua user scripts can call arbitrary functions. Load them at a point
|
||||||
// where this is safe.
|
// where this is safe.
|
||||||
mp_lua_init(mpctx);
|
mp_lua_init(mpctx);
|
||||||
@ -432,7 +432,7 @@ static int mpv_main(int argc, char *argv[])
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_COCOA
|
#if HAVE_COCOA
|
||||||
return cocoa_main(mpv_main, argc, argv);
|
return cocoa_main(mpv_main, argc, argv);
|
||||||
#else
|
#else
|
||||||
return mpv_main(argc, argv);
|
return mpv_main(argc, argv);
|
||||||
|
@ -24,13 +24,13 @@
|
|||||||
// All these are generated from mpvcore/lua/*.lua
|
// All these are generated from mpvcore/lua/*.lua
|
||||||
static const char *builtin_lua_scripts[][2] = {
|
static const char *builtin_lua_scripts[][2] = {
|
||||||
{"mp.defaults",
|
{"mp.defaults",
|
||||||
# include "lua/defaults.inc"
|
# include "mpvcore/player/lua/defaults.inc"
|
||||||
},
|
},
|
||||||
{"mp.assdraw",
|
{"mp.assdraw",
|
||||||
# include "lua/assdraw.inc"
|
# include "mpvcore/player/lua/assdraw.inc"
|
||||||
},
|
},
|
||||||
{"@osc",
|
{"@osc",
|
||||||
# include "lua/osc.inc"
|
# include "mpvcore/player/lua/osc.inc"
|
||||||
},
|
},
|
||||||
{0}
|
{0}
|
||||||
};
|
};
|
||||||
|
@ -140,7 +140,7 @@ void print_status(struct MPContext *mpctx)
|
|||||||
saddf(&line, " ct:%7.3f", mpctx->total_avsync_change);
|
saddf(&line, " ct:%7.3f", mpctx->total_avsync_change);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_ENCODING
|
#if HAVE_ENCODING
|
||||||
double position = get_current_pos_ratio(mpctx, true);
|
double position = get_current_pos_ratio(mpctx, true);
|
||||||
char lavcbuf[80];
|
char lavcbuf[80];
|
||||||
if (encode_lavc_getstatus(mpctx->encode_lavc_ctx, lavcbuf, sizeof(lavcbuf),
|
if (encode_lavc_getstatus(mpctx->encode_lavc_ctx, lavcbuf, sizeof(lavcbuf),
|
||||||
|
@ -200,7 +200,7 @@ static void seek_reset(struct MPContext *mpctx, bool reset_ao, bool reset_ac)
|
|||||||
mpctx->dropped_frames = 0;
|
mpctx->dropped_frames = 0;
|
||||||
mpctx->playback_pts = MP_NOPTS_VALUE;
|
mpctx->playback_pts = MP_NOPTS_VALUE;
|
||||||
|
|
||||||
#ifdef CONFIG_ENCODING
|
#if HAVE_ENCODING
|
||||||
encode_lavc_discontinuity(mpctx->encode_lavc_ctx);
|
encode_lavc_discontinuity(mpctx->encode_lavc_ctx);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -942,7 +942,7 @@ void run_playloop(struct MPContext *mpctx)
|
|||||||
bool was_restart = mpctx->restart_playback;
|
bool was_restart = mpctx->restart_playback;
|
||||||
bool new_frame_shown = false;
|
bool new_frame_shown = false;
|
||||||
|
|
||||||
#ifdef CONFIG_ENCODING
|
#if HAVE_ENCODING
|
||||||
if (encode_lavc_didfail(mpctx->encode_lavc_ctx)) {
|
if (encode_lavc_didfail(mpctx->encode_lavc_ctx)) {
|
||||||
mpctx->stop_play = PT_QUIT;
|
mpctx->stop_play = PT_QUIT;
|
||||||
return;
|
return;
|
||||||
|
@ -129,7 +129,7 @@ void update_subtitles(struct MPContext *mpctx)
|
|||||||
static void set_dvdsub_fake_extradata(struct dec_sub *dec_sub, struct stream *st,
|
static void set_dvdsub_fake_extradata(struct dec_sub *dec_sub, struct stream *st,
|
||||||
int width, int height)
|
int width, int height)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_DVDREAD
|
#if HAVE_DVDREAD
|
||||||
if (!st)
|
if (!st)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
|
|
||||||
void update_fps(struct MPContext *mpctx)
|
void update_fps(struct MPContext *mpctx)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_ENCODING
|
#if HAVE_ENCODING
|
||||||
struct sh_video *sh_video = mpctx->sh_video;
|
struct sh_video *sh_video = mpctx->sh_video;
|
||||||
if (mpctx->encode_lavc_ctx && sh_video)
|
if (mpctx->encode_lavc_ctx && sh_video)
|
||||||
encode_lavc_set_video_fps(mpctx->encode_lavc_ctx, sh_video->fps);
|
encode_lavc_set_video_fps(mpctx->encode_lavc_ctx, sh_video->fps);
|
||||||
|
@ -30,11 +30,11 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
|
||||||
#ifdef HAVE_TERMIOS
|
#if HAVE_TERMIOS
|
||||||
#ifdef HAVE_TERMIOS_H
|
#if HAVE_TERMIOS_H
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_TERMIOS_H
|
#if HAVE_SYS_TERMIOS_H
|
||||||
#include <sys/termios.h>
|
#include <sys/termios.h>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@ -47,7 +47,7 @@
|
|||||||
#include "mpvcore/input/keycodes.h"
|
#include "mpvcore/input/keycodes.h"
|
||||||
#include "getch2.h"
|
#include "getch2.h"
|
||||||
|
|
||||||
#ifdef HAVE_TERMIOS
|
#if HAVE_TERMIOS
|
||||||
static volatile struct termios tio_orig;
|
static volatile struct termios tio_orig;
|
||||||
static volatile int tio_orig_set;
|
static volatile int tio_orig_set;
|
||||||
#endif
|
#endif
|
||||||
@ -71,12 +71,13 @@ typedef struct {
|
|||||||
|
|
||||||
static keycode_map getch2_keys;
|
static keycode_map getch2_keys;
|
||||||
|
|
||||||
#ifdef HAVE_TERMCAP
|
#if HAVE_TERMINFO || HAVE_TERMCAP
|
||||||
|
|
||||||
|
|
||||||
static char *term_rmkx = NULL;
|
static char *term_rmkx = NULL;
|
||||||
static char *term_smkx = NULL;
|
static char *term_smkx = NULL;
|
||||||
|
|
||||||
#ifdef HAVE_TERMINFO
|
#if HAVE_TERMINFO
|
||||||
#include <curses.h>
|
#include <curses.h>
|
||||||
#endif
|
#endif
|
||||||
#include <term.h>
|
#include <term.h>
|
||||||
@ -138,7 +139,7 @@ static keycode_st* keys_push_once(char *p, int code) {
|
|||||||
return st;
|
return st;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_TERMCAP
|
#if HAVE_TERMINFO || HAVE_TERMCAP
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *buf;
|
char *buf;
|
||||||
@ -228,9 +229,9 @@ static void termcap_add_extra_f_keys(void) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
int load_termcap(char *termtype){
|
int load_termcap(char *termtype){
|
||||||
#ifdef HAVE_TERMCAP
|
#if HAVE_TERMINFO || HAVE_TERMCAP
|
||||||
|
|
||||||
#ifdef HAVE_TERMINFO
|
#if HAVE_TERMINFO
|
||||||
use_env(TRUE);
|
use_env(TRUE);
|
||||||
int ret;
|
int ret;
|
||||||
if (setupterm(termtype, 1, &ret) != OK) {
|
if (setupterm(termtype, 1, &ret) != OK) {
|
||||||
@ -445,12 +446,12 @@ static void do_activate_getch2(void)
|
|||||||
if (getch2_active)
|
if (getch2_active)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef HAVE_TERMCAP
|
#if HAVE_TERMINFO || HAVE_TERMCAP
|
||||||
if (term_smkx)
|
if (term_smkx)
|
||||||
tputs(term_smkx, 1, putchar);
|
tputs(term_smkx, 1, putchar);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_TERMIOS
|
#if HAVE_TERMIOS
|
||||||
struct termios tio_new;
|
struct termios tio_new;
|
||||||
tcgetattr(0,&tio_new);
|
tcgetattr(0,&tio_new);
|
||||||
|
|
||||||
@ -473,12 +474,12 @@ static void do_deactivate_getch2(void)
|
|||||||
if (!getch2_active)
|
if (!getch2_active)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef HAVE_TERMCAP
|
#if HAVE_TERMINFO || HAVE_TERMCAP
|
||||||
if (term_rmkx)
|
if (term_rmkx)
|
||||||
tputs(term_rmkx, 1, putchar);
|
tputs(term_rmkx, 1, putchar);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_TERMIOS
|
#if HAVE_TERMIOS
|
||||||
if (tio_orig_set) {
|
if (tio_orig_set) {
|
||||||
// once set, it will never be set again
|
// once set, it will never be set again
|
||||||
// so we can cast away volatile here
|
// so we can cast away volatile here
|
||||||
|
@ -58,7 +58,7 @@ char *mp_to_utf8(void *talloc_ctx, const wchar_t *s)
|
|||||||
#include <io.h>
|
#include <io.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
||||||
#ifdef HAVE_PTHREADS
|
#if HAVE_PTHREADS
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -298,7 +298,7 @@ static void init_getenv(void)
|
|||||||
|
|
||||||
char *mp_getenv(const char *name)
|
char *mp_getenv(const char *name)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_PTHREADS
|
#if HAVE_PTHREADS
|
||||||
static pthread_once_t once_init_getenv = PTHREAD_ONCE_INIT;
|
static pthread_once_t once_init_getenv = PTHREAD_ONCE_INIT;
|
||||||
pthread_once(&once_init_getenv, init_getenv);
|
pthread_once(&once_init_getenv, init_getenv);
|
||||||
#else
|
#else
|
||||||
|
@ -30,7 +30,7 @@ void mp_sleep_us(int64_t us)
|
|||||||
{
|
{
|
||||||
if (us < 0)
|
if (us < 0)
|
||||||
return;
|
return;
|
||||||
#ifdef HAVE_NANOSLEEP
|
#if HAVE_NANOSLEEP
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
ts.tv_sec = us / 1000000;
|
ts.tv_sec = us / 1000000;
|
||||||
ts.tv_nsec = (us % 1000000) * 1000;
|
ts.tv_nsec = (us % 1000000) * 1000;
|
||||||
|
@ -26,10 +26,10 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
|
||||||
#ifdef HAVE_SYS_SOUNDCARD_H
|
#if HAVE_SYS_SOUNDCARD_H
|
||||||
#include <sys/soundcard.h>
|
#include <sys/soundcard.h>
|
||||||
#else
|
#else
|
||||||
#ifdef HAVE_SOUNDCARD_H
|
#if HAVE_SOUNDCARD_H
|
||||||
#include <soundcard.h>
|
#include <soundcard.h>
|
||||||
#else
|
#else
|
||||||
#include <linux/soundcard.h>
|
#include <linux/soundcard.h>
|
||||||
|
@ -40,20 +40,20 @@ int audio_in_init(audio_in_t *ai, int type)
|
|||||||
ai->samplesize = -1;
|
ai->samplesize = -1;
|
||||||
|
|
||||||
switch (ai->type) {
|
switch (ai->type) {
|
||||||
#ifdef CONFIG_ALSA
|
#if HAVE_ALSA
|
||||||
case AUDIO_IN_ALSA:
|
case AUDIO_IN_ALSA:
|
||||||
ai->alsa.handle = NULL;
|
ai->alsa.handle = NULL;
|
||||||
ai->alsa.log = NULL;
|
ai->alsa.log = NULL;
|
||||||
ai->alsa.device = strdup("default");
|
ai->alsa.device = strdup("default");
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_OSS_AUDIO
|
#if HAVE_OSS_AUDIO
|
||||||
case AUDIO_IN_OSS:
|
case AUDIO_IN_OSS:
|
||||||
ai->oss.audio_fd = -1;
|
ai->oss.audio_fd = -1;
|
||||||
ai->oss.device = strdup("/dev/dsp");
|
ai->oss.device = strdup("/dev/dsp");
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_SNDIO
|
#if HAVE_SNDIO
|
||||||
case AUDIO_IN_SNDIO:
|
case AUDIO_IN_SNDIO:
|
||||||
ai->sndio.hdl = NULL;
|
ai->sndio.hdl = NULL;
|
||||||
ai->sndio.device = strdup("default");
|
ai->sndio.device = strdup("default");
|
||||||
@ -68,19 +68,19 @@ int audio_in_setup(audio_in_t *ai)
|
|||||||
{
|
{
|
||||||
|
|
||||||
switch (ai->type) {
|
switch (ai->type) {
|
||||||
#ifdef CONFIG_ALSA
|
#if HAVE_ALSA
|
||||||
case AUDIO_IN_ALSA:
|
case AUDIO_IN_ALSA:
|
||||||
if (ai_alsa_init(ai) < 0) return -1;
|
if (ai_alsa_init(ai) < 0) return -1;
|
||||||
ai->setup = 1;
|
ai->setup = 1;
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_OSS_AUDIO
|
#if HAVE_OSS_AUDIO
|
||||||
case AUDIO_IN_OSS:
|
case AUDIO_IN_OSS:
|
||||||
if (ai_oss_init(ai) < 0) return -1;
|
if (ai_oss_init(ai) < 0) return -1;
|
||||||
ai->setup = 1;
|
ai->setup = 1;
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_SNDIO
|
#if HAVE_SNDIO
|
||||||
case AUDIO_IN_SNDIO:
|
case AUDIO_IN_SNDIO:
|
||||||
if (ai_sndio_init(ai) < 0) return -1;
|
if (ai_sndio_init(ai) < 0) return -1;
|
||||||
ai->setup = 1;
|
ai->setup = 1;
|
||||||
@ -94,21 +94,21 @@ int audio_in_setup(audio_in_t *ai)
|
|||||||
int audio_in_set_samplerate(audio_in_t *ai, int rate)
|
int audio_in_set_samplerate(audio_in_t *ai, int rate)
|
||||||
{
|
{
|
||||||
switch (ai->type) {
|
switch (ai->type) {
|
||||||
#ifdef CONFIG_ALSA
|
#if HAVE_ALSA
|
||||||
case AUDIO_IN_ALSA:
|
case AUDIO_IN_ALSA:
|
||||||
ai->req_samplerate = rate;
|
ai->req_samplerate = rate;
|
||||||
if (!ai->setup) return 0;
|
if (!ai->setup) return 0;
|
||||||
if (ai_alsa_setup(ai) < 0) return -1;
|
if (ai_alsa_setup(ai) < 0) return -1;
|
||||||
return ai->samplerate;
|
return ai->samplerate;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_OSS_AUDIO
|
#if HAVE_OSS_AUDIO
|
||||||
case AUDIO_IN_OSS:
|
case AUDIO_IN_OSS:
|
||||||
ai->req_samplerate = rate;
|
ai->req_samplerate = rate;
|
||||||
if (!ai->setup) return 0;
|
if (!ai->setup) return 0;
|
||||||
if (ai_oss_set_samplerate(ai) < 0) return -1;
|
if (ai_oss_set_samplerate(ai) < 0) return -1;
|
||||||
return ai->samplerate;
|
return ai->samplerate;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_SNDIO
|
#if HAVE_SNDIO
|
||||||
case AUDIO_IN_SNDIO:
|
case AUDIO_IN_SNDIO:
|
||||||
ai->req_samplerate = rate;
|
ai->req_samplerate = rate;
|
||||||
if (!ai->setup) return 0;
|
if (!ai->setup) return 0;
|
||||||
@ -123,21 +123,21 @@ int audio_in_set_samplerate(audio_in_t *ai, int rate)
|
|||||||
int audio_in_set_channels(audio_in_t *ai, int channels)
|
int audio_in_set_channels(audio_in_t *ai, int channels)
|
||||||
{
|
{
|
||||||
switch (ai->type) {
|
switch (ai->type) {
|
||||||
#ifdef CONFIG_ALSA
|
#if HAVE_ALSA
|
||||||
case AUDIO_IN_ALSA:
|
case AUDIO_IN_ALSA:
|
||||||
ai->req_channels = channels;
|
ai->req_channels = channels;
|
||||||
if (!ai->setup) return 0;
|
if (!ai->setup) return 0;
|
||||||
if (ai_alsa_setup(ai) < 0) return -1;
|
if (ai_alsa_setup(ai) < 0) return -1;
|
||||||
return ai->channels;
|
return ai->channels;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_OSS_AUDIO
|
#if HAVE_OSS_AUDIO
|
||||||
case AUDIO_IN_OSS:
|
case AUDIO_IN_OSS:
|
||||||
ai->req_channels = channels;
|
ai->req_channels = channels;
|
||||||
if (!ai->setup) return 0;
|
if (!ai->setup) return 0;
|
||||||
if (ai_oss_set_channels(ai) < 0) return -1;
|
if (ai_oss_set_channels(ai) < 0) return -1;
|
||||||
return ai->channels;
|
return ai->channels;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_SNDIO
|
#if HAVE_SNDIO
|
||||||
case AUDIO_IN_SNDIO:
|
case AUDIO_IN_SNDIO:
|
||||||
ai->req_channels = channels;
|
ai->req_channels = channels;
|
||||||
if (!ai->setup) return 0;
|
if (!ai->setup) return 0;
|
||||||
@ -151,12 +151,12 @@ int audio_in_set_channels(audio_in_t *ai, int channels)
|
|||||||
|
|
||||||
int audio_in_set_device(audio_in_t *ai, char *device)
|
int audio_in_set_device(audio_in_t *ai, char *device)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_ALSA
|
#if HAVE_ALSA
|
||||||
int i;
|
int i;
|
||||||
#endif
|
#endif
|
||||||
if (ai->setup) return -1;
|
if (ai->setup) return -1;
|
||||||
switch (ai->type) {
|
switch (ai->type) {
|
||||||
#ifdef CONFIG_ALSA
|
#if HAVE_ALSA
|
||||||
case AUDIO_IN_ALSA:
|
case AUDIO_IN_ALSA:
|
||||||
free(ai->alsa.device);
|
free(ai->alsa.device);
|
||||||
ai->alsa.device = strdup(device);
|
ai->alsa.device = strdup(device);
|
||||||
@ -166,13 +166,13 @@ int audio_in_set_device(audio_in_t *ai, char *device)
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_OSS_AUDIO
|
#if HAVE_OSS_AUDIO
|
||||||
case AUDIO_IN_OSS:
|
case AUDIO_IN_OSS:
|
||||||
free(ai->oss.device);
|
free(ai->oss.device);
|
||||||
ai->oss.device = strdup(device);
|
ai->oss.device = strdup(device);
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_SNDIO
|
#if HAVE_SNDIO
|
||||||
case AUDIO_IN_SNDIO:
|
case AUDIO_IN_SNDIO:
|
||||||
if (ai->sndio.device) free(ai->sndio.device);
|
if (ai->sndio.device) free(ai->sndio.device);
|
||||||
ai->sndio.device = strdup(device);
|
ai->sndio.device = strdup(device);
|
||||||
@ -187,7 +187,7 @@ int audio_in_uninit(audio_in_t *ai)
|
|||||||
{
|
{
|
||||||
if (ai->setup) {
|
if (ai->setup) {
|
||||||
switch (ai->type) {
|
switch (ai->type) {
|
||||||
#ifdef CONFIG_ALSA
|
#if HAVE_ALSA
|
||||||
case AUDIO_IN_ALSA:
|
case AUDIO_IN_ALSA:
|
||||||
if (ai->alsa.log)
|
if (ai->alsa.log)
|
||||||
snd_output_close(ai->alsa.log);
|
snd_output_close(ai->alsa.log);
|
||||||
@ -197,13 +197,13 @@ int audio_in_uninit(audio_in_t *ai)
|
|||||||
ai->setup = 0;
|
ai->setup = 0;
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_OSS_AUDIO
|
#if HAVE_OSS_AUDIO
|
||||||
case AUDIO_IN_OSS:
|
case AUDIO_IN_OSS:
|
||||||
close(ai->oss.audio_fd);
|
close(ai->oss.audio_fd);
|
||||||
ai->setup = 0;
|
ai->setup = 0;
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_SNDIO
|
#if HAVE_SNDIO
|
||||||
case AUDIO_IN_SNDIO:
|
case AUDIO_IN_SNDIO:
|
||||||
if (ai->sndio.hdl)
|
if (ai->sndio.hdl)
|
||||||
sio_close(ai->sndio.hdl);
|
sio_close(ai->sndio.hdl);
|
||||||
@ -218,15 +218,15 @@ int audio_in_uninit(audio_in_t *ai)
|
|||||||
int audio_in_start_capture(audio_in_t *ai)
|
int audio_in_start_capture(audio_in_t *ai)
|
||||||
{
|
{
|
||||||
switch (ai->type) {
|
switch (ai->type) {
|
||||||
#ifdef CONFIG_ALSA
|
#if HAVE_ALSA
|
||||||
case AUDIO_IN_ALSA:
|
case AUDIO_IN_ALSA:
|
||||||
return snd_pcm_start(ai->alsa.handle);
|
return snd_pcm_start(ai->alsa.handle);
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_OSS_AUDIO
|
#if HAVE_OSS_AUDIO
|
||||||
case AUDIO_IN_OSS:
|
case AUDIO_IN_OSS:
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_SNDIO
|
#if HAVE_SNDIO
|
||||||
case AUDIO_IN_SNDIO:
|
case AUDIO_IN_SNDIO:
|
||||||
if (!sio_start(ai->sndio.hdl))
|
if (!sio_start(ai->sndio.hdl))
|
||||||
return -1;
|
return -1;
|
||||||
@ -242,7 +242,7 @@ int audio_in_read_chunk(audio_in_t *ai, unsigned char *buffer)
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
switch (ai->type) {
|
switch (ai->type) {
|
||||||
#ifdef CONFIG_ALSA
|
#if HAVE_ALSA
|
||||||
case AUDIO_IN_ALSA:
|
case AUDIO_IN_ALSA:
|
||||||
ret = snd_pcm_readi(ai->alsa.handle, buffer, ai->alsa.chunk_size);
|
ret = snd_pcm_readi(ai->alsa.handle, buffer, ai->alsa.chunk_size);
|
||||||
if (ret != ai->alsa.chunk_size) {
|
if (ret != ai->alsa.chunk_size) {
|
||||||
@ -262,7 +262,7 @@ int audio_in_read_chunk(audio_in_t *ai, unsigned char *buffer)
|
|||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_OSS_AUDIO
|
#if HAVE_OSS_AUDIO
|
||||||
case AUDIO_IN_OSS:
|
case AUDIO_IN_OSS:
|
||||||
ret = read(ai->oss.audio_fd, buffer, ai->blocksize);
|
ret = read(ai->oss.audio_fd, buffer, ai->blocksize);
|
||||||
if (ret != ai->blocksize) {
|
if (ret != ai->blocksize) {
|
||||||
@ -276,7 +276,7 @@ int audio_in_read_chunk(audio_in_t *ai, unsigned char *buffer)
|
|||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_SNDIO
|
#if HAVE_SNDIO
|
||||||
case AUDIO_IN_SNDIO:
|
case AUDIO_IN_SNDIO:
|
||||||
ret = sio_read(ai->sndio.hdl, buffer, ai->blocksize);
|
ret = sio_read(ai->sndio.hdl, buffer, ai->blocksize);
|
||||||
if (ret != ai->blocksize) {
|
if (ret != ai->blocksize) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#ifdef CONFIG_ALSA
|
#if HAVE_ALSA
|
||||||
#include <alsa/asoundlib.h>
|
#include <alsa/asoundlib.h>
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@ -38,7 +38,7 @@ typedef struct {
|
|||||||
} ai_alsa_t;
|
} ai_alsa_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_OSS_AUDIO
|
#if HAVE_OSS_AUDIO
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *device;
|
char *device;
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ typedef struct {
|
|||||||
} ai_oss_t;
|
} ai_oss_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_SNDIO
|
#if HAVE_SNDIO
|
||||||
#include <sndio.h>
|
#include <sndio.h>
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@ -72,13 +72,13 @@ typedef struct
|
|||||||
int bytes_per_sample;
|
int bytes_per_sample;
|
||||||
int samplesize;
|
int samplesize;
|
||||||
|
|
||||||
#ifdef CONFIG_ALSA
|
#if HAVE_ALSA
|
||||||
ai_alsa_t alsa;
|
ai_alsa_t alsa;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_OSS_AUDIO
|
#if HAVE_OSS_AUDIO
|
||||||
ai_oss_t oss;
|
ai_oss_t oss;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_SNDIO
|
#if HAVE_SNDIO
|
||||||
ai_sndio_t sndio;
|
ai_sndio_t sndio;
|
||||||
#endif
|
#endif
|
||||||
} audio_in_t;
|
} audio_in_t;
|
||||||
@ -92,19 +92,19 @@ int audio_in_uninit(audio_in_t *ai);
|
|||||||
int audio_in_start_capture(audio_in_t *ai);
|
int audio_in_start_capture(audio_in_t *ai);
|
||||||
int audio_in_read_chunk(audio_in_t *ai, unsigned char *buffer);
|
int audio_in_read_chunk(audio_in_t *ai, unsigned char *buffer);
|
||||||
|
|
||||||
#ifdef CONFIG_ALSA
|
#if HAVE_ALSA
|
||||||
int ai_alsa_setup(audio_in_t *ai);
|
int ai_alsa_setup(audio_in_t *ai);
|
||||||
int ai_alsa_init(audio_in_t *ai);
|
int ai_alsa_init(audio_in_t *ai);
|
||||||
int ai_alsa_xrun(audio_in_t *ai);
|
int ai_alsa_xrun(audio_in_t *ai);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_OSS_AUDIO
|
#if HAVE_OSS_AUDIO
|
||||||
int ai_oss_set_samplerate(audio_in_t *ai);
|
int ai_oss_set_samplerate(audio_in_t *ai);
|
||||||
int ai_oss_set_channels(audio_in_t *ai);
|
int ai_oss_set_channels(audio_in_t *ai);
|
||||||
int ai_oss_init(audio_in_t *ai);
|
int ai_oss_init(audio_in_t *ai);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_SNDIO
|
#if HAVE_SNDIO
|
||||||
int ai_sndio_setup(audio_in_t *ai);
|
int ai_sndio_setup(audio_in_t *ai);
|
||||||
int ai_sndio_init(audio_in_t *ai);
|
int ai_sndio_init(audio_in_t *ai);
|
||||||
#endif
|
#endif
|
||||||
|
@ -80,34 +80,34 @@ extern const stream_info_t stream_info_rar_filter;
|
|||||||
extern const stream_info_t stream_info_rar_entry;
|
extern const stream_info_t stream_info_rar_entry;
|
||||||
|
|
||||||
static const stream_info_t *const stream_list[] = {
|
static const stream_info_t *const stream_list[] = {
|
||||||
#ifdef CONFIG_VCD
|
#if HAVE_VCD
|
||||||
&stream_info_vcd,
|
&stream_info_vcd,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_CDDA
|
#if HAVE_CDDA
|
||||||
&stream_info_cdda,
|
&stream_info_cdda,
|
||||||
#endif
|
#endif
|
||||||
&stream_info_ffmpeg,
|
&stream_info_ffmpeg,
|
||||||
&stream_info_avdevice,
|
&stream_info_avdevice,
|
||||||
#ifdef CONFIG_DVBIN
|
#if HAVE_DVBIN
|
||||||
&stream_info_dvb,
|
&stream_info_dvb,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_TV
|
#if HAVE_TV
|
||||||
&stream_info_tv,
|
&stream_info_tv,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_RADIO
|
#if HAVE_RADIO
|
||||||
&stream_info_radio,
|
&stream_info_radio,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_PVR
|
#if HAVE_PVR
|
||||||
&stream_info_pvr,
|
&stream_info_pvr,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_LIBSMBCLIENT
|
#if HAVE_LIBSMBCLIENT
|
||||||
&stream_info_smb,
|
&stream_info_smb,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_DVDREAD
|
#if HAVE_DVDREAD
|
||||||
&stream_info_ifo,
|
&stream_info_ifo,
|
||||||
&stream_info_dvd,
|
&stream_info_dvd,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_LIBBLURAY
|
#if HAVE_LIBBLURAY
|
||||||
&stream_info_bluray,
|
&stream_info_bluray,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -804,7 +804,7 @@ static int stream_enable_cache(stream_t **stream, int64_t size, int64_t min,
|
|||||||
|
|
||||||
int res = -1;
|
int res = -1;
|
||||||
|
|
||||||
#ifdef CONFIG_STREAM_CACHE
|
#if HAVE_STREAM_CACHE
|
||||||
res = stream_cache_init(cache, orig, size, min, seek_limit);
|
res = stream_cache_init(cache, orig, size, min, seek_limit);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
|
|
||||||
#ifdef CONFIG_RADIO_V4L2
|
#if HAVE_RADIO_V4L2
|
||||||
#include <linux/videodev2.h>
|
#include <linux/videodev2.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -48,13 +48,13 @@
|
|||||||
#include "stream_radio.h"
|
#include "stream_radio.h"
|
||||||
#include "libavutil/avstring.h"
|
#include "libavutil/avstring.h"
|
||||||
|
|
||||||
#ifdef CONFIG_RADIO_CAPTURE
|
#if HAVE_RADIO_CAPTURE
|
||||||
#include "audio_in.h"
|
#include "audio_in.h"
|
||||||
|
|
||||||
#ifdef HAVE_SYS_SOUNDCARD_H
|
#if HAVE_SYS_SOUNDCARD_H
|
||||||
#include <sys/soundcard.h>
|
#include <sys/soundcard.h>
|
||||||
#else
|
#else
|
||||||
#ifdef HAVE_SOUNDCARD_H
|
#if HAVE_SOUNDCARD_H
|
||||||
#include <soundcard.h>
|
#include <soundcard.h>
|
||||||
#else
|
#else
|
||||||
#include <linux/soundcard.h>
|
#include <linux/soundcard.h>
|
||||||
@ -93,7 +93,7 @@ typedef struct radio_priv_s {
|
|||||||
float rangehigh; ///< highest tunable frequency in MHz
|
float rangehigh; ///< highest tunable frequency in MHz
|
||||||
const struct radio_driver_s* driver;
|
const struct radio_driver_s* driver;
|
||||||
int old_snd_volume;
|
int old_snd_volume;
|
||||||
#ifdef CONFIG_RADIO_CAPTURE
|
#if HAVE_RADIO_CAPTURE
|
||||||
volatile int do_capture; ///< is capture enabled
|
volatile int do_capture; ///< is capture enabled
|
||||||
audio_in_t audio_in;
|
audio_in_t audio_in;
|
||||||
unsigned char* audio_ringbuffer;
|
unsigned char* audio_ringbuffer;
|
||||||
@ -125,7 +125,7 @@ static const m_option_t stream_opts_fields[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static void close_s(struct stream *stream);
|
static void close_s(struct stream *stream);
|
||||||
#ifdef CONFIG_RADIO_CAPTURE
|
#if HAVE_RADIO_CAPTURE
|
||||||
static int clear_buffer(radio_priv_t* priv);
|
static int clear_buffer(radio_priv_t* priv);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -221,7 +221,7 @@ static int parse_channels(radio_priv_t* priv,float freq_channel,float* pfreq){
|
|||||||
return STREAM_OK;
|
return STREAM_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_RADIO_V4L2
|
#if HAVE_RADIO_V4L2
|
||||||
/*****************************************************************
|
/*****************************************************************
|
||||||
* \brief get fraction value for using in set_frequency and get_frequency
|
* \brief get fraction value for using in set_frequency and get_frequency
|
||||||
* \return STREAM_OK if success, STREAM_ERROR otherwise
|
* \return STREAM_OK if success, STREAM_ERROR otherwise
|
||||||
@ -378,7 +378,7 @@ static const radio_driver_t radio_driver_v4l2={
|
|||||||
set_frequency_v4l2,
|
set_frequency_v4l2,
|
||||||
get_frequency_v4l2
|
get_frequency_v4l2
|
||||||
};
|
};
|
||||||
#endif /* CONFIG_RADIO_V4L2 */
|
#endif /* HAVE_RADIO_V4L2 */
|
||||||
|
|
||||||
static inline int init_frac(radio_priv_t* priv){
|
static inline int init_frac(radio_priv_t* priv){
|
||||||
return priv->driver->init_frac(priv);
|
return priv->driver->init_frac(priv);
|
||||||
@ -391,7 +391,7 @@ static inline int set_frequency(radio_priv_t* priv,float frequency){
|
|||||||
if(priv->driver->set_frequency(priv,frequency)!=STREAM_OK)
|
if(priv->driver->set_frequency(priv,frequency)!=STREAM_OK)
|
||||||
return STREAM_ERROR;
|
return STREAM_ERROR;
|
||||||
|
|
||||||
#ifdef CONFIG_RADIO_CAPTURE
|
#if HAVE_RADIO_CAPTURE
|
||||||
if(clear_buffer(priv)!=STREAM_OK){
|
if(clear_buffer(priv)!=STREAM_OK){
|
||||||
mp_tmsg(MSGT_RADIO,MSGL_ERR,"[radio] Clearing buffer failed: %s\n",strerror(errno));
|
mp_tmsg(MSGT_RADIO,MSGL_ERR,"[radio] Clearing buffer failed: %s\n",strerror(errno));
|
||||||
return STREAM_ERROR;
|
return STREAM_ERROR;
|
||||||
@ -410,7 +410,7 @@ static inline int get_volume(radio_priv_t* priv,int* volume){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifndef CONFIG_RADIO_CAPTURE
|
#if !HAVE_RADIO_CAPTURE
|
||||||
/*****************************************************************
|
/*****************************************************************
|
||||||
* \brief stub, if capture disabled at compile-time
|
* \brief stub, if capture disabled at compile-time
|
||||||
* \return STREAM_OK
|
* \return STREAM_OK
|
||||||
@ -441,7 +441,7 @@ static int read_chunk(audio_in_t *ai, unsigned char *buffer)
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
switch (ai->type) {
|
switch (ai->type) {
|
||||||
#ifdef CONFIG_ALSA
|
#if HAVE_ALSA
|
||||||
case AUDIO_IN_ALSA:
|
case AUDIO_IN_ALSA:
|
||||||
//device opened in non-blocking mode
|
//device opened in non-blocking mode
|
||||||
ret = snd_pcm_readi(ai->alsa.handle, buffer, ai->alsa.chunk_size);
|
ret = snd_pcm_readi(ai->alsa.handle, buffer, ai->alsa.chunk_size);
|
||||||
@ -463,7 +463,7 @@ static int read_chunk(audio_in_t *ai, unsigned char *buffer)
|
|||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_OSS_AUDIO
|
#if HAVE_OSS_AUDIO
|
||||||
case AUDIO_IN_OSS:
|
case AUDIO_IN_OSS:
|
||||||
{
|
{
|
||||||
int bt=0;
|
int bt=0;
|
||||||
@ -562,7 +562,7 @@ static int init_audio(radio_priv_t *priv)
|
|||||||
|
|
||||||
priv->do_capture=1;
|
priv->do_capture=1;
|
||||||
mp_tmsg(MSGT_RADIO,MSGL_V,"[radio] Starting capture stuff.\n");
|
mp_tmsg(MSGT_RADIO,MSGL_V,"[radio] Starting capture stuff.\n");
|
||||||
#ifdef CONFIG_ALSA
|
#if HAVE_ALSA
|
||||||
while ((tmp = strrchr(priv->radio_param->adevice, '='))){
|
while ((tmp = strrchr(priv->radio_param->adevice, '='))){
|
||||||
tmp[0] = ':';
|
tmp[0] = ':';
|
||||||
//adevice option looks like ALSA device name. Switching to ALSA
|
//adevice option looks like ALSA device name. Switching to ALSA
|
||||||
@ -584,11 +584,11 @@ static int init_audio(radio_priv_t *priv)
|
|||||||
mp_tmsg(MSGT_RADIO, MSGL_ERR, "[radio] audio_in_setup call failed: %s\n", strerror(errno));
|
mp_tmsg(MSGT_RADIO, MSGL_ERR, "[radio] audio_in_setup call failed: %s\n", strerror(errno));
|
||||||
return STREAM_ERROR;
|
return STREAM_ERROR;
|
||||||
}
|
}
|
||||||
#ifdef CONFIG_OSS_AUDIO
|
#if HAVE_OSS_AUDIO
|
||||||
if(is_oss)
|
if(is_oss)
|
||||||
ioctl(priv->audio_in.oss.audio_fd, SNDCTL_DSP_NONBLOCK, 0);
|
ioctl(priv->audio_in.oss.audio_fd, SNDCTL_DSP_NONBLOCK, 0);
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_ALSA
|
#if HAVE_ALSA
|
||||||
if(!is_oss)
|
if(!is_oss)
|
||||||
snd_pcm_nonblock(priv->audio_in.alsa.handle,1);
|
snd_pcm_nonblock(priv->audio_in.alsa.handle,1);
|
||||||
#endif
|
#endif
|
||||||
@ -616,7 +616,7 @@ static int init_audio(radio_priv_t *priv)
|
|||||||
|
|
||||||
return STREAM_OK;
|
return STREAM_OK;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_RADIO_CAPTURE */
|
#endif /* HAVE_RADIO_CAPTURE */
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
for call from mplayer.c
|
for call from mplayer.c
|
||||||
@ -788,7 +788,7 @@ char* radio_get_channel_name(struct stream *stream){
|
|||||||
static int fill_buffer_s(struct stream *s, char *buffer, int max_len){
|
static int fill_buffer_s(struct stream *s, char *buffer, int max_len){
|
||||||
int len=max_len;
|
int len=max_len;
|
||||||
|
|
||||||
#ifdef CONFIG_RADIO_CAPTURE
|
#if HAVE_RADIO_CAPTURE
|
||||||
radio_priv_t* priv=(radio_priv_t*)s->priv;
|
radio_priv_t* priv=(radio_priv_t*)s->priv;
|
||||||
|
|
||||||
if (priv->do_capture){
|
if (priv->do_capture){
|
||||||
@ -806,7 +806,7 @@ static int fill_buffer_s(struct stream *s, char *buffer, int max_len){
|
|||||||
when no driver explicitly specified first available will be used
|
when no driver explicitly specified first available will be used
|
||||||
*/
|
*/
|
||||||
static const radio_driver_t* radio_drivers[]={
|
static const radio_driver_t* radio_drivers[]={
|
||||||
#ifdef CONFIG_RADIO_V4L2
|
#if HAVE_RADIO_V4L2
|
||||||
&radio_driver_v4l2,
|
&radio_driver_v4l2,
|
||||||
#endif
|
#endif
|
||||||
0
|
0
|
||||||
@ -837,7 +837,7 @@ static int open_s(stream_t *stream,int mode)
|
|||||||
priv->radio_param=stream->priv;
|
priv->radio_param=stream->priv;
|
||||||
stream->priv=NULL;
|
stream->priv=NULL;
|
||||||
|
|
||||||
#ifdef CONFIG_RADIO_CAPTURE
|
#if HAVE_RADIO_CAPTURE
|
||||||
if (priv->radio_param->capture && strncmp("capture",priv->radio_param->capture,7)==0)
|
if (priv->radio_param->capture && strncmp("capture",priv->radio_param->capture,7)==0)
|
||||||
priv->do_capture=1;
|
priv->do_capture=1;
|
||||||
else
|
else
|
||||||
@ -934,7 +934,7 @@ static void close_s(struct stream *stream){
|
|||||||
radio_channels_t * tmp;
|
radio_channels_t * tmp;
|
||||||
if (!priv) return;
|
if (!priv) return;
|
||||||
|
|
||||||
#ifdef CONFIG_RADIO_CAPTURE
|
#if HAVE_RADIO_CAPTURE
|
||||||
free(priv->audio_ringbuffer);
|
free(priv->audio_ringbuffer);
|
||||||
priv->audio_ringbuffer = NULL;
|
priv->audio_ringbuffer = NULL;
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ extern const tvi_info_t tvi_info_v4l2;
|
|||||||
|
|
||||||
/** List of drivers in autodetection order */
|
/** List of drivers in autodetection order */
|
||||||
static const tvi_info_t* tvi_driver_list[]={
|
static const tvi_info_t* tvi_driver_list[]={
|
||||||
#ifdef CONFIG_TV_V4L2
|
#if HAVE_TV_V4L2
|
||||||
&tvi_info_v4l2,
|
&tvi_info_v4l2,
|
||||||
#endif
|
#endif
|
||||||
&tvi_info_dummy,
|
&tvi_info_dummy,
|
||||||
@ -474,7 +474,7 @@ static int open_tv(tvi_handle_t *tvh)
|
|||||||
funcs->control(tvh->priv, TVI_CONTROL_SPC_SET_INPUT, &tvh->tv_param->input);
|
funcs->control(tvh->priv, TVI_CONTROL_SPC_SET_INPUT, &tvh->tv_param->input);
|
||||||
|
|
||||||
if ((!strcmp(tvh->tv_param->driver, "v4l2") && tvh->tv_param->normid >= 0))
|
if ((!strcmp(tvh->tv_param->driver, "v4l2") && tvh->tv_param->normid >= 0))
|
||||||
tv_set_norm_i(tvh, tvh->tv_param->normid);
|
tv_set_norm_i(tvh, tvh->tv_param->normid);
|
||||||
else
|
else
|
||||||
tv_set_norm(tvh,tvh->tv_param->norm);
|
tv_set_norm(tvh,tvh->tv_param->norm);
|
||||||
|
|
||||||
|
@ -46,10 +46,10 @@ known issues:
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#ifdef HAVE_SYS_SYSINFO_H
|
#if HAVE_SYS_SYSINFO_H
|
||||||
#include <sys/sysinfo.h>
|
#include <sys/sysinfo.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_VIDEOIO_H
|
#if HAVE_SYS_VIDEOIO_H
|
||||||
#include <sys/videoio.h>
|
#include <sys/videoio.h>
|
||||||
#else
|
#else
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
@ -400,7 +400,7 @@ static void init_audio(priv_t *priv)
|
|||||||
if (priv->audio_initialized) return;
|
if (priv->audio_initialized) return;
|
||||||
|
|
||||||
if (!priv->tv_param->noaudio) {
|
if (!priv->tv_param->noaudio) {
|
||||||
#ifdef CONFIG_ALSA
|
#if HAVE_ALSA
|
||||||
if (priv->tv_param->alsa)
|
if (priv->tv_param->alsa)
|
||||||
audio_in_init(&priv->audio_in, AUDIO_IN_ALSA);
|
audio_in_init(&priv->audio_in, AUDIO_IN_ALSA);
|
||||||
else
|
else
|
||||||
@ -1321,7 +1321,7 @@ static int get_capture_buffer_size(priv_t *priv)
|
|||||||
if (priv->tv_param->buffer_size >= 0) {
|
if (priv->tv_param->buffer_size >= 0) {
|
||||||
bufsize = priv->tv_param->buffer_size*1024*1024;
|
bufsize = priv->tv_param->buffer_size*1024*1024;
|
||||||
} else {
|
} else {
|
||||||
#ifdef HAVE_SYS_SYSINFO_H
|
#if HAVE_SYS_SYSINFO_H
|
||||||
struct sysinfo si;
|
struct sysinfo si;
|
||||||
|
|
||||||
sysinfo(&si);
|
sysinfo(&si);
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
// m_color argument
|
// m_color argument
|
||||||
#define MP_ASS_COLOR(c) MP_ASS_RGBA((c).r, (c).g, (c).b, (c).a)
|
#define MP_ASS_COLOR(c) MP_ASS_RGBA((c).r, (c).g, (c).b, (c).a)
|
||||||
|
|
||||||
#ifdef CONFIG_ASS
|
#if HAVE_LIBASS
|
||||||
#include <ass/ass.h>
|
#include <ass/ass.h>
|
||||||
#include <ass/ass_types.h>
|
#include <ass/ass_types.h>
|
||||||
|
|
||||||
@ -62,5 +62,5 @@ struct sub_bitmaps;
|
|||||||
void mp_ass_render_frame(ASS_Renderer *renderer, ASS_Track *track, double time,
|
void mp_ass_render_frame(ASS_Renderer *renderer, ASS_Track *track, double time,
|
||||||
struct sub_bitmap **parts, struct sub_bitmaps *res);
|
struct sub_bitmap **parts, struct sub_bitmaps *res);
|
||||||
|
|
||||||
#endif /* CONFIG_ASS */
|
#endif /* HAVE_LIBASS */
|
||||||
#endif /* MPLAYER_ASS_MP_H */
|
#endif /* MPLAYER_ASS_MP_H */
|
||||||
|
@ -41,7 +41,7 @@ extern const struct sd_functions sd_lavf_srt;
|
|||||||
extern const struct sd_functions sd_lavc_conv;
|
extern const struct sd_functions sd_lavc_conv;
|
||||||
|
|
||||||
static const struct sd_functions *sd_list[] = {
|
static const struct sd_functions *sd_list[] = {
|
||||||
#ifdef CONFIG_ASS
|
#if HAVE_LIBASS
|
||||||
&sd_ass,
|
&sd_ass,
|
||||||
#endif
|
#endif
|
||||||
&sd_lavc,
|
&sd_lavc,
|
||||||
|
@ -103,18 +103,17 @@ static const struct vd_lavc_hwdec mp_vd_lavc_crystalhd = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static const struct vd_lavc_hwdec *hwdec_list[] = {
|
static const struct vd_lavc_hwdec *hwdec_list[] = {
|
||||||
#if CONFIG_VDPAU
|
#if HAVE_VDPAU_HWACCEL
|
||||||
#if HAVE_AV_CODEC_NEW_VDPAU_API
|
|
||||||
&mp_vd_lavc_vdpau,
|
&mp_vd_lavc_vdpau,
|
||||||
#else
|
#endif
|
||||||
|
#if HAVE_VDPAU_DECODER
|
||||||
&mp_vd_lavc_vdpau_old,
|
&mp_vd_lavc_vdpau_old,
|
||||||
#endif
|
#endif
|
||||||
#endif // CONFIG_VDPAU
|
#if HAVE_VDA_HWACCEL
|
||||||
#if CONFIG_VDA
|
|
||||||
&mp_vd_lavc_vda,
|
&mp_vd_lavc_vda,
|
||||||
#endif
|
#endif
|
||||||
&mp_vd_lavc_crystalhd,
|
&mp_vd_lavc_crystalhd,
|
||||||
#if CONFIG_VAAPI
|
#if HAVE_VAAPI_HWACCEL
|
||||||
&mp_vd_lavc_vaapi,
|
&mp_vd_lavc_vaapi,
|
||||||
&mp_vd_lavc_vaapi_copy,
|
&mp_vd_lavc_vaapi_copy,
|
||||||
#endif
|
#endif
|
||||||
|
@ -84,10 +84,10 @@ static const vf_info_t *const filter_list[] = {
|
|||||||
&vf_info_rotate,
|
&vf_info_rotate,
|
||||||
&vf_info_mirror,
|
&vf_info_mirror,
|
||||||
|
|
||||||
#ifdef CONFIG_LIBPOSTPROC
|
#if HAVE_LIBPOSTPROC
|
||||||
&vf_info_pp,
|
&vf_info_pp,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_VF_LAVFI
|
#if HAVE_VF_LAVFI
|
||||||
&vf_info_lavfi,
|
&vf_info_lavfi,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -110,10 +110,10 @@ static const vf_info_t *const filter_list[] = {
|
|||||||
&vf_info_sub,
|
&vf_info_sub,
|
||||||
&vf_info_yadif,
|
&vf_info_yadif,
|
||||||
&vf_info_stereo3d,
|
&vf_info_stereo3d,
|
||||||
#ifdef CONFIG_DLOPEN
|
#if HAVE_DLOPEN
|
||||||
&vf_info_dlopen,
|
&vf_info_dlopen,
|
||||||
#endif
|
#endif
|
||||||
#if CONFIG_VAAPI_VPP
|
#if HAVE_VAAPI_VPP
|
||||||
&vf_info_vaapi,
|
&vf_info_vaapi,
|
||||||
#endif
|
#endif
|
||||||
NULL
|
NULL
|
||||||
|
@ -171,7 +171,7 @@ static const struct {
|
|||||||
{IMGFMT_BGRA64_LE, PIX_FMT_BGRA64LE},
|
{IMGFMT_BGRA64_LE, PIX_FMT_BGRA64LE},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_AV_CODEC_NEW_VDPAU_API
|
#if HAVE_AVCODEC_NEW_VDPAU_API
|
||||||
{IMGFMT_VDPAU, AV_PIX_FMT_VDPAU},
|
{IMGFMT_VDPAU, AV_PIX_FMT_VDPAU},
|
||||||
#else
|
#else
|
||||||
{IMGFMT_VDPAU_MPEG1, PIX_FMT_VDPAU_MPEG1},
|
{IMGFMT_VDPAU_MPEG1, PIX_FMT_VDPAU_MPEG1},
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#ifdef CONFIG_JPEG
|
#if HAVE_JPEG
|
||||||
#include <jpeglib.h>
|
#include <jpeglib.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -142,7 +142,7 @@ error_exit:
|
|||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_JPEG
|
#if HAVE_JPEG
|
||||||
|
|
||||||
static void write_jpeg_error_exit(j_common_ptr cinfo)
|
static void write_jpeg_error_exit(j_common_ptr cinfo)
|
||||||
{
|
{
|
||||||
@ -226,7 +226,7 @@ static const struct img_writer img_writers[] = {
|
|||||||
.pixfmts = (int[]) { IMGFMT_BGR24, IMGFMT_BGRA, IMGFMT_BGR15_LE,
|
.pixfmts = (int[]) { IMGFMT_BGR24, IMGFMT_BGRA, IMGFMT_BGR15_LE,
|
||||||
IMGFMT_Y8, 0},
|
IMGFMT_Y8, 0},
|
||||||
},
|
},
|
||||||
#ifdef CONFIG_JPEG
|
#if HAVE_JPEG
|
||||||
{ "jpg", write_jpeg },
|
{ "jpg", write_jpeg },
|
||||||
{ "jpeg", write_jpeg },
|
{ "jpeg", write_jpeg },
|
||||||
#endif
|
#endif
|
||||||
|
@ -142,14 +142,14 @@ static bool is_software_gl(GL *gl)
|
|||||||
strcmp(renderer, "Mesa X11") == 0;
|
strcmp(renderer, "Mesa X11") == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_LIBDL
|
#if HAVE_LIBDL
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void *mp_getdladdr(const char *s)
|
void *mp_getdladdr(const char *s)
|
||||||
{
|
{
|
||||||
void *ret = NULL;
|
void *ret = NULL;
|
||||||
#ifdef HAVE_LIBDL
|
#if HAVE_LIBDL
|
||||||
void *handle = dlopen(NULL, RTLD_LAZY);
|
void *handle = dlopen(NULL, RTLD_LAZY);
|
||||||
if (!handle)
|
if (!handle)
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -852,18 +852,18 @@ struct backend {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static struct backend backends[] = {
|
static struct backend backends[] = {
|
||||||
#ifdef CONFIG_GL_COCOA
|
#if HAVE_GL_COCOA
|
||||||
{"cocoa", mpgl_set_backend_cocoa},
|
{"cocoa", mpgl_set_backend_cocoa},
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_GL_WIN32
|
#if HAVE_GL_WIN32
|
||||||
{"win", mpgl_set_backend_w32},
|
{"win", mpgl_set_backend_w32},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//Add the wayland backend before x11, in order to probe for a wayland-server before a x11-server and avoid using xwayland
|
//Add the wayland backend before x11, in order to probe for a wayland-server before a x11-server and avoid using xwayland
|
||||||
#ifdef CONFIG_GL_WAYLAND
|
#if HAVE_GL_WAYLAND
|
||||||
{"wayland", mpgl_set_backend_wayland},
|
{"wayland", mpgl_set_backend_wayland},
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_GL_X11
|
#if HAVE_GL_X11
|
||||||
{"x11", mpgl_set_backend_x11},
|
{"x11", mpgl_set_backend_x11},
|
||||||
#endif
|
#endif
|
||||||
{0}
|
{0}
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
#include "video/mp_image.h"
|
#include "video/mp_image.h"
|
||||||
|
|
||||||
#if defined(CONFIG_GL_COCOA)
|
#if HAVE_GL_COCOA
|
||||||
#ifdef GL_VERSION_3_0
|
#ifdef GL_VERSION_3_0
|
||||||
#include <OpenGL/gl3.h>
|
#include <OpenGL/gl3.h>
|
||||||
#else
|
#else
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#ifndef GLAPIENTRY
|
#ifndef GLAPIENTRY
|
||||||
#ifdef APIENTRY
|
#ifdef APIENTRY
|
||||||
#define GLAPIENTRY APIENTRY
|
#define GLAPIENTRY APIENTRY
|
||||||
#elif defined(CONFIG_GL_WIN32)
|
#elif HAVE_GL_WIN32
|
||||||
#define GLAPIENTRY __stdcall
|
#define GLAPIENTRY __stdcall
|
||||||
#else
|
#else
|
||||||
#define GLAPIENTRY
|
#define GLAPIENTRY
|
||||||
@ -222,7 +222,7 @@
|
|||||||
/** \} */ // end of glextdefines group
|
/** \} */ // end of glextdefines group
|
||||||
|
|
||||||
|
|
||||||
#if defined(CONFIG_GL_WIN32) && !defined(WGL_CONTEXT_MAJOR_VERSION_ARB)
|
#if HAVE_GL_WIN32 && !defined(WGL_CONTEXT_MAJOR_VERSION_ARB)
|
||||||
/* these are supposed to be defined in wingdi.h but mingw's is too old */
|
/* these are supposed to be defined in wingdi.h but mingw's is too old */
|
||||||
/* only the bits actually used by mplayer are defined */
|
/* only the bits actually used by mplayer are defined */
|
||||||
/* reference: http://www.opengl.org/registry/specs/ARB/wgl_create_context.txt */
|
/* reference: http://www.opengl.org/registry/specs/ARB/wgl_create_context.txt */
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
#include "gl_video.h"
|
#include "gl_video.h"
|
||||||
#include "gl_lcms.h"
|
#include "gl_lcms.h"
|
||||||
|
|
||||||
#ifdef CONFIG_LCMS2
|
#if HAVE_LCMS2
|
||||||
|
|
||||||
#include <lcms2.h>
|
#include <lcms2.h>
|
||||||
|
|
||||||
@ -212,7 +212,7 @@ error_exit:
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* CONFIG_LCMS2 */
|
#else /* HAVE_LCMS2 */
|
||||||
|
|
||||||
const struct m_sub_options mp_icc_conf = {
|
const struct m_sub_options mp_icc_conf = {
|
||||||
.opts = (m_option_t[]) { {0} },
|
.opts = (m_option_t[]) { {0} },
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
static const char vo_opengl_shaders[] =
|
static const char vo_opengl_shaders[] =
|
||||||
// Generated from gl_video_shaders.glsl
|
// Generated from gl_video_shaders.glsl
|
||||||
#include "gl_video_shaders.h"
|
#include "video/out/gl_video_shaders.h"
|
||||||
;
|
;
|
||||||
|
|
||||||
// Pixel width of 1D lookup textures.
|
// Pixel width of 1D lookup textures.
|
||||||
|
@ -66,47 +66,47 @@ extern struct vo_driver video_out_wayland;
|
|||||||
|
|
||||||
const struct vo_driver *video_out_drivers[] =
|
const struct vo_driver *video_out_drivers[] =
|
||||||
{
|
{
|
||||||
#if CONFIG_VDPAU
|
#if HAVE_VDPAU
|
||||||
&video_out_vdpau,
|
&video_out_vdpau,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_GL
|
#if HAVE_GL
|
||||||
&video_out_opengl,
|
&video_out_opengl,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_DIRECT3D
|
#if HAVE_DIRECT3D
|
||||||
&video_out_direct3d_shaders,
|
&video_out_direct3d_shaders,
|
||||||
&video_out_direct3d,
|
&video_out_direct3d,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_COREVIDEO
|
#if HAVE_COREVIDEO
|
||||||
&video_out_corevideo,
|
&video_out_corevideo,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_XV
|
#if HAVE_XV
|
||||||
&video_out_xv,
|
&video_out_xv,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_SDL2
|
#if HAVE_SDL2
|
||||||
&video_out_sdl,
|
&video_out_sdl,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_GL
|
#if HAVE_GL
|
||||||
&video_out_opengl_old,
|
&video_out_opengl_old,
|
||||||
#endif
|
#endif
|
||||||
#if CONFIG_VAAPI
|
#if HAVE_VAAPI
|
||||||
&video_out_vaapi,
|
&video_out_vaapi,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_X11
|
#if HAVE_X11
|
||||||
&video_out_x11,
|
&video_out_x11,
|
||||||
#endif
|
#endif
|
||||||
&video_out_null,
|
&video_out_null,
|
||||||
// should not be auto-selected
|
// should not be auto-selected
|
||||||
&video_out_image,
|
&video_out_image,
|
||||||
#ifdef CONFIG_CACA
|
#if HAVE_CACA
|
||||||
&video_out_caca,
|
&video_out_caca,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_ENCODING
|
#if HAVE_ENCODING
|
||||||
&video_out_lavc,
|
&video_out_lavc,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_GL
|
#if HAVE_GL
|
||||||
&video_out_opengl_hq,
|
&video_out_opengl_hq,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_WAYLAND
|
#if HAVE_WAYLAND
|
||||||
&video_out_wayland,
|
&video_out_wayland,
|
||||||
#endif
|
#endif
|
||||||
NULL
|
NULL
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <QuartzCore/QuartzCore.h>
|
#include <QuartzCore/QuartzCore.h>
|
||||||
#if CONFIG_VDA
|
#if HAVE_VDA_HWACCEL
|
||||||
#include <IOSurface/IOSurface.h>
|
#include <IOSurface/IOSurface.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -446,7 +446,7 @@ static struct cv_functions cv_functions = {
|
|||||||
.set_yuv_colorspace = cv_set_yuv_colorspace,
|
.set_yuv_colorspace = cv_set_yuv_colorspace,
|
||||||
};
|
};
|
||||||
|
|
||||||
#if CONFIG_VDA
|
#if HAVE_VDA_HWACCEL
|
||||||
static void iosurface_init(struct vo *vo)
|
static void iosurface_init(struct vo *vo)
|
||||||
{
|
{
|
||||||
struct priv *p = vo->priv;
|
struct priv *p = vo->priv;
|
||||||
@ -546,7 +546,7 @@ static struct cv_functions iosurface_functions = {
|
|||||||
.get_yuv_colorspace = get_yuv_colorspace,
|
.get_yuv_colorspace = get_yuv_colorspace,
|
||||||
.set_yuv_colorspace = iosurface_set_yuv_csp,
|
.set_yuv_colorspace = iosurface_set_yuv_csp,
|
||||||
};
|
};
|
||||||
#endif /* CONFIG_VDA */
|
#endif /* HAVE_VDA_HWACCEL */
|
||||||
|
|
||||||
static int query_format(struct vo *vo, uint32_t format)
|
static int query_format(struct vo *vo, uint32_t format)
|
||||||
{
|
{
|
||||||
@ -554,7 +554,7 @@ static int query_format(struct vo *vo, uint32_t format)
|
|||||||
const int flags = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW;
|
const int flags = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW;
|
||||||
|
|
||||||
switch (format) {
|
switch (format) {
|
||||||
#if CONFIG_VDA
|
#if HAVE_VDA_HWACCEL
|
||||||
case IMGFMT_VDA:
|
case IMGFMT_VDA:
|
||||||
p->fns = iosurface_functions;
|
p->fns = iosurface_functions;
|
||||||
return flags;
|
return flags;
|
||||||
|
@ -658,7 +658,7 @@ const struct vo_driver video_out_vaapi = {
|
|||||||
.priv_defaults = &(const struct priv) {
|
.priv_defaults = &(const struct priv) {
|
||||||
.scaling = VA_FILTER_SCALING_DEFAULT,
|
.scaling = VA_FILTER_SCALING_DEFAULT,
|
||||||
.deint = 0,
|
.deint = 0,
|
||||||
#if !CONFIG_VAAPI_VPP
|
#if !HAVE_VAAPI_VPP
|
||||||
.deint_type = 2,
|
.deint_type = 2,
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
|
@ -570,7 +570,7 @@ static int win_x11_init_vdpau_flip_queue(struct vo *vo)
|
|||||||
MP_INFO(vo, "Assuming user-specified display refresh rate of %.3f Hz.\n",
|
MP_INFO(vo, "Assuming user-specified display refresh rate of %.3f Hz.\n",
|
||||||
vc->user_fps);
|
vc->user_fps);
|
||||||
} else if (vc->user_fps == 0) {
|
} else if (vc->user_fps == 0) {
|
||||||
#ifdef CONFIG_XF86VM
|
#if HAVE_XF86VM
|
||||||
double fps = vo_x11_vm_get_fps(vo);
|
double fps = vo_x11_vm_get_fps(vo);
|
||||||
if (!fps)
|
if (!fps)
|
||||||
MP_WARN(vo, "Failed to get display FPS\n");
|
MP_WARN(vo, "Failed to get display FPS\n");
|
||||||
|
@ -177,7 +177,7 @@ static int create_tmpfile_cloexec(char *tmpname)
|
|||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
#ifdef HAVE_MKOSTEMP
|
#if HAVE_MKOSTEMP
|
||||||
fd = mkostemp(tmpname, O_CLOEXEC);
|
fd = mkostemp(tmpname, O_CLOEXEC);
|
||||||
if (fd >= 0)
|
if (fd >= 0)
|
||||||
unlink(tmpname);
|
unlink(tmpname);
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
#include "x11_common.h"
|
#include "x11_common.h"
|
||||||
|
|
||||||
#ifdef HAVE_SHM
|
#if HAVE_SHM
|
||||||
#include <sys/ipc.h>
|
#include <sys/ipc.h>
|
||||||
#include <sys/shm.h>
|
#include <sys/shm.h>
|
||||||
#include <X11/extensions/XShm.h>
|
#include <X11/extensions/XShm.h>
|
||||||
@ -94,7 +94,7 @@ struct priv {
|
|||||||
int num_buffers;
|
int num_buffers;
|
||||||
|
|
||||||
int Shmem_Flag;
|
int Shmem_Flag;
|
||||||
#ifdef HAVE_SHM
|
#if HAVE_SHM
|
||||||
int Shm_Warned_Slow;
|
int Shm_Warned_Slow;
|
||||||
|
|
||||||
XShmSegmentInfo Shminfo[2];
|
XShmSegmentInfo Shminfo[2];
|
||||||
@ -157,7 +157,7 @@ static int find_depth_from_visuals(struct vo *vo, Visual ** visual_return)
|
|||||||
static void getMyXImage(struct priv *p, int foo)
|
static void getMyXImage(struct priv *p, int foo)
|
||||||
{
|
{
|
||||||
struct vo *vo = p->vo;
|
struct vo *vo = p->vo;
|
||||||
#ifdef HAVE_SHM
|
#if HAVE_SHM
|
||||||
if (vo->x11->display_is_local && XShmQueryExtension(vo->x11->display)) {
|
if (vo->x11->display_is_local && XShmQueryExtension(vo->x11->display)) {
|
||||||
p->Shmem_Flag = 1;
|
p->Shmem_Flag = 1;
|
||||||
vo->x11->ShmCompletionEvent = XShmGetEventBase(vo->x11->display)
|
vo->x11->ShmCompletionEvent = XShmGetEventBase(vo->x11->display)
|
||||||
@ -221,7 +221,7 @@ shmemerror:
|
|||||||
memset(p->myximage[foo]->data, 0, p->myximage[foo]->bytes_per_line
|
memset(p->myximage[foo]->data, 0, p->myximage[foo]->bytes_per_line
|
||||||
* p->image_height);
|
* p->image_height);
|
||||||
p->ImageData[foo] = p->myximage[foo]->data;
|
p->ImageData[foo] = p->myximage[foo]->data;
|
||||||
#ifdef HAVE_SHM
|
#if HAVE_SHM
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -229,7 +229,7 @@ shmemerror:
|
|||||||
static void freeMyXImage(struct priv *p, int foo)
|
static void freeMyXImage(struct priv *p, int foo)
|
||||||
{
|
{
|
||||||
struct vo *vo = p->vo;
|
struct vo *vo = p->vo;
|
||||||
#ifdef HAVE_SHM
|
#if HAVE_SHM
|
||||||
if (p->Shmem_Flag) {
|
if (p->Shmem_Flag) {
|
||||||
XShmDetach(vo->x11->display, &p->Shminfo[foo]);
|
XShmDetach(vo->x11->display, &p->Shminfo[foo]);
|
||||||
XDestroyImage(p->myximage[foo]);
|
XDestroyImage(p->myximage[foo]);
|
||||||
@ -397,7 +397,7 @@ static void Display_Image(struct priv *p, XImage *myximage)
|
|||||||
|
|
||||||
XImage *x_image = p->myximage[p->current_buf];
|
XImage *x_image = p->myximage[p->current_buf];
|
||||||
|
|
||||||
#ifdef HAVE_SHM
|
#if HAVE_SHM
|
||||||
if (p->Shmem_Flag) {
|
if (p->Shmem_Flag) {
|
||||||
XShmPutImage(vo->x11->display, vo->x11->window, vo->x11->vo_gc, x_image,
|
XShmPutImage(vo->x11->display, vo->x11->window, vo->x11->vo_gc, x_image,
|
||||||
0, 0, p->dst.x0, p->dst.y0, p->dst_w, p->dst_h,
|
0, 0, p->dst.x0, p->dst.y0, p->dst_w, p->dst_h,
|
||||||
@ -443,7 +443,7 @@ static mp_image_t *get_screenshot(struct vo *vo)
|
|||||||
|
|
||||||
static void wait_for_completion(struct vo *vo, int max_outstanding)
|
static void wait_for_completion(struct vo *vo, int max_outstanding)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SHM
|
#if HAVE_SHM
|
||||||
struct priv *ctx = vo->priv;
|
struct priv *ctx = vo->priv;
|
||||||
struct vo_x11_state *x11 = vo->x11;
|
struct vo_x11_state *x11 = vo->x11;
|
||||||
if (ctx->Shmem_Flag) {
|
if (ctx->Shmem_Flag) {
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#ifdef HAVE_SHM
|
#if HAVE_SHM
|
||||||
#include <sys/ipc.h>
|
#include <sys/ipc.h>
|
||||||
#include <sys/shm.h>
|
#include <sys/shm.h>
|
||||||
#include <X11/extensions/XShm.h>
|
#include <X11/extensions/XShm.h>
|
||||||
@ -91,7 +91,7 @@ struct xvctx {
|
|||||||
struct mp_rect dst_rect;
|
struct mp_rect dst_rect;
|
||||||
uint32_t max_width, max_height; // zero means: not set
|
uint32_t max_width, max_height; // zero means: not set
|
||||||
int Shmem_Flag;
|
int Shmem_Flag;
|
||||||
#ifdef HAVE_SHM
|
#if HAVE_SHM
|
||||||
XShmSegmentInfo Shminfo[2];
|
XShmSegmentInfo Shminfo[2];
|
||||||
int Shm_Warned_Slow;
|
int Shm_Warned_Slow;
|
||||||
#endif
|
#endif
|
||||||
@ -490,7 +490,7 @@ static bool allocate_xvimage(struct vo *vo, int foo)
|
|||||||
struct vo_x11_state *x11 = vo->x11;
|
struct vo_x11_state *x11 = vo->x11;
|
||||||
// align it for faster OSD rendering (draw_bmp.c swscale usage)
|
// align it for faster OSD rendering (draw_bmp.c swscale usage)
|
||||||
int aligned_w = FFALIGN(ctx->image_width, 32);
|
int aligned_w = FFALIGN(ctx->image_width, 32);
|
||||||
#ifdef HAVE_SHM
|
#if HAVE_SHM
|
||||||
if (x11->display_is_local && XShmQueryExtension(x11->display)) {
|
if (x11->display_is_local && XShmQueryExtension(x11->display)) {
|
||||||
ctx->Shmem_Flag = 1;
|
ctx->Shmem_Flag = 1;
|
||||||
x11->ShmCompletionEvent = XShmGetEventBase(x11->display)
|
x11->ShmCompletionEvent = XShmGetEventBase(x11->display)
|
||||||
@ -544,7 +544,7 @@ static bool allocate_xvimage(struct vo *vo, int foo)
|
|||||||
static void deallocate_xvimage(struct vo *vo, int foo)
|
static void deallocate_xvimage(struct vo *vo, int foo)
|
||||||
{
|
{
|
||||||
struct xvctx *ctx = vo->priv;
|
struct xvctx *ctx = vo->priv;
|
||||||
#ifdef HAVE_SHM
|
#if HAVE_SHM
|
||||||
if (ctx->Shmem_Flag) {
|
if (ctx->Shmem_Flag) {
|
||||||
XShmDetach(vo->x11->display, &ctx->Shminfo[foo]);
|
XShmDetach(vo->x11->display, &ctx->Shminfo[foo]);
|
||||||
shmdt(ctx->Shminfo[foo].shmaddr);
|
shmdt(ctx->Shminfo[foo].shmaddr);
|
||||||
@ -573,7 +573,7 @@ static inline void put_xvimage(struct vo *vo, XvImage *xvi)
|
|||||||
struct mp_rect *dst = &ctx->dst_rect;
|
struct mp_rect *dst = &ctx->dst_rect;
|
||||||
int dw = dst->x1 - dst->x0, dh = dst->y1 - dst->y0;
|
int dw = dst->x1 - dst->x0, dh = dst->y1 - dst->y0;
|
||||||
int sw = src->x1 - src->x0, sh = src->y1 - src->y0;
|
int sw = src->x1 - src->x0, sh = src->y1 - src->y0;
|
||||||
#ifdef HAVE_SHM
|
#if HAVE_SHM
|
||||||
if (ctx->Shmem_Flag) {
|
if (ctx->Shmem_Flag) {
|
||||||
XvShmPutImage(x11->display, ctx->xv_port, x11->window, x11->vo_gc, xvi,
|
XvShmPutImage(x11->display, ctx->xv_port, x11->window, x11->vo_gc, xvi,
|
||||||
src->x0, src->y0, sw, sh,
|
src->x0, src->y0, sw, sh,
|
||||||
@ -628,7 +628,7 @@ static void draw_osd(struct vo *vo, struct osd_state *osd)
|
|||||||
|
|
||||||
static void wait_for_completion(struct vo *vo, int max_outstanding)
|
static void wait_for_completion(struct vo *vo, int max_outstanding)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SHM
|
#if HAVE_SHM
|
||||||
struct xvctx *ctx = vo->priv;
|
struct xvctx *ctx = vo->priv;
|
||||||
struct vo_x11_state *x11 = vo->x11;
|
struct vo_x11_state *x11 = vo->x11;
|
||||||
if (ctx->Shmem_Flag) {
|
if (ctx->Shmem_Flag) {
|
||||||
|
@ -46,27 +46,27 @@
|
|||||||
#include <X11/keysym.h>
|
#include <X11/keysym.h>
|
||||||
#include <X11/XKBlib.h>
|
#include <X11/XKBlib.h>
|
||||||
|
|
||||||
#ifdef CONFIG_XSS
|
#if HAVE_XSS
|
||||||
#include <X11/extensions/scrnsaver.h>
|
#include <X11/extensions/scrnsaver.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_XDPMS
|
#if HAVE_XEXT
|
||||||
#include <X11/extensions/dpms.h>
|
#include <X11/extensions/dpms.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_XINERAMA
|
#if HAVE_XINERAMA
|
||||||
#include <X11/extensions/Xinerama.h>
|
#include <X11/extensions/Xinerama.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_XF86VM
|
#if HAVE_XF86VM
|
||||||
#include <X11/extensions/xf86vmode.h>
|
#include <X11/extensions/xf86vmode.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_XF86XK
|
#if HAVE_XF86XK
|
||||||
#include <X11/XF86keysym.h>
|
#include <X11/XF86keysym.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONFIG_ZLIB
|
#if HAVE_ZLIB
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -424,7 +424,7 @@ static void vo_x11_update_screeninfo(struct vo *vo)
|
|||||||
opts->screenwidth = x11->ws_width;
|
opts->screenwidth = x11->ws_width;
|
||||||
opts->screenheight = x11->ws_height;
|
opts->screenheight = x11->ws_height;
|
||||||
}
|
}
|
||||||
#ifdef CONFIG_XINERAMA
|
#if HAVE_XINERAMA
|
||||||
if (opts->screen_id >= -1 && XineramaIsActive(x11->display) && !all_screens)
|
if (opts->screen_id >= -1 && XineramaIsActive(x11->display) && !all_screens)
|
||||||
{
|
{
|
||||||
int screen = opts->fullscreen ? opts->fsscreen_id : opts->screen_id;
|
int screen = opts->fullscreen ? opts->fsscreen_id : opts->screen_id;
|
||||||
@ -974,7 +974,7 @@ static void vo_x11_update_window_title(struct vo *vo)
|
|||||||
vo_x11_set_property_utf8(vo, x11->XA_NET_WM_ICON_NAME, title);
|
vo_x11_set_property_utf8(vo, x11->XA_NET_WM_ICON_NAME, title);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if CONFIG_ZLIB
|
#if HAVE_ZLIB
|
||||||
static bstr decompress_gz(bstr in)
|
static bstr decompress_gz(bstr in)
|
||||||
{
|
{
|
||||||
bstr res = {0};
|
bstr res = {0};
|
||||||
@ -1530,7 +1530,7 @@ static void xscreensaver_heartbeat(struct vo_x11_state *x11)
|
|||||||
|
|
||||||
static int xss_suspend(Display *mDisplay, Bool suspend)
|
static int xss_suspend(Display *mDisplay, Bool suspend)
|
||||||
{
|
{
|
||||||
#ifndef CONFIG_XSS
|
#if !HAVE_XSS
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
int event, error, major, minor;
|
int event, error, major, minor;
|
||||||
@ -1552,7 +1552,7 @@ static void saver_on(struct vo_x11_state *x11)
|
|||||||
x11->screensaver_off = 0;
|
x11->screensaver_off = 0;
|
||||||
if (xss_suspend(mDisplay, False))
|
if (xss_suspend(mDisplay, False))
|
||||||
return;
|
return;
|
||||||
#ifdef CONFIG_XDPMS
|
#if HAVE_XEXT
|
||||||
if (x11->dpms_disabled) {
|
if (x11->dpms_disabled) {
|
||||||
int nothing;
|
int nothing;
|
||||||
if (DPMSQueryExtension(mDisplay, ¬hing, ¬hing)) {
|
if (DPMSQueryExtension(mDisplay, ¬hing, ¬hing)) {
|
||||||
@ -1587,7 +1587,7 @@ static void saver_off(struct vo_x11_state *x11)
|
|||||||
x11->screensaver_off = 1;
|
x11->screensaver_off = 1;
|
||||||
if (xss_suspend(mDisplay, True))
|
if (xss_suspend(mDisplay, True))
|
||||||
return;
|
return;
|
||||||
#ifdef CONFIG_XDPMS
|
#if HAVE_XEXT
|
||||||
if (DPMSQueryExtension(mDisplay, ¬hing, ¬hing)) {
|
if (DPMSQueryExtension(mDisplay, ¬hing, ¬hing)) {
|
||||||
BOOL onoff;
|
BOOL onoff;
|
||||||
CARD16 state;
|
CARD16 state;
|
||||||
@ -1636,7 +1636,7 @@ static void vo_x11_selectinput_witherr(struct vo *vo,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_XF86VM
|
#if HAVE_XF86VM
|
||||||
double vo_x11_vm_get_fps(struct vo *vo)
|
double vo_x11_vm_get_fps(struct vo *vo)
|
||||||
{
|
{
|
||||||
struct vo_x11_state *x11 = vo->x11;
|
struct vo_x11_state *x11 = vo->x11;
|
||||||
@ -1648,7 +1648,7 @@ double vo_x11_vm_get_fps(struct vo *vo)
|
|||||||
XFree(modeline.private);
|
XFree(modeline.private);
|
||||||
return 1e3 * clock / modeline.htotal / modeline.vtotal;
|
return 1e3 * clock / modeline.htotal / modeline.vtotal;
|
||||||
}
|
}
|
||||||
#else /* CONFIG_XF86VM */
|
#else /* HAVE_XF86VM */
|
||||||
double vo_x11_vm_get_fps(struct vo *vo)
|
double vo_x11_vm_get_fps(struct vo *vo)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user