40 ****************************************************************************/ |
40 ****************************************************************************/ |
41 |
41 |
42 #ifndef DIRECTSHOWIOSOURCE_H |
42 #ifndef DIRECTSHOWIOSOURCE_H |
43 #define DIRECTSHOWIOSOURCE_H |
43 #define DIRECTSHOWIOSOURCE_H |
44 |
44 |
|
45 #include "directshowglobal.h" |
45 #include "directshowioreader.h" |
46 #include "directshowioreader.h" |
46 #include "directshowmediatype.h" |
47 #include "directshowmediatype.h" |
47 #include "directshowmediatypelist.h" |
48 #include "directshowmediatypelist.h" |
48 |
49 |
49 QT_BEGIN_NAMESPACE |
50 #include <QtCore/qfile.h> |
50 class QIODevice; |
|
51 QT_END_NAMESPACE |
|
52 |
51 |
53 class DirectShowIOSource |
52 class DirectShowIOSource |
54 : public DirectShowMediaTypeList |
53 : public DirectShowMediaTypeList |
55 , public IBaseFilter |
54 , public IBaseFilter |
56 , public IAMFilterMiscFlags |
55 , public IAMFilterMiscFlags |
57 , public IPin |
56 , public IPin |
58 { |
57 { |
59 public: |
58 public: |
60 DirectShowIOSource(QIODevice *device, DirectShowEventLoop *loop); |
59 DirectShowIOSource(DirectShowEventLoop *loop); |
61 ~DirectShowIOSource(); |
60 ~DirectShowIOSource(); |
62 |
61 |
|
62 void setDevice(QIODevice *device); |
63 void setAllocator(IMemAllocator *allocator); |
63 void setAllocator(IMemAllocator *allocator); |
64 |
64 |
65 // IUnknown |
65 // IUnknown |
66 HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject); |
66 HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject); |
67 ULONG STDMETHODCALLTYPE AddRef(); |
67 ULONG STDMETHODCALLTYPE AddRef(); |
68 ULONG STDMETHODCALLTYPE Release(); |
68 ULONG STDMETHODCALLTYPE Release(); |
69 |
69 |
121 private: |
121 private: |
122 HRESULT tryConnect(IPin *pin, const AM_MEDIA_TYPE *type); |
122 HRESULT tryConnect(IPin *pin, const AM_MEDIA_TYPE *type); |
123 |
123 |
124 volatile LONG m_ref; |
124 volatile LONG m_ref; |
125 FILTER_STATE m_state; |
125 FILTER_STATE m_state; |
|
126 DirectShowIOReader *m_reader; |
|
127 DirectShowEventLoop *m_loop; |
126 IFilterGraph *m_graph; |
128 IFilterGraph *m_graph; |
127 IReferenceClock *m_clock; |
129 IReferenceClock *m_clock; |
128 IMemAllocator *m_allocator; |
130 IMemAllocator *m_allocator; |
129 IPin *m_peerPin; |
131 IPin *m_peerPin; |
130 DirectShowMediaType m_mediaType; |
132 DirectShowMediaType m_mediaType; |
131 QString m_filterName; |
133 QString m_filterName; |
132 const QString m_pinId; |
134 const QString m_pinId; |
133 QMutex m_mutex; |
135 QMutex m_mutex; |
134 DirectShowIOReader m_reader; |
136 }; |
135 |
137 |
|
138 class DirectShowRcSource : public DirectShowIOSource |
|
139 { |
|
140 public: |
|
141 DirectShowRcSource(DirectShowEventLoop *loop); |
|
142 |
|
143 bool open(const QUrl &url); |
|
144 |
|
145 private: |
|
146 QFile m_file; |
136 }; |
147 }; |
137 |
148 |
138 #endif |
149 #endif |