mirror of https://github.com/mpv-player/mpv
build: make encoding mode non-optional
Makes it easier to not break the build by confusing the ifdeffery.
This commit is contained in:
parent
0ab3184526
commit
e02c9b9902
|
@ -93,9 +93,7 @@ static const struct ao_driver * const audio_out_drivers[] = {
|
||||||
&audio_out_coreaudio_exclusive,
|
&audio_out_coreaudio_exclusive,
|
||||||
#endif
|
#endif
|
||||||
&audio_out_pcm,
|
&audio_out_pcm,
|
||||||
#if HAVE_ENCODING
|
|
||||||
&audio_out_lavc,
|
&audio_out_lavc,
|
||||||
#endif
|
|
||||||
#if HAVE_RSOUND
|
#if HAVE_RSOUND
|
||||||
&audio_out_rsound,
|
&audio_out_rsound,
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -758,9 +758,7 @@ const m_option_t mp_opts[] = {
|
||||||
OPT_SUBSTRUCT("vaapi", vaapi_opts, vaapi_conf, 0),
|
OPT_SUBSTRUCT("vaapi", vaapi_opts, vaapi_conf, 0),
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_ENCODING
|
|
||||||
OPT_SUBSTRUCT("", encode_opts, encode_config, 0),
|
OPT_SUBSTRUCT("", encode_opts, encode_config, 0),
|
||||||
#endif
|
|
||||||
|
|
||||||
OPT_REMOVED("a52drc", "use --ad-lavc-ac3drc=level"),
|
OPT_REMOVED("a52drc", "use --ad-lavc-ac3drc=level"),
|
||||||
OPT_REMOVED("afm", "use --ad=..."),
|
OPT_REMOVED("afm", "use --ad=..."),
|
||||||
|
|
|
@ -555,9 +555,7 @@ static int write_to_ao(struct MPContext *mpctx, uint8_t **planes, int samples,
|
||||||
int format;
|
int format;
|
||||||
struct mp_chmap channels;
|
struct mp_chmap channels;
|
||||||
ao_get_format(ao, &samplerate, &format, &channels);
|
ao_get_format(ao, &samplerate, &format, &channels);
|
||||||
#if HAVE_ENCODING
|
|
||||||
encode_lavc_set_audio_pts(mpctx->encode_lavc_ctx, playing_audio_pts(mpctx));
|
encode_lavc_set_audio_pts(mpctx->encode_lavc_ctx, playing_audio_pts(mpctx));
|
||||||
#endif
|
|
||||||
if (samples == 0)
|
if (samples == 0)
|
||||||
return 0;
|
return 0;
|
||||||
double real_samplerate = samplerate / mpctx->audio_speed;
|
double real_samplerate = samplerate / mpctx->audio_speed;
|
||||||
|
|
|
@ -1300,16 +1300,14 @@ reopen_file:
|
||||||
|
|
||||||
update_demuxer_properties(mpctx);
|
update_demuxer_properties(mpctx);
|
||||||
|
|
||||||
#if HAVE_ENCODING
|
|
||||||
if (mpctx->encode_lavc_ctx && mpctx->current_track[0][STREAM_VIDEO])
|
|
||||||
encode_lavc_expect_stream(mpctx->encode_lavc_ctx, STREAM_VIDEO);
|
|
||||||
if (mpctx->encode_lavc_ctx && mpctx->current_track[0][STREAM_AUDIO])
|
|
||||||
encode_lavc_expect_stream(mpctx->encode_lavc_ctx, STREAM_AUDIO);
|
|
||||||
if (mpctx->encode_lavc_ctx) {
|
if (mpctx->encode_lavc_ctx) {
|
||||||
|
if (mpctx->current_track[0][STREAM_VIDEO])
|
||||||
|
encode_lavc_expect_stream(mpctx->encode_lavc_ctx, STREAM_VIDEO);
|
||||||
|
if (mpctx->current_track[0][STREAM_AUDIO])
|
||||||
|
encode_lavc_expect_stream(mpctx->encode_lavc_ctx, STREAM_AUDIO);
|
||||||
encode_lavc_set_metadata(mpctx->encode_lavc_ctx,
|
encode_lavc_set_metadata(mpctx->encode_lavc_ctx,
|
||||||
mpctx->demuxer->metadata);
|
mpctx->demuxer->metadata);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
update_playback_speed(mpctx);
|
update_playback_speed(mpctx);
|
||||||
|
|
||||||
|
@ -1557,7 +1555,6 @@ void mp_play_files(struct MPContext *mpctx)
|
||||||
|
|
||||||
cancel_open(mpctx);
|
cancel_open(mpctx);
|
||||||
|
|
||||||
#if HAVE_ENCODING
|
|
||||||
if (mpctx->encode_lavc_ctx) {
|
if (mpctx->encode_lavc_ctx) {
|
||||||
// Make sure all streams get finished.
|
// Make sure all streams get finished.
|
||||||
uninit_audio_out(mpctx);
|
uninit_audio_out(mpctx);
|
||||||
|
@ -1568,8 +1565,6 @@ void mp_play_files(struct MPContext *mpctx)
|
||||||
|
|
||||||
mpctx->encode_lavc_ctx = NULL;
|
mpctx->encode_lavc_ctx = NULL;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Abort current playback and set the given entry to play next.
|
// Abort current playback and set the given entry to play next.
|
||||||
|
|
|
@ -164,11 +164,9 @@ void mp_destroy(struct MPContext *mpctx)
|
||||||
uninit_audio_out(mpctx);
|
uninit_audio_out(mpctx);
|
||||||
uninit_video_out(mpctx);
|
uninit_video_out(mpctx);
|
||||||
|
|
||||||
#if HAVE_ENCODING
|
|
||||||
// If it's still set here, it's an error.
|
// If it's still set here, it's an error.
|
||||||
encode_lavc_free(mpctx->encode_lavc_ctx);
|
encode_lavc_free(mpctx->encode_lavc_ctx);
|
||||||
mpctx->encode_lavc_ctx = NULL;
|
mpctx->encode_lavc_ctx = NULL;
|
||||||
#endif
|
|
||||||
|
|
||||||
command_uninit(mpctx);
|
command_uninit(mpctx);
|
||||||
|
|
||||||
|
@ -229,10 +227,8 @@ static bool handle_help_options(struct MPContext *mpctx)
|
||||||
property_print_help(mpctx);
|
property_print_help(mpctx);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#if HAVE_ENCODING
|
|
||||||
if (encode_lavc_showhelp(log, opts->encode_opts))
|
if (encode_lavc_showhelp(log, opts->encode_opts))
|
||||||
return true;
|
return true;
|
||||||
#endif
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -414,7 +410,6 @@ int mp_initialize(struct MPContext *mpctx, char **options)
|
||||||
cocoa_set_mpv_handle(ctx);
|
cocoa_set_mpv_handle(ctx);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_ENCODING
|
|
||||||
if (opts->encode_opts->file && opts->encode_opts->file[0]) {
|
if (opts->encode_opts->file && opts->encode_opts->file[0]) {
|
||||||
mpctx->encode_lavc_ctx = encode_lavc_init(mpctx->global);
|
mpctx->encode_lavc_ctx = encode_lavc_init(mpctx->global);
|
||||||
if(!mpctx->encode_lavc_ctx) {
|
if(!mpctx->encode_lavc_ctx) {
|
||||||
|
@ -424,7 +419,6 @@ int mp_initialize(struct MPContext *mpctx, char **options)
|
||||||
m_config_set_profile(mpctx->mconfig, "encoding", 0);
|
m_config_set_profile(mpctx->mconfig, "encoding", 0);
|
||||||
mp_input_enable_section(mpctx->input, "encode", MP_INPUT_EXCLUSIVE);
|
mp_input_enable_section(mpctx->input, "encode", MP_INPUT_EXCLUSIVE);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !HAVE_LIBASS
|
#if !HAVE_LIBASS
|
||||||
MP_WARN(mpctx, "Compiled without libass.\n");
|
MP_WARN(mpctx, "Compiled without libass.\n");
|
||||||
|
|
|
@ -198,7 +198,6 @@ static char *get_term_status_msg(struct MPContext *mpctx)
|
||||||
saddf(&line, " ct:%7.3f", mpctx->total_avsync_change);
|
saddf(&line, " ct:%7.3f", mpctx->total_avsync_change);
|
||||||
}
|
}
|
||||||
|
|
||||||
#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),
|
||||||
|
@ -206,9 +205,7 @@ static char *get_term_status_msg(struct MPContext *mpctx)
|
||||||
{
|
{
|
||||||
// encoding stats
|
// encoding stats
|
||||||
saddf(&line, " %s", lavcbuf);
|
saddf(&line, " %s", lavcbuf);
|
||||||
} else
|
} else {
|
||||||
#endif
|
|
||||||
{
|
|
||||||
// VO stats
|
// VO stats
|
||||||
if (mpctx->vo_chain) {
|
if (mpctx->vo_chain) {
|
||||||
if (mpctx->display_sync_active) {
|
if (mpctx->display_sync_active) {
|
||||||
|
|
|
@ -227,9 +227,7 @@ void reset_playback_state(struct MPContext *mpctx)
|
||||||
mpctx->cache_buffer = 100;
|
mpctx->cache_buffer = 100;
|
||||||
mpctx->seek_slave = NULL;
|
mpctx->seek_slave = NULL;
|
||||||
|
|
||||||
#if HAVE_ENCODING
|
|
||||||
encode_lavc_discontinuity(mpctx->encode_lavc_ctx);
|
encode_lavc_discontinuity(mpctx->encode_lavc_ctx);
|
||||||
#endif
|
|
||||||
|
|
||||||
update_internal_pause_state(mpctx);
|
update_internal_pause_state(mpctx);
|
||||||
update_core_idle_state(mpctx);
|
update_core_idle_state(mpctx);
|
||||||
|
@ -1067,12 +1065,10 @@ static void handle_eof(struct MPContext *mpctx)
|
||||||
|
|
||||||
void run_playloop(struct MPContext *mpctx)
|
void run_playloop(struct MPContext *mpctx)
|
||||||
{
|
{
|
||||||
#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;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
update_demuxer_properties(mpctx);
|
update_demuxer_properties(mpctx);
|
||||||
|
|
||||||
|
|
|
@ -101,9 +101,7 @@ const struct vo_driver *const video_out_drivers[] =
|
||||||
#if HAVE_DRM
|
#if HAVE_DRM
|
||||||
&video_out_drm,
|
&video_out_drm,
|
||||||
#endif
|
#endif
|
||||||
#if HAVE_ENCODING
|
|
||||||
&video_out_lavc,
|
&video_out_lavc,
|
||||||
#endif
|
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
4
wscript
4
wscript
|
@ -342,10 +342,6 @@ iconv support use --disable-iconv.",
|
||||||
check_statement('zlib.h', 'inflate(0, Z_NO_FLUSH)')),
|
check_statement('zlib.h', 'inflate(0, Z_NO_FLUSH)')),
|
||||||
'req': True,
|
'req': True,
|
||||||
'fmsg': 'Unable to find development files for zlib.'
|
'fmsg': 'Unable to find development files for zlib.'
|
||||||
} , {
|
|
||||||
'name' : '--encoding',
|
|
||||||
'desc' : 'Encoding',
|
|
||||||
'func': check_true,
|
|
||||||
}, {
|
}, {
|
||||||
'name': '--libbluray',
|
'name': '--libbluray',
|
||||||
'desc': 'Bluray support',
|
'desc': 'Bluray support',
|
||||||
|
|
|
@ -241,7 +241,7 @@ def build(ctx):
|
||||||
( "audio/out/ao_coreaudio_utils.c", "audiounit" ),
|
( "audio/out/ao_coreaudio_utils.c", "audiounit" ),
|
||||||
( "audio/out/ao_coreaudio_utils.c", "coreaudio" ),
|
( "audio/out/ao_coreaudio_utils.c", "coreaudio" ),
|
||||||
( "audio/out/ao_jack.c", "jack" ),
|
( "audio/out/ao_jack.c", "jack" ),
|
||||||
( "audio/out/ao_lavc.c", "encoding" ),
|
( "audio/out/ao_lavc.c" ),
|
||||||
( "audio/out/ao_null.c" ),
|
( "audio/out/ao_null.c" ),
|
||||||
( "audio/out/ao_openal.c", "openal" ),
|
( "audio/out/ao_openal.c", "openal" ),
|
||||||
( "audio/out/ao_opensles.c", "opensles" ),
|
( "audio/out/ao_opensles.c", "opensles" ),
|
||||||
|
@ -262,7 +262,7 @@ def build(ctx):
|
||||||
( "common/av_log.c" ),
|
( "common/av_log.c" ),
|
||||||
( "common/codecs.c" ),
|
( "common/codecs.c" ),
|
||||||
( "common/common.c" ),
|
( "common/common.c" ),
|
||||||
( "common/encode_lavc.c", "encoding" ),
|
( "common/encode_lavc.c" ),
|
||||||
( "common/msg.c" ),
|
( "common/msg.c" ),
|
||||||
( "common/playlist.c" ),
|
( "common/playlist.c" ),
|
||||||
( "common/recorder.c" ),
|
( "common/recorder.c" ),
|
||||||
|
@ -484,7 +484,7 @@ def build(ctx):
|
||||||
( "video/out/vo_drm.c", "drm" ),
|
( "video/out/vo_drm.c", "drm" ),
|
||||||
( "video/out/vo_gpu.c" ),
|
( "video/out/vo_gpu.c" ),
|
||||||
( "video/out/vo_image.c" ),
|
( "video/out/vo_image.c" ),
|
||||||
( "video/out/vo_lavc.c", "encoding" ),
|
( "video/out/vo_lavc.c" ),
|
||||||
( "video/out/vo_libmpv.c" ),
|
( "video/out/vo_libmpv.c" ),
|
||||||
( "video/out/vo_mediacodec_embed.c", "android" ),
|
( "video/out/vo_mediacodec_embed.c", "android" ),
|
||||||
( "video/out/vo_null.c" ),
|
( "video/out/vo_null.c" ),
|
||||||
|
@ -730,8 +730,7 @@ def build(ctx):
|
||||||
ctx.env.DATADIR + '/applications',
|
ctx.env.DATADIR + '/applications',
|
||||||
['etc/mpv.desktop'] )
|
['etc/mpv.desktop'] )
|
||||||
|
|
||||||
if ctx.dependency_satisfied('encoding'):
|
ctx.install_files(ctx.env.CONFDIR, ['etc/encoding-profiles.conf'] )
|
||||||
ctx.install_files(ctx.env.CONFDIR, ['etc/encoding-profiles.conf'] )
|
|
||||||
|
|
||||||
for size in '16x16 32x32 64x64'.split():
|
for size in '16x16 32x32 64x64'.split():
|
||||||
ctx.install_as(
|
ctx.install_as(
|
||||||
|
|
Loading…
Reference in New Issue