Commit beb4664f authored by Damien Fouilleul's avatar Damien Fouilleul

- capture filter supports more than one media types

- capture filter is more compatible with ICaptureGraphBuilder2
- some code cleanups especially when dealing with media types
parent 1e277ab6
This diff is collapsed.
...@@ -60,16 +60,24 @@ void WINAPI FreeMediaType( AM_MEDIA_TYPE& mt ); ...@@ -60,16 +60,24 @@ void WINAPI FreeMediaType( AM_MEDIA_TYPE& mt );
HRESULT WINAPI CopyMediaType( AM_MEDIA_TYPE *pmtTarget, HRESULT WINAPI CopyMediaType( AM_MEDIA_TYPE *pmtTarget,
const AM_MEDIA_TYPE *pmtSource ); const AM_MEDIA_TYPE *pmtSource );
int GetFourCCFromMediaType(const AM_MEDIA_TYPE &media_type);
/**************************************************************************** /****************************************************************************
* Declaration of our dummy directshow filter pin class * Declaration of our dummy directshow filter pin class
****************************************************************************/ ****************************************************************************/
class CapturePin: public IPin, public IMemInputPin class CapturePin: public IPin, public IMemInputPin
{ {
friend class CaptureEnumMediaTypes;
input_thread_t *p_input; input_thread_t *p_input;
CaptureFilter *p_filter; CaptureFilter *p_filter;
IPin *p_connected_pin; IPin *p_connected_pin;
AM_MEDIA_TYPE media_type;
AM_MEDIA_TYPE *media_types;
size_t media_type_count;
AM_MEDIA_TYPE cx_media_type;
deque<VLCMediaSample> samples_queue; deque<VLCMediaSample> samples_queue;
...@@ -77,7 +85,7 @@ class CapturePin: public IPin, public IMemInputPin ...@@ -77,7 +85,7 @@ class CapturePin: public IPin, public IMemInputPin
public: public:
CapturePin( input_thread_t * _p_input, CaptureFilter *_p_filter, CapturePin( input_thread_t * _p_input, CaptureFilter *_p_filter,
AM_MEDIA_TYPE mt ); AM_MEDIA_TYPE *mt, size_t mt_count );
virtual ~CapturePin(); virtual ~CapturePin();
/* IUnknown methods */ /* IUnknown methods */
...@@ -116,7 +124,7 @@ class CapturePin: public IPin, public IMemInputPin ...@@ -116,7 +124,7 @@ class CapturePin: public IPin, public IMemInputPin
/* Custom methods */ /* Custom methods */
HRESULT CustomGetSample( VLCMediaSample * ); HRESULT CustomGetSample( VLCMediaSample * );
AM_MEDIA_TYPE CustomGetMediaType(); AM_MEDIA_TYPE &CustomGetMediaType();
}; };
/**************************************************************************** /****************************************************************************
...@@ -124,16 +132,18 @@ class CapturePin: public IPin, public IMemInputPin ...@@ -124,16 +132,18 @@ class CapturePin: public IPin, public IMemInputPin
****************************************************************************/ ****************************************************************************/
class CaptureFilter : public IBaseFilter class CaptureFilter : public IBaseFilter
{ {
friend class CapturePin;
input_thread_t *p_input; input_thread_t *p_input;
CapturePin *p_pin; CapturePin *p_pin;
IFilterGraph *p_graph; IFilterGraph *p_graph;
AM_MEDIA_TYPE media_type; //AM_MEDIA_TYPE media_type;
FILTER_STATE state; FILTER_STATE state;
long i_ref; long i_ref;
public: public:
CaptureFilter( input_thread_t * _p_input, AM_MEDIA_TYPE mt ); CaptureFilter( input_thread_t * _p_input, AM_MEDIA_TYPE *mt, size_t mt_count );
virtual ~CaptureFilter(); virtual ~CaptureFilter();
/* IUnknown methods */ /* IUnknown methods */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment