-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathlsmashsource.c
More file actions
90 lines (81 loc) · 4.81 KB
/
Copy pathlsmashsource.c
File metadata and controls
90 lines (81 loc) · 4.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*****************************************************************************
* lsmashsource.c
*****************************************************************************
* Copyright (C) 2013-2015 L-SMASH Works project
*
* Authors: Yusuke Nakamura <muken.the.vfrmaniac@gmail.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*****************************************************************************/
/* This file is available under an ISC license.
* However, when distributing its binary file, it will be under LGPL or GPL. */
#include <stdarg.h>
#include "../common/cpp_compat.h"
#include "lsmashsource.h"
// #include "version.h"
void set_error(lw_log_handler_t* lhp, lw_log_level level, const char* message)
{
vs_basic_handler_t* eh = (vs_basic_handler_t*)lhp->priv;
if (!eh || !eh->vsapi)
return;
if (eh->out)
eh->vsapi->mapSetError(eh->out, message);
else if (eh->frame_ctx)
eh->vsapi->setFilterError(message, eh->frame_ctx);
}
void set_error_on_init(VSMap* out, const VSAPI* vsapi, const char* format, ...)
{
char message[4096];
va_list args;
va_start(args, format);
vsnprintf(message, sizeof message, format, args);
va_end(args);
vsapi->mapSetError(out, message);
}
extern void VS_CC vs_libavsmashsource_create(const VSMap* in, VSMap* out, void* user_data, VSCore* core, const VSAPI* vsapi);
extern void VS_CC vs_lwlibavsource_create(const VSMap* in, VSMap* out, void* user_data, VSCore* core, const VSAPI* vsapi);
extern void VS_CC vs_libavsmashaudiosource_create(const VSMap* in, VSMap* out, void* user_data, VSCore* core, const VSAPI* vsapi);
extern void VS_CC vs_lwlibavaudiosource_create(const VSMap* in, VSMap* out, void* user_data, VSCore* core, const VSAPI* vsapi);
/*void VS_CC vs_version_create( const VSMap *in, VSMap *out, void *user_data, VSCore *core, const VSAPI *vsapi )
{
vsapi->propSetData(out, "version", VERSION, -1, paAppend);
vsapi->propSetData(out, "config", config_opts, -1, paAppend);
vsapi->propSetData(out, "ffmpeg_version", FFMPEG_VERSION, -1, paAppend);
vsapi->propSetData(out, "ffmpeg_version", LIBAVCODEC_IDENT, -1, paAppend);
vsapi->propSetData(out, "ffmpeg_version", LIBAVFORMAT_IDENT, -1, paAppend);
vsapi->propSetData(out, "ffmpeg_version", LIBAVUTIL_IDENT, -1, paAppend);
vsapi->propSetData(out, "ffmpeg_version", LIBSWSCALE_IDENT, -1, paAppend);
}*/
VS_EXTERNAL_API(void) VapourSynthPluginInit2(VSPlugin* plugin, const VSPLUGINAPI* vspapi)
{
vspapi->configPlugin("systems.innocent.lsmas", "lsmas", "LSMASHSource for VapourSynth",
VS_MAKE_VERSION(1, 0), VAPOURSYNTH_API_VERSION, 0, plugin);
#define COMMON_OPTS \
"threads:int:opt;seek_mode:int:opt;seek_threshold:int:opt;dr:int:opt;fpsnum:int:opt;fpsden:int:opt;variable:int:opt;format:data:opt;" \
"decoder:data:opt;prefer_hw:int:opt;"
vspapi->registerFunction("LibavSMASHSource", "source:data;track:int:opt;" COMMON_OPTS "ff_loglevel:int:opt;ff_options:data:opt;",
"clip:vnode;", vs_libavsmashsource_create, NULL, plugin);
vspapi->registerFunction("LibavSMASHAudioSource",
"source:data;track:int:opt;skip_priming:int:opt;layout:data:opt;rate:int:opt;decoder:data:opt;ff_loglevel:int:opt;drc_scale:"
"float:opt;ff_options:data:opt;skip_tail:int:opt;",
"audio:anode;", vs_libavsmashaudiosource_create, NULL, plugin);
vspapi->registerFunction("LWLibavSource",
"source:data;stream_index:int:opt;cache:int:opt;cachefile:data:opt;" COMMON_OPTS
"repeat:int:opt;dominance:int:opt;ff_loglevel:int:opt;cachedir:data:opt;ff_options:data:opt;rap_verification:int:opt;",
"clip:vnode;", vs_lwlibavsource_create, NULL, plugin);
vspapi->registerFunction("LWLibavAudioSource",
"source:data;stream_index:int:opt;cache:int:opt;cachefile:data:opt;av_sync:int:opt;layout:data:opt;rate:int:opt;decoder:data:opt;"
"ff_loglevel:int:opt;cachedir:data:opt;indexingpr:int:opt;drc_scale:float:opt;ff_options:data:opt;fill_agaps:int:opt;",
"audio:anode;", vs_lwlibavaudiosource_create, NULL, plugin);
#undef COMMON_OPTS
}