diff options
author | drevil_xxl <drevil_xxl@users.sourceforge.net> | 2008-03-07 22:50:44 +0300 |
---|---|---|
committer | drevil_xxl <drevil_xxl@users.sourceforge.net> | 2008-03-07 22:50:44 +0300 |
commit | 5c75fabc94d28c035045de5d7148c38fe430aaf3 (patch) | |
tree | 33108b7ff3dea43ee193522714afc6a9fdb040be /src/filters/transform/vsfilter/plugins.cpp | |
parent | f67604ab2458d5d7dcb6b6b1b098e9a320b47c6b (diff) |
Save to .srt subtitle fix concerning italics.
MPC: Automatically block DirectVobSub filter (VSFilter) when the internal subtitle renderer will be used.
Updated ffmpeg.
VSFilter: Added MaskSub function for use with Avisynth. Patch by VinyJones.
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@438 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters/transform/vsfilter/plugins.cpp')
-rw-r--r-- | src/filters/transform/vsfilter/plugins.cpp | 55 |
1 files changed, 53 insertions, 2 deletions
diff --git a/src/filters/transform/vsfilter/plugins.cpp b/src/filters/transform/vsfilter/plugins.cpp index 7101a7198..3fc8a45f8 100644 --- a/src/filters/transform/vsfilter/plugins.cpp +++ b/src/filters/transform/vsfilter/plugins.cpp @@ -520,7 +520,7 @@ namespace AviSynth1 dst.bits = (void**)frame->GetWritePtr();
dst.bpp = vi.BitsPerPixel();
dst.type =
- vi.IsRGB32() ? MSP_RGB32 :
+ vi.IsRGB32() ? ( env->GetVar("RGBA").AsBool() ? MSP_RGBA :MSP_RGB32) :
vi.IsRGB24() ? MSP_RGB24 :
vi.IsYUY2() ? MSP_YUY2 :
-1;
@@ -577,12 +577,37 @@ namespace AviSynth1 return(new CTextSubAvisynthFilter(args[0].AsClip(), env, args[1].AsString(), args[2].AsInt(), args[3].AsFloat()));
}
+ AVSValue __cdecl MaskSubCreateSIIFI(AVSValue args, void* user_data, IScriptEnvironment* env)
+ {
+ AVSValue rgb32("RGB32");
+ AVSValue tab[5] = {
+ args[1],
+ args[2],
+ args[3],
+ args[4],
+ rgb32
+ };
+ AVSValue value(tab,5);
+ const char * nom[5]={
+ "width",
+ "height",
+ "fps",
+ "length",
+ "pixel_type"
+ };
+ AVSValue clip(env->Invoke("Blackness",value,nom));
+ env->SetVar("RGBA",true);
+ return(new CTextSubAvisynthFilter(clip.AsClip(), env, args[0].AsString()));
+ }
+
extern "C" __declspec(dllexport) const char* __stdcall AvisynthPluginInit(IScriptEnvironment* env)
{
env->AddFunction("VobSub", "cs", VobSubCreateS, 0);
env->AddFunction("TextSub", "cs", TextSubCreateS, 0);
env->AddFunction("TextSub", "csi", TextSubCreateSI, 0);
env->AddFunction("TextSub", "csif", TextSubCreateSIF, 0);
+ env->AddFunction("MaskSub", "siifi", MaskSubCreateSIIFI, 0);
+ env->SetVar("RGBA",false);
return(NULL);
}
}
@@ -614,7 +639,7 @@ namespace AviSynth25 dst.bitsV = frame->GetWritePtr(PLANAR_V);
dst.bpp = dst.pitch/dst.w*8; //vi.BitsPerPixel();
dst.type =
- vi.IsRGB32() ? MSP_RGB32 :
+ vi.IsRGB32() ?( env->GetVar("RGBA").AsBool() ? MSP_RGBA : MSP_RGB32) :
vi.IsRGB24() ? MSP_RGB24 :
vi.IsYUY2() ? MSP_YUY2 :
/*vi.IsYV12()*/ vi.pixel_type == VideoInfo::CS_YV12 ? (s_fSwapUV?MSP_IYUV:MSP_YV12) :
@@ -679,6 +704,30 @@ namespace AviSynth25 return(AVSValue());
}
+ AVSValue __cdecl MaskSubCreateSIIFI(AVSValue args, void* user_data, IScriptEnvironment* env)
+ {
+ AVSValue rgb32("RGB32");
+ AVSValue tab[5] = {
+ args[1],
+ args[2],
+ args[3],
+ args[4],
+ rgb32
+ };
+ AVSValue value(tab,5);
+ const char * nom[5]={
+ "width",
+ "height",
+ "fps",
+ "length",
+ "pixel_type"
+ };
+ AVSValue clip(env->Invoke("Blackness",value,nom));
+ env->SetVar("RGBA",true);
+ return(new CTextSubAvisynthFilter(clip.AsClip(), env, args[0].AsString()));
+
+ }
+
extern "C" __declspec(dllexport) const char* __stdcall AvisynthPluginInit2(IScriptEnvironment* env)
{
env->AddFunction("VobSub", "cs", VobSubCreateS, 0);
@@ -686,6 +735,8 @@ namespace AviSynth25 env->AddFunction("TextSub", "csi", TextSubCreateSI, 0);
env->AddFunction("TextSub", "csif", TextSubCreateSIF, 0);
env->AddFunction("TextSubSwapUV", "b", TextSubSwapUV, 0);
+ env->AddFunction("MaskSub", "siifi", MaskSubCreateSIIFI, 0);
+ env->SetVar("RGBA",false);
return(NULL);
}
}
|