问题
I'm trying to set up a subtitles file to DirectShow VSFilter programmatically. There is a way to do so through its property pages but I can't find any documentation regarding its API or even if it has one.
Is there any sort of API, Interop, anything which would allow to set up a subtitle file for VSFilter?
回答1:
There is no specific documentation on VSFilter, however it's open source software. So you can download source code, reference its interface definition e.g. in MPC-HC source \Mpc-hc\src\filters\transform\vsfilter\IDirectVobSub.h
and use the interface to control the filter programmatically.
interface __declspec(uuid("EBE1FB08-3957-47ca-AF13-5827E5442E56"))
IDirectVobSub : public IUnknown
{
STDMETHOD(get_FileName) (THIS_
WCHAR* fn // fn should point to a buffer allocated to at
// least the length of MAX_PATH (=260)
) PURE;
STDMETHOD(put_FileName) (THIS_
WCHAR* fn
) PURE;
// ...
来源:https://stackoverflow.com/questions/25179308/is-there-any-way-to-control-directshow-vsfilter-programmatically