Commit b34227c1 authored by Gildas Bazin's avatar Gildas Bazin

* configure.ac, modules/access/dshow/: brand new DirectShow input plugin.
   Much work still needs to be done, like audio support, adding plenty of configuration options, etc... But the video part is already working quite well here.
parent 026eb767
dnl Autoconf settings for vlc
dnl $Id: configure.ac,v 1.67 2003/08/23 22:49:50 fenrir Exp $
dnl $Id: configure.ac,v 1.68 2003/08/24 11:17:39 gbazin Exp $
AC_INIT(vlc,0.6.3-cvs)
......@@ -1212,6 +1212,22 @@ then
fi
fi
dnl
dnl Windows DirectShow access module
dnl
AC_ARG_ENABLE(dshow,
[ --enable-dshow Win32 DirectShow support (default enabled on Win32)])
if test "${enable_dshow}" != "no"
then
if test "${SYS}" = "mingw32" -o "${SYS}" = "cygwin"
then
AC_CHECK_HEADERS(dshow.h,
[ AX_ADD_PLUGINS([dshow])
AX_ADD_CXXFLAGS([dshow],[])
AX_ADD_LDFLAGS([dshow],[-lole32 -loleaut32]) ])
fi
fi
dnl
dnl libdvbpsi ts demux/mux
dnl
......@@ -3261,6 +3277,7 @@ AC_OUTPUT([
src/Makefile
modules/access/Makefile
modules/access/dshow/Makefile
modules/access/dvb/Makefile
modules/access/dvd/Makefile
modules/access/dvdplay/Makefile
......
.deps
.dirstamp
*.lo
*.la
*.dll
*.dylib
*.sl
*.so
Makefile.am
Makefile.in
Makefile
SOURCES_dshow = dshow.cpp filter.cpp filter.h
This diff is collapsed.
This diff is collapsed.
/*****************************************************************************
* filter.h : DirectShow access module for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: filter.h,v 1.1 2003/08/24 11:17:39 gbazin Exp $
*
* Author: Gildas Bazin <gbazin@netcourrier.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <string>
#include <list>
#include <deque>
using namespace std;
typedef struct VLCMediaSample
{
IMediaSample *p_sample;
mtime_t i_timestamp;
} VLCMediaSample;
class CaptureFilter;
void WINAPI FreeMediaType( AM_MEDIA_TYPE& mt );
HRESULT WINAPI CopyMediaType( AM_MEDIA_TYPE *pmtTarget,
const AM_MEDIA_TYPE *pmtSource );
/****************************************************************************
* Declaration of our dummy directshow filter pin class
****************************************************************************/
class CapturePin: public IPin, public IMemInputPin
{
input_thread_t * p_input;
CaptureFilter *p_filter;
IPin *p_connected_pin;
AM_MEDIA_TYPE media_type;
deque<VLCMediaSample> samples_queue;
int i_ref;
public:
CapturePin( input_thread_t * _p_input, CaptureFilter *_p_filter );
virtual ~CapturePin();
/* IUnknown methods */
STDMETHODIMP QueryInterface(REFIID riid, void **ppv);
STDMETHODIMP_(ULONG) AddRef();
STDMETHODIMP_(ULONG) Release();
/* IPin methods */
STDMETHODIMP Connect( IPin * pReceivePin, const AM_MEDIA_TYPE *pmt );
STDMETHODIMP ReceiveConnection( IPin * pConnector,
const AM_MEDIA_TYPE *pmt );
STDMETHODIMP Disconnect();
STDMETHODIMP ConnectedTo( IPin **pPin );
STDMETHODIMP ConnectionMediaType( AM_MEDIA_TYPE *pmt );
STDMETHODIMP QueryPinInfo( PIN_INFO * pInfo );
STDMETHODIMP QueryDirection( PIN_DIRECTION * pPinDir );
STDMETHODIMP QueryId( LPWSTR * Id );
STDMETHODIMP QueryAccept( const AM_MEDIA_TYPE *pmt );
STDMETHODIMP EnumMediaTypes( IEnumMediaTypes **ppEnum );
STDMETHODIMP QueryInternalConnections( IPin* *apPin, ULONG *nPin );
STDMETHODIMP EndOfStream( void );
STDMETHODIMP BeginFlush( void );
STDMETHODIMP EndFlush( void );
STDMETHODIMP NewSegment( REFERENCE_TIME tStart, REFERENCE_TIME tStop,
double dRate );
/* IMemInputPin methods */
STDMETHODIMP GetAllocator( IMemAllocator **ppAllocator );
STDMETHODIMP NotifyAllocator( IMemAllocator *pAllocator, BOOL bReadOnly );
STDMETHODIMP GetAllocatorRequirements( ALLOCATOR_PROPERTIES *pProps );
STDMETHODIMP Receive( IMediaSample *pSample );
STDMETHODIMP ReceiveMultiple( IMediaSample **pSamples, long nSamples,
long *nSamplesProcessed );
STDMETHODIMP ReceiveCanBlock( void );
/* Custom methods */
HRESULT CustomGetSample( VLCMediaSample * );
AM_MEDIA_TYPE CustomGetMediaType();
};
/****************************************************************************
* Declaration of our dummy directshow filter class
****************************************************************************/
class CaptureFilter : public IBaseFilter
{
input_thread_t * p_input;
CapturePin *p_pin;
IFilterGraph * p_graph;
int i_ref;
public:
CaptureFilter( input_thread_t * _p_input );
virtual ~CaptureFilter();
/* IUnknown methods */
STDMETHODIMP QueryInterface(REFIID riid, void **ppv);
STDMETHODIMP_(ULONG) AddRef();
STDMETHODIMP_(ULONG) Release();
/* IPersist method */
STDMETHODIMP GetClassID(CLSID *pClsID);
/* IMediaFilter methods */
STDMETHODIMP GetState(DWORD dwMSecs, FILTER_STATE *State);
STDMETHODIMP SetSyncSource(IReferenceClock *pClock);
STDMETHODIMP GetSyncSource(IReferenceClock **pClock);
STDMETHODIMP Stop();
STDMETHODIMP Pause();
STDMETHODIMP Run(REFERENCE_TIME tStart);
/* IBaseFilter methods */
STDMETHODIMP EnumPins( IEnumPins ** ppEnum );
STDMETHODIMP FindPin( LPCWSTR Id, IPin ** ppPin );
STDMETHODIMP QueryFilterInfo( FILTER_INFO * pInfo );
STDMETHODIMP JoinFilterGraph( IFilterGraph * pGraph, LPCWSTR pName );
STDMETHODIMP QueryVendorInfo( LPWSTR* pVendorInfo );
/* Custom methods */
CapturePin *CustomGetPin();
};
/****************************************************************************
* Declaration of our dummy directshow enumpins class
****************************************************************************/
class CaptureEnumPins : public IEnumPins
{
input_thread_t * p_input;
int i_position;
CaptureFilter *p_filter;
int i_ref;
public:
CaptureEnumPins( input_thread_t * _p_input, CaptureFilter *_p_filter,
CaptureEnumPins *pEnumPins );
virtual ~CaptureEnumPins();
// IUnknown
STDMETHODIMP QueryInterface( REFIID riid, void **ppv );
STDMETHODIMP_(ULONG) AddRef();
STDMETHODIMP_(ULONG) Release();
// IEnumPins
STDMETHODIMP Next( ULONG cPins, IPin ** ppPins, ULONG * pcFetched );
STDMETHODIMP Skip( ULONG cPins );
STDMETHODIMP Reset();
STDMETHODIMP Clone( IEnumPins **ppEnum );
};
/****************************************************************************
* Declaration of our dummy directshow enummediatypes class
****************************************************************************/
class CaptureEnumMediaTypes : public IEnumMediaTypes
{
input_thread_t * p_input;
int i_position;
CapturePin *p_pin;
int i_ref;
public:
CaptureEnumMediaTypes( input_thread_t * _p_input, CapturePin *_p_pin,
CaptureEnumMediaTypes *pEnumMediaTypes );
virtual ~CaptureEnumMediaTypes();
// IUnknown
STDMETHODIMP QueryInterface( REFIID riid, void **ppv );
STDMETHODIMP_(ULONG) AddRef();
STDMETHODIMP_(ULONG) Release();
// IEnumMediaTypes
STDMETHODIMP Next( ULONG cMediaTypes, AM_MEDIA_TYPE ** ppMediaTypes,
ULONG * pcFetched );
STDMETHODIMP Skip( ULONG cMediaTypes );
STDMETHODIMP Reset();
STDMETHODIMP Clone( IEnumMediaTypes **ppEnum );
};
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