Commit a7620012 authored by Gildas Bazin's avatar Gildas Bazin

* modules/access/dshow: converted to access2/demux2. Let's hope I didn't break anything ;)

parent cd3d0c21
...@@ -69,6 +69,7 @@ vlc_module_begin(); ...@@ -69,6 +69,7 @@ vlc_module_begin();
add_shortcut( "svcd" ); add_shortcut( "svcd" );
add_shortcut( "v4l" ); add_shortcut( "v4l" );
add_shortcut( "dshow" );
vlc_module_end(); vlc_module_end();
/***************************************************************************** /*****************************************************************************
......
This diff is collapsed.
...@@ -299,7 +299,7 @@ int GetFourCCFromMediaType(const AM_MEDIA_TYPE &media_type) ...@@ -299,7 +299,7 @@ int GetFourCCFromMediaType(const AM_MEDIA_TYPE &media_type)
* Implementation of our dummy directshow filter pin class * Implementation of our dummy directshow filter pin class
****************************************************************************/ ****************************************************************************/
CapturePin::CapturePin( input_thread_t * _p_input, CaptureFilter *_p_filter, CapturePin::CapturePin( access_t * _p_input, CaptureFilter *_p_filter,
AM_MEDIA_TYPE *mt, size_t mt_count ) AM_MEDIA_TYPE *mt, size_t mt_count )
: p_input( _p_input ), p_filter( _p_filter ), p_connected_pin( NULL ), : p_input( _p_input ), p_filter( _p_filter ), p_connected_pin( NULL ),
media_types(mt), media_type_count(mt_count), i_ref( 1 ) media_types(mt), media_type_count(mt_count), i_ref( 1 )
...@@ -328,7 +328,7 @@ HRESULT CapturePin::CustomGetSample( VLCMediaSample *vlc_sample ) ...@@ -328,7 +328,7 @@ HRESULT CapturePin::CustomGetSample( VLCMediaSample *vlc_sample )
msg_Dbg( p_input, "CapturePin::CustomGetSample" ); msg_Dbg( p_input, "CapturePin::CustomGetSample" );
#endif #endif
access_sys_t *p_sys = p_input->p_access_data; access_sys_t *p_sys = p_input->p_sys;
vlc_mutex_lock( &p_sys->lock ); vlc_mutex_lock( &p_sys->lock );
if( samples_queue.size() ) if( samples_queue.size() )
{ {
...@@ -473,7 +473,7 @@ STDMETHODIMP CapturePin::Disconnect() ...@@ -473,7 +473,7 @@ STDMETHODIMP CapturePin::Disconnect()
#if 0 // FIXME: This does seem to create crashes sometimes #if 0 // FIXME: This does seem to create crashes sometimes
VLCMediaSample vlc_sample; VLCMediaSample vlc_sample;
access_sys_t *p_sys = p_input->p_access_data; access_sys_t *p_sys = p_input->p_sys;
vlc_mutex_lock( &p_sys->lock ); vlc_mutex_lock( &p_sys->lock );
while( samples_queue.size() ) while( samples_queue.size() )
...@@ -660,7 +660,7 @@ STDMETHODIMP CapturePin::Receive( IMediaSample *pSample ) ...@@ -660,7 +660,7 @@ STDMETHODIMP CapturePin::Receive( IMediaSample *pSample )
mtime_t i_timestamp = mdate() * 10; mtime_t i_timestamp = mdate() * 10;
VLCMediaSample vlc_sample = {pSample, i_timestamp}; VLCMediaSample vlc_sample = {pSample, i_timestamp};
access_sys_t *p_sys = p_input->p_access_data; access_sys_t *p_sys = p_input->p_sys;
vlc_mutex_lock( &p_sys->lock ); vlc_mutex_lock( &p_sys->lock );
samples_queue.push_front( vlc_sample ); samples_queue.push_front( vlc_sample );
...@@ -705,9 +705,10 @@ STDMETHODIMP CapturePin::ReceiveCanBlock( void ) ...@@ -705,9 +705,10 @@ STDMETHODIMP CapturePin::ReceiveCanBlock( void )
/**************************************************************************** /****************************************************************************
* Implementation of our dummy directshow filter class * Implementation of our dummy directshow filter class
****************************************************************************/ ****************************************************************************/
CaptureFilter::CaptureFilter( access_t * _p_input, AM_MEDIA_TYPE *mt,
CaptureFilter::CaptureFilter( input_thread_t * _p_input, AM_MEDIA_TYPE *mt, size_t mt_count ) size_t mt_count )
: p_input( _p_input ), p_pin( new CapturePin( _p_input, this, mt, mt_count ) ), : p_input( _p_input ),
p_pin( new CapturePin( _p_input, this, mt, mt_count ) ),
state( State_Stopped ), i_ref( 1 ) state( State_Stopped ), i_ref( 1 )
{ {
} }
...@@ -909,7 +910,7 @@ CapturePin *CaptureFilter::CustomGetPin() ...@@ -909,7 +910,7 @@ CapturePin *CaptureFilter::CustomGetPin()
* Implementation of our dummy directshow enumpins class * Implementation of our dummy directshow enumpins class
****************************************************************************/ ****************************************************************************/
CaptureEnumPins::CaptureEnumPins( input_thread_t * _p_input, CaptureEnumPins::CaptureEnumPins( access_t * _p_input,
CaptureFilter *_p_filter, CaptureFilter *_p_filter,
CaptureEnumPins *pEnumPins ) CaptureEnumPins *pEnumPins )
: p_input( _p_input ), p_filter( _p_filter ), i_ref( 1 ) : p_input( _p_input ), p_filter( _p_filter ), i_ref( 1 )
...@@ -1038,10 +1039,8 @@ STDMETHODIMP CaptureEnumPins::Clone( IEnumPins **ppEnum ) ...@@ -1038,10 +1039,8 @@ STDMETHODIMP CaptureEnumPins::Clone( IEnumPins **ppEnum )
/**************************************************************************** /****************************************************************************
* Implementation of our dummy directshow enummediatypes class * Implementation of our dummy directshow enummediatypes class
****************************************************************************/ ****************************************************************************/
CaptureEnumMediaTypes::CaptureEnumMediaTypes( access_t * _p_input,
CaptureEnumMediaTypes::CaptureEnumMediaTypes( input_thread_t * _p_input, CapturePin *_p_pin, CaptureEnumMediaTypes *pEnumMediaTypes )
CapturePin *_p_pin,
CaptureEnumMediaTypes *pEnumMediaTypes )
: p_input( _p_input ), p_pin( _p_pin ), i_ref( 1 ) : p_input( _p_input ), p_pin( _p_pin ), i_ref( 1 )
{ {
/* Hold a reference count on our filter */ /* Hold a reference count on our filter */
......
...@@ -69,7 +69,7 @@ class CapturePin: public IPin, public IMemInputPin ...@@ -69,7 +69,7 @@ class CapturePin: public IPin, public IMemInputPin
{ {
friend class CaptureEnumMediaTypes; friend class CaptureEnumMediaTypes;
input_thread_t *p_input; access_t *p_input;
CaptureFilter *p_filter; CaptureFilter *p_filter;
IPin *p_connected_pin; IPin *p_connected_pin;
...@@ -84,7 +84,7 @@ class CapturePin: public IPin, public IMemInputPin ...@@ -84,7 +84,7 @@ class CapturePin: public IPin, public IMemInputPin
long i_ref; long i_ref;
public: public:
CapturePin( input_thread_t * _p_input, CaptureFilter *_p_filter, CapturePin( access_t * _p_input, CaptureFilter *_p_filter,
AM_MEDIA_TYPE *mt, size_t mt_count ); AM_MEDIA_TYPE *mt, size_t mt_count );
virtual ~CapturePin(); virtual ~CapturePin();
...@@ -134,7 +134,7 @@ class CaptureFilter : public IBaseFilter ...@@ -134,7 +134,7 @@ class CaptureFilter : public IBaseFilter
{ {
friend class CapturePin; friend class CapturePin;
input_thread_t *p_input; access_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;
...@@ -143,7 +143,7 @@ class CaptureFilter : public IBaseFilter ...@@ -143,7 +143,7 @@ class CaptureFilter : public IBaseFilter
long i_ref; long i_ref;
public: public:
CaptureFilter( input_thread_t * _p_input, AM_MEDIA_TYPE *mt, size_t mt_count ); CaptureFilter( access_t * _p_input, AM_MEDIA_TYPE *mt, size_t mt_count );
virtual ~CaptureFilter(); virtual ~CaptureFilter();
/* IUnknown methods */ /* IUnknown methods */
...@@ -178,14 +178,14 @@ class CaptureFilter : public IBaseFilter ...@@ -178,14 +178,14 @@ class CaptureFilter : public IBaseFilter
****************************************************************************/ ****************************************************************************/
class CaptureEnumPins : public IEnumPins class CaptureEnumPins : public IEnumPins
{ {
input_thread_t * p_input; access_t * p_input;
CaptureFilter *p_filter; CaptureFilter *p_filter;
int i_position; int i_position;
long i_ref; long i_ref;
public: public:
CaptureEnumPins( input_thread_t * _p_input, CaptureFilter *_p_filter, CaptureEnumPins( access_t * _p_input, CaptureFilter *_p_filter,
CaptureEnumPins *pEnumPins ); CaptureEnumPins *pEnumPins );
virtual ~CaptureEnumPins(); virtual ~CaptureEnumPins();
...@@ -206,14 +206,14 @@ public: ...@@ -206,14 +206,14 @@ public:
****************************************************************************/ ****************************************************************************/
class CaptureEnumMediaTypes : public IEnumMediaTypes class CaptureEnumMediaTypes : public IEnumMediaTypes
{ {
input_thread_t * p_input; access_t * p_input;
CapturePin *p_pin; CapturePin *p_pin;
int i_position; int i_position;
long i_ref; long i_ref;
public: public:
CaptureEnumMediaTypes( input_thread_t * _p_input, CapturePin *_p_pin, CaptureEnumMediaTypes( access_t * _p_input, CapturePin *_p_pin,
CaptureEnumMediaTypes *pEnumMediaTypes ); CaptureEnumMediaTypes *pEnumMediaTypes );
virtual ~CaptureEnumMediaTypes(); virtual ~CaptureEnumMediaTypes();
......
...@@ -71,6 +71,7 @@ vlc_module_begin(); ...@@ -71,6 +71,7 @@ vlc_module_begin();
add_shortcut( "directory" ); add_shortcut( "directory" );
add_shortcut( "wav" ); add_shortcut( "wav" );
add_shortcut( "v4l" ); add_shortcut( "v4l" );
add_shortcut( "dshow" );
vlc_module_end(); vlc_module_end();
/***************************************************************************** /*****************************************************************************
...@@ -143,6 +144,7 @@ static int Demux2Demux( input_thread_t * p_input ) ...@@ -143,6 +144,7 @@ static int Demux2Demux( input_thread_t * p_input )
{ {
demux2_sys_t *p_sys = (demux2_sys_t*)p_input->p_demux_data; demux2_sys_t *p_sys = (demux2_sys_t*)p_input->p_demux_data;
p_sys->p_demux->b_die = p_input->b_die;
return demux2_Demux( p_sys->p_demux ); return demux2_Demux( p_sys->p_demux );
} }
......
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