Support unrar64.dll
[xy_vsfilter.git] / src / subpic / SimpleSubPicProviderImpl.h
blob4418b2ed6c114de3c8aec493b43013f285d925a7
1 #pragma once
3 #include "ISimpleSubPic.h"
4 #include "SubPicQueueImpl.h"
6 interface IDirectVobSubXy;
8 //////////////////////////////////////////////////////////////////////////
9 //
10 // SimpleSubPicProvider
11 //
13 class SimpleSubPicProvider: public CUnknown, public ISimpleSubPicProvider
15 public:
16 SimpleSubPicProvider(int alpha_blt_dst_type, SIZE spd_size, RECT video_rect, IDirectVobSubXy *consumer, HRESULT* phr=NULL);
17 virtual ~SimpleSubPicProvider();
19 DECLARE_IUNKNOWN;
20 STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv);
22 bool LookupSubPicEx(REFERENCE_TIME rtNow, IXySubRenderFrame** sub_render_frame);
23 HRESULT GetSubPicProviderEx(ISubPicProviderEx2** pSubPicProviderEx);
24 HRESULT RenderTo(IXySubRenderFrame** pSubPic, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, double fps, BOOL bIsAnimated);
25 bool IsSpdColorTypeSupported(int type);
26 public:
27 // ISimpleSubPicProvider
29 STDMETHODIMP SetSubPicProvider(IUnknown* subpic_provider);
30 STDMETHODIMP GetSubPicProvider(IUnknown** subpic_provider);
32 STDMETHODIMP SetFPS(double fps);
33 STDMETHODIMP SetTime(REFERENCE_TIME rtNow);
35 STDMETHODIMP Invalidate(REFERENCE_TIME rtInvalidate = -1);
36 STDMETHODIMP_(bool) LookupSubPic(REFERENCE_TIME now /*[in]*/, ISimpleSubPic** output_subpic/*[out]*/);
38 STDMETHODIMP GetStats(int& nSubPics, REFERENCE_TIME& rtNow, REFERENCE_TIME& rtStart, REFERENCE_TIME& rtStop);
39 STDMETHODIMP GetStats(int nSubPic, REFERENCE_TIME& rtStart, REFERENCE_TIME& rtStop);
40 private:
41 CCritSec m_csSubPicProvider;
42 CComPtr<ISubPicProviderEx2> m_pSubPicProviderEx;
44 CAtlList<int> m_prefered_colortype;
45 protected:
46 int m_alpha_blt_dst_type;
47 SIZE m_spd_size;
48 RECT m_video_rect;
49 int m_spd_type;
50 double m_fps;
51 REFERENCE_TIME m_rtNow;
53 CComPtr<ISubPicExAllocator> m_pAllocator;
55 CCritSec m_csLock;
56 REFERENCE_TIME m_subpic_start,m_subpic_stop;
57 CComPtr<IXySubRenderFrame> m_pSubPic;
59 IDirectVobSubXy *m_consumer;
62 //////////////////////////////////////////////////////////////////////////
64 // SimpleSubPicProvider2
65 //
67 class SimpleSubPicProvider2: public CUnknown, public ISimpleSubPicProvider
69 public:
70 SimpleSubPicProvider2(int alpha_blt_dst_type, SIZE max_size, SIZE cur_size, RECT video_rect,
71 IDirectVobSubXy *consumer, HRESULT* phr=NULL);
72 virtual ~SimpleSubPicProvider2();
74 DECLARE_IUNKNOWN;
75 STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv);
76 public:
77 SimpleSubPicProvider2(const SimpleSubPicProvider2&);
78 void operator=(const SimpleSubPicProvider2&)const;
80 // ISimpleSubPicProvider
82 STDMETHODIMP SetSubPicProvider(IUnknown* subpic_provider);
83 STDMETHODIMP GetSubPicProvider(IUnknown** subpic_provider);
85 STDMETHODIMP SetFPS(double fps);
86 STDMETHODIMP SetTime(REFERENCE_TIME rtNow);
88 STDMETHODIMP Invalidate(REFERENCE_TIME rtInvalidate = -1);
89 STDMETHODIMP_(bool) LookupSubPic(REFERENCE_TIME now /*[in]*/, ISimpleSubPic** output_subpic/*[out]*/);
91 STDMETHODIMP GetStats(int& nSubPics, REFERENCE_TIME& rtNow, REFERENCE_TIME& rtStart, REFERENCE_TIME& rtStop);
92 STDMETHODIMP GetStats(int nSubPic, REFERENCE_TIME& rtStart, REFERENCE_TIME& rtStop);
94 protected:
95 int m_alpha_blt_dst_type;
96 SIZE m_max_size;
97 SIZE m_cur_size;
98 RECT m_video_rect;
100 double m_fps;
101 REFERENCE_TIME m_now;
103 ISimpleSubPicProvider *m_cur_provider;
104 SimpleSubPicProvider *m_ex_provider;
105 CSubPicQueueNoThread *m_old_provider;
107 IDirectVobSubXy *m_consumer;