mirror of
https://github.com/mpv-player/mpv
synced 2024-12-28 01:52:19 +00:00
0e09533c73
Most contributors have agreed. vo.c requires a "driver" entry for each video output - we assume that if someone who didn't agree to LGPL added a line, it's fine for vo.c to be LGPL anyway. If the affected video output is not disabled at compilation time, the resulting binary will be GPL anyway. One problem are the changes by Nick Kurshev (usually using "nick" as SVN username). He could not be reached. I believe all changes to his files are actually gone, but here is a detailed listing:fa1d5742bc
: nick introduces a new VO API. It was removed in64bedd9683
. Some of this was replaced by VOCTRLs are introduced in7c51652a1b
, obviously replacing at least some functionality by his API.b587a3d642
: nick adds a vo_tune_info_t struct. Removed in64bedd9683
too.9caad2c29a
: nick adds some VOCTRLs, which were silently removed in8cc5ba5ab8
(they became unused probably with the VIDIX removal).340183b0e9
: nick adds VO-based screenshots, which got removed in2f4b840f62
. Strangely the same name was introduced in01cf896a2f
again, but this is a coincidence and worked differently (also it was removed yet again in2858232220
).104c125e6d
: nick adds an option for "direct rendering". It was renamed in6403904ae9
and fully removed ine48b21dd87
.5ddd8e92a1
: nick adds code to check the VO driver preinit arg to every single VO driver. The argument itself and any possibly remaining code associated with it was removed in1f5ffe7d30
.f6878753fb
: nick adds header inclusion guards. We assume this is not relevant for copyright. Some of nick's code was merely moved to other files, such as the equalizer stuff added in555c676683
and moved in4db72f6a80
and12579136ff
, and don't affect copyright of these files anymore. Other notes:fef7b17c34
: a patch by someone who wasn't asked for relicensing added a symbol that was removed again in1b09f4633
.4a8a46fafd
: author probably didn't agree to LGPL, but the function signature was changed later on anyway, and nothing of this is left.7b25afd742
: the same author adds a symbol to what is vo.h today, which this relicensing commit removes, as it was unused. (It's not clear whether the mere symbol is copyrightable, but no need to take a risk.)3a406e94d7
,9dd8f241ac
: slave mode things by someone who couldn't be reached. This aspect of the old slave mode was completely removed.bbeb54d80a
: patch by someone who was not asked, but the added code was completely removed again.
106 lines
2.5 KiB
C
106 lines
2.5 KiB
C
/*
|
|
* based on video_out_null.c from mpeg2dec
|
|
*
|
|
* Copyright (C) Aaron Holtzman - June 2000
|
|
*
|
|
* This file is part of mpv.
|
|
*
|
|
* mpv is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
*
|
|
* mpv is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with mpv. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#include <stdlib.h>
|
|
#include "common/msg.h"
|
|
#include "vo.h"
|
|
#include "video/mp_image.h"
|
|
#include "osdep/timer.h"
|
|
#include "options/m_option.h"
|
|
|
|
struct priv {
|
|
int64_t last_vsync;
|
|
|
|
double cfg_fps;
|
|
};
|
|
|
|
static void draw_image(struct vo *vo, mp_image_t *mpi)
|
|
{
|
|
talloc_free(mpi);
|
|
}
|
|
|
|
static void flip_page(struct vo *vo)
|
|
{
|
|
struct priv *p = vo->priv;
|
|
if (p->cfg_fps) {
|
|
int64_t ft = 1e6 / p->cfg_fps;
|
|
int64_t prev_vsync = mp_time_us() / ft;
|
|
int64_t target_time = (prev_vsync + 1) * ft;
|
|
for (;;) {
|
|
int64_t now = mp_time_us();
|
|
if (now >= target_time)
|
|
break;
|
|
mp_sleep_us(target_time - now);
|
|
}
|
|
}
|
|
}
|
|
|
|
static int query_format(struct vo *vo, int format)
|
|
{
|
|
return 1;
|
|
}
|
|
|
|
static int reconfig(struct vo *vo, struct mp_image_params *params)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static void uninit(struct vo *vo)
|
|
{
|
|
}
|
|
|
|
static int preinit(struct vo *vo)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static int control(struct vo *vo, uint32_t request, void *data)
|
|
{
|
|
struct priv *p = vo->priv;
|
|
switch (request) {
|
|
case VOCTRL_GET_DISPLAY_FPS:
|
|
if (!p->cfg_fps)
|
|
break;
|
|
*(double *)data = p->cfg_fps;
|
|
return VO_TRUE;
|
|
}
|
|
return VO_NOTIMPL;
|
|
}
|
|
|
|
#define OPT_BASE_STRUCT struct priv
|
|
const struct vo_driver video_out_null = {
|
|
.description = "Null video output",
|
|
.name = "null",
|
|
.preinit = preinit,
|
|
.query_format = query_format,
|
|
.reconfig = reconfig,
|
|
.control = control,
|
|
.draw_image = draw_image,
|
|
.flip_page = flip_page,
|
|
.uninit = uninit,
|
|
.priv_size = sizeof(struct priv),
|
|
.options = (const struct m_option[]) {
|
|
OPT_DOUBLE("fps", cfg_fps, M_OPT_RANGE, .min = 0, .max = 10000),
|
|
{0},
|
|
},
|
|
.options_prefix = "vo-null",
|
|
};
|