Debian Codegraph @

src/vapoursynth/vapoursource4.h

raw symbols SCIP
1 // Copyright (c) 2012-2017 Fredrik Mellbin
2 //
3 // Permission is hereby granted, free of charge, to any person obtaining a copy
4 // of this software and associated documentation files (the "Software"), to deal
5 // in the Software without restriction, including without limitation the rights
6 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 // copies of the Software, and to permit persons to whom the Software is
8 // furnished to do so, subject to the following conditions:
9 //
10 // The above copyright notice and this permission notice shall be included in
11 // all copies or substantial portions of the Software.
12 //
13 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 // THE SOFTWARE.
20
21 #ifndef FFVAPOURSOURCES_H
22 #define FFVAPOURSOURCES_H
23
24 extern "C" {
25 #include <libavutil/avutil.h>
26 #include <libavutil/common.h>
27 #include <libavutil/pixdesc.h>
28 #include <libavcodec/avcodec.h>
29 #include <libavformat/avformat.h>
30 #include <libswscale/swscale.h>
31 }
32
33 #include "VapourSynth4.h"
34 #include "ffms.h"
35 #include "ffmscompat.h"
36
37 struct VSVideoSource4 {
38 private:
39 VSVideoInfo VI[2];
40 FFMS_VideoSource *V;
41 int64_t FPSNum;
42 int64_t FPSDen;
43 int SARNum;
44 int SARDen;
45 bool OutputAlpha;
46 int LastFrame = -1;
47 int CacheThreshold = 0;
48
49 void InitOutputFormat(int ResizeToWidth, int ResizeToHeight,
50 const char *ResizerName, int ConvertToFormat, const VSAPI *vsapi, VSCore *core);
51 static void OutputFrame(const FFMS_Frame *Frame, VSFrame *Dst, const VSAPI *vsapi);
52 static void OutputAlphaFrame(const FFMS_Frame *Frame, int Plane, VSFrame *Dst, const VSAPI *vsapi);
53 public:
54 VSVideoSource4(const char *SourceFile, int Track, FFMS_Index *Index,
55 int AFPSNum, int AFPSDen, int Threads, int SeekMode,
56 int ResizeToWidth, int ResizeToHeight, const char *ResizerName,
57 int Format, bool OutputAlpha, const VSAPI *vsapi, VSCore *core);
58 ~VSVideoSource4();
59
60 const VSVideoInfo *GetVideoInfo() const;
61 void SetCacheThreshold(int threshold);
62
63 static void VS_CC Init(VSMap *in, VSMap *out, void **instanceData, VSNode *node, VSCore *core, const VSAPI *vsapi);
64 const VSFrame *VS_CC GetVSFrame(int n, VSCore *core, const VSAPI *vsapi);
65 static const VSFrame *VS_CC GetFrame(int n, int activationReason, void *instanceData, void **frameData, VSFrameContext *frameCtx, VSCore *core, const VSAPI *vsapi);
66 static void VS_CC Free(void *instanceData, VSCore *core, const VSAPI *vsapi);
67 };
68
69 #endif