Debian Codegraph @

src/avisynth/avssources.h

raw symbols SCIP
1 // Copyright (c) 2007-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 FFAVSSOURCES_H
22 #define FFAVSSOURCES_H
23
24 #include <vector>
25 #ifdef _WIN32
26 #include <windows.h>
27 #endif
28 #include <avisynth.h>
29 #include "ffms.h"
30
31 struct ErrorInfo : FFMS_ErrorInfo {
32 char ErrorBuffer[1024];
33 ErrorInfo() {
34 Buffer = ErrorBuffer;
35 BufferSize = sizeof(ErrorBuffer);
36 }
37 };
38
39 class AvisynthVideoSource : public IClip {
40 VideoInfo VI;
41 bool HighBitDepth;
42 FFMS_VideoSource *V;
43 int64_t FPSNum;
44 int64_t FPSDen;
45 const char *VarPrefix;
46 bool has_at_least_v8;
47
48 void InitOutputFormat(int ResizeToWidth, int ResizeToHeight,
49 const char *ResizerName, const char *ConvertToFormatName, IScriptEnvironment *Env);
50 void OutputFrame(const FFMS_Frame *Frame, PVideoFrame &Dst, IScriptEnvironment *Env);
51 void OutputField(const FFMS_Frame *Frame, PVideoFrame &Dst, int Field, IScriptEnvironment *Env);
52 public:
53 AvisynthVideoSource(const char *SourceFile, int Track, FFMS_Index *Index,
54 int FPSNum, int FPSDen, int Threads, int SeekMode,
55 int ResizeToWidth, int ResizeToHeight, const char *ResizerName,
56 const char *ConvertToFormatName, const char *VarPrefix, IScriptEnvironment* Env);
57 ~AvisynthVideoSource();
58 bool __stdcall GetParity(int n);
59 int __stdcall SetCacheHints(int cachehints, int frame_range) { return 0; }
60 const VideoInfo& __stdcall GetVideoInfo() { return VI; }
61 void __stdcall GetAudio(void* Buf, int64_t Start, int64_t Count, IScriptEnvironment *Env) {}
62 PVideoFrame __stdcall GetFrame(int n, IScriptEnvironment *Env);
63 };
64
65 class AvisynthAudioSource : public IClip {
66 VideoInfo VI;
67 FFMS_AudioSource *A;
68 public:
69 AvisynthAudioSource(const char *SourceFile, int Track, FFMS_Index *Index,
70 int AdjustDelay, int FillGaps, double DrcScale, const char *VarPrefix, IScriptEnvironment* Env);
71 ~AvisynthAudioSource();
72 bool __stdcall GetParity(int n) { return false; }
73 int __stdcall SetCacheHints(int cachehints, int frame_range) { return 0; }
74 const VideoInfo& __stdcall GetVideoInfo() { return VI; }
75 void __stdcall GetAudio(void* Buf, int64_t Start, int64_t Count, IScriptEnvironment *Env);
76 PVideoFrame __stdcall GetFrame(int n, IScriptEnvironment *Env) { return nullptr; };
77 };
78
79 #endif