| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 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 |