3s3s / lavfilters

Automatically exported from code.google.com/p/lavfilters
GNU General Public License v2.0
0 stars 0 forks source link

(SPLITTER) List and selection of available subtitle streams #201

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm implementing a media player that uses solely LAV filters and I'm using a 
custom EVR presenter.

I have my own filter to connect to the Subtitle pin.

The media player is done in C# / WPF and to access the splitter I'm using the 
COM interface.

However there is no method to get or set the subtitle streams in it.

Some methods like these would be very good:

STDMETHOD(GetSubtitleStreamNames)(WCHAR ***pppStreamNames) = 0; // or something 
that can be converted to string[] since I'm not very familiar with C++

and 

STDMETHOD(SetSubtitleStream)(WCHAR *pStreamName) = 0;

This would allow me to provide to the user visually a list of subtitles and 
allow him to select one manually.

Please add these to a future version of LAV.

Follows the C# COM interface declaration as it is now:

    public enum LAVSubtitleMode
    {
        LAVSubtitleMode_NoSubs = 0,
        LAVSubtitleMode_ForcedOnly,
        LAVSubtitleMode_Default,
        LAVSubtitleMode_Advanced
    };

    [ComVisible(true), ComImport, SuppressUnmanagedCodeSecurity,
     Guid("774A919D-EA95-4A87-8A1E-F48ABE8499C7"),
     InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    public interface ILAVFSettings
    {
        [PreserveSig]
        int SetRuntimeConfig(bool runtime);

        [PreserveSig]
        int GetPreferredLanguages([MarshalAs(UnmanagedType.LPWStr)]out string langs);

        [PreserveSig]
        int SetPreferredLanguages([MarshalAs(UnmanagedType.LPWStr)]string langs);

        [PreserveSig]
        int GetPreferredSubtitleLanguages([MarshalAs(UnmanagedType.LPWStr)]out string langs);

        [PreserveSig]
        int SetPreferredSubtitleLanguages([MarshalAs(UnmanagedType.LPWStr)]string langs);

        [PreserveSig]
        LAVSubtitleMode GetSubtitleMode();

        [PreserveSig]
        int SetSubtitleMode(LAVSubtitleMode mode);

        [PreserveSig]
        bool GetSubtitleMatchingLanguage();

        [PreserveSig]
        int SetSubtitleMatchingLanguage(bool mode);

        [PreserveSig]
        bool GetPGSForcedStream();

        [PreserveSig]
        int SetPGSForcedStream(bool enabled);

        [PreserveSig]
        bool GetPGSOnlyForced();

        [PreserveSig]
        int SetPGSOnlyForced(bool forced);

        [PreserveSig]
        int GetVC1TimestampMode();

        [PreserveSig]
        int SetVC1TimestampMode(short enabled);

        [PreserveSig]
        int SetSubstreamsEnabled(bool enabled);

        [PreserveSig]
        bool GetSubstreamsEnabled();

        [PreserveSig]
        int SetVideoParsingEnabled(bool enabled);

        [PreserveSig]
        bool GetVideoParsingEnabled();

        [PreserveSig]
        int SetFixBrokenHDPVR(bool enabled);

        [PreserveSig]
        bool GetFixBrokenHDPVR();

        [PreserveSig]
        int SetFormatEnabled([MarshalAs(UnmanagedType.LPWStr)]string strFormat, bool bEnabled);

        [PreserveSig]
        bool IsFormatEnabled([MarshalAs(UnmanagedType.LPWStr)]string strFormat);

        [PreserveSig]
        int SetStreamSwitchRemoveAudio(bool enabled);

        [PreserveSig]
        bool GetStreamSwitchRemoveAudio();

        [PreserveSig]
        int GetAdvancedSubtitleConfig([MarshalAs(UnmanagedType.LPWStr)]out string ec);

        [PreserveSig]
        int SetAdvancedSubtitleConfig([MarshalAs(UnmanagedType.LPWStr)]string config);

    }

Original issue reported on code.google.com by marino.simic@gmail.com on 23 Feb 2012 at 9:17

GoogleCodeExporter commented 9 years ago
I'm willing to provide further feedback and support development with adding 
programming usage samples to this project.

If you are interested contact me at marino.simic AT gmail.com

Original comment by marino.simic@gmail.com on 23 Feb 2012 at 9:20

GoogleCodeExporter commented 9 years ago
You can query the list of streams through several interfaces.

There is for example ITrackInfo (see the ITrackInfo.h in the developer_info 
dir), or even the "official" interface IAMStreamSelect, which also exposes 
names of the streams (and is required to change the stream )
http://msdn.microsoft.com/en-us/library/windows/desktop/dd319793(v=vs.85).aspx

Original comment by h.lepp...@gmail.com on 23 Feb 2012 at 9:30

GoogleCodeExporter commented 9 years ago
Note that for IAMStreamSelect::Info, the subtitle streams will all have the 
pdwGroup parameter set to 2 (Video is 0, Audio is 1)

Original comment by h.lepp...@gmail.com on 23 Feb 2012 at 9:32

GoogleCodeExporter commented 9 years ago
Thank you very much. I did not see the TrackInfo interface before.

These methods are all I need! You can close this request!

    STDMETHOD_(UINT, GetTrackCount) () = 0;

    // \param aTrackIdx the track index (from 0 to GetTrackCount()-1)
    STDMETHOD_(BOOL, GetTrackInfo) (UINT aTrackIdx, struct TrackElement* pStructureToFill) = 0;

    // Get an extended information struct relative to the track type
    STDMETHOD_(BOOL, GetTrackExtendedInfo) (UINT aTrackIdx, void* pStructureToFill) = 0;

    STDMETHOD_(BSTR, GetTrackCodecID) (UINT aTrackIdx) = 0;
    STDMETHOD_(BSTR, GetTrackName) (UINT aTrackIdx) = 0;
    STDMETHOD_(BSTR, GetTrackCodecName) (UINT aTrackIdx) = 0;
    STDMETHOD_(BSTR, GetTrackCodecInfoURL) (UINT aTrackIdx) = 0;
    STDMETHOD_(BSTR, GetTrackCodecDownloadURL) (UINT aTrackIdx) = 0;

Original comment by marino.simic@gmail.com on 23 Feb 2012 at 10:04

GoogleCodeExporter commented 9 years ago

Original comment by h.lepp...@gmail.com on 24 Feb 2012 at 5:30