Commit 6aedc2a4 authored by jehan's avatar jehan
Browse files

Merge remote-tracking branch 'origin/master' into bctoolbox

parents 312597a4 bd281bd7
......@@ -174,6 +174,8 @@ MS2_PUBLIC void media_stream_set_adaptive_bitrate_algorithm(MediaStream *stream,
MS2_PUBLIC void media_stream_enable_adaptive_jittcomp(MediaStream *stream, bool_t enabled);
MS2_PUBLIC void media_stream_set_ice_check_list(MediaStream *stream, IceCheckList *cl);
/*
* deprecated, use media_stream_set_srtp_recv_key and media_stream_set_srtp_send_key.
**/
......
......@@ -44,7 +44,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define MS_RTP_SEND_SET_RELAY_SESSION_ID MS_FILTER_METHOD(MS_RTP_SEND_ID,5,const char *)
#define MS_RTP_SEND_SEND_GENERIC_CN MS_FILTER_METHOD(MS_RTP_SEND_ID,5, const MSCngData)
#define MS_RTP_SEND_SEND_GENERIC_CN MS_FILTER_METHOD(MS_RTP_SEND_ID,6, const MSCngData)
#define MS_RTP_SEND_ENABLE_STUN MS_FILTER_METHOD(MS_RTP_SEND_ID, 7, bool_t)
......
......@@ -27,7 +27,6 @@ src/otherfilters/tee.c
src/otherfilters/void.c
src/videofilters/drawdib-display.c
src/videofilters/extdisplay.c
src/videofilters/msdscap-mingw.cc
src/videofilters/msv4l.c
src/videofilters/msv4l2.c
src/videofilters/nowebcam.c
......@@ -43,6 +42,7 @@ src/videofilters/winvideo.c
src/videofilters/winvideods.c
src/videofilters/winvideo2.c
src/videofilters/x11video.c
src/videofilters/msdscap.cc
src/voip/ice.c
src/audiofilters/msgenericplc.c
......@@ -239,7 +239,7 @@ if(ENABLE_VIDEO)
videofilters/drawdib-display.c
)
list(APPEND VOIP_SOURCE_FILES_CXX
videofilters/msdscap-mingw.cc
videofilters/msdscap.cc
)
endif()
if(APPLE)
......@@ -380,7 +380,7 @@ if(WIN32)
if(NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
list(APPEND VOIP_LIBS ${LIBGCC} ${LIBMINGWEX} ole32 oleaut32 uuid)
if(ENABLE_VIDEO)
list(APPEND VOIP_LIBS gdi32 user32 vfw32)
list(APPEND VOIP_LIBS gdi32 strmiids user32 vfw32)
endif()
endif()
endif()
......
......@@ -31,7 +31,7 @@ ANDROID_SRC_FILES= \
EXTRA_DIST= audiofilters/winsnd2.c audiofilters/winsnd.c videofilters/winvideo.c \
videofilters/winvideods.c videofilters/wincevideods.c dxfilter.h dxfilter.cpp \
audiofilters/winsndds.cpp \
audiofilters/winsndds.cpp videofilters/msdscap.cc \
voip/nowebcamCIF.jpg audiofilters/winsnd3.c utils/vfw-missing.h \
videofilters/winvideo2.c utils/msjava.c $(ANDROID_SRC_FILES) \
$(GITVERSION_FILE) yuv2rgb.fs yuv2rgb.vs libsrtp.map
......@@ -86,7 +86,7 @@ libmediastreamer_base_la_SOURCES= base/mscommon.c \
otherfilters/itc.c
libmediastreamer_voip_la_SOURCES=
#dummy c++ file to force libtool to use c++ linking (because of msdscap-mingw.cc)
#dummy c++ file to force libtool to use c++ linking
nodist_EXTRA_libmediastreamer_base_la_SOURCES = dummy.cxx
......@@ -252,7 +252,7 @@ libmediastreamer_voip_la_SOURCES+= videofilters/msv4l2.c
endif
if BUILD_WIN32
libmediastreamer_voip_la_SOURCES+= videofilters/msdscap-mingw.cc videofilters/drawdib-display.c
libmediastreamer_voip_la_SOURCES= videofilters/drawdib-display.c
endif
if BUILD_THEORA
......
......@@ -79,6 +79,7 @@ void ms_web_cam_manager_add_cam(MSWebCamManager *m, MSWebCam *c){
void ms_web_cam_manager_prepend_cam(MSWebCamManager *m, MSWebCam *c){
ms_web_cam_set_manager(m, c);
ms_message("Webcam %s prepended",ms_web_cam_get_string_id(c));
m->cams=ms_list_prepend(m->cams,c);
}
......
......@@ -51,21 +51,26 @@ struct SenderData {
bool_t skip;
bool_t mute;
bool_t use_task;
bool_t stun_enabled;
};
typedef struct SenderData SenderData;
/* Send dummy STUN packet to open NAT ports ASAP. */
static void send_stun_packet(RtpSession *s, bool_t enable_rtp, bool_t enable_rtcp)
static void send_stun_packet(SenderData *d, bool_t enable_rtp, bool_t enable_rtcp)
{
StunMessage msg;
mblk_t *mp;
RtpSession *s = d->session;
char buf[STUN_MAX_MESSAGE_SIZE];
int len = STUN_MAX_MESSAGE_SIZE;
if (!d->stun_enabled) return;
if (ms_is_multicast_addr((const struct sockaddr *)&s->rtcp.gs.loc_addr)) {
ms_debug("Stun packet not sent for session [%p] because of multicast",s);
return;
}
memset(&msg, 0, sizeof(StunMessage));
stunBuildReqSimple(&msg, NULL, FALSE, FALSE, 1);
len = stunEncodeMessage(&msg, buf, len, NULL);
......@@ -112,6 +117,7 @@ static void sender_init(MSFilter * f)
d->last_ts=0;
d->use_task= tmp ? (!!atoi(tmp)) : FALSE;
if (d->use_task) ms_message("MSRtpSend will use tasks to send out packet at the beginning of ticks.");
d->stun_enabled = TRUE;
f->data = d;
}
......@@ -153,15 +159,15 @@ static int sender_set_session(MSFilter * f, void *arg)
PayloadType *pt =
rtp_profile_get_payload(rtp_session_get_profile(s),
rtp_session_get_send_payload_type(s));
d->session = s;
if (pt != NULL) {
d->rate = pt->clock_rate;
d->dtmf_duration=(default_dtmf_duration_ms*d->rate)/1000;
d->dtmf_ts_step=(20*d->rate)/1000;
send_stun_packet(s,TRUE,TRUE);
send_stun_packet(d,TRUE,TRUE);
} else {
ms_warning("Sending undefined payload type ?");
}
d->session = s;
return 0;
}
......@@ -367,14 +373,14 @@ static void check_stun_sending(MSFilter *f) {
if ((d->last_rtp_stun_sent_time == -1) || ((f->ticker->time- d->last_sent_time>2000) /*no need to send stun packets if media sent during last 2s*/
&& (f->ticker->time - d->last_rtp_stun_sent_time) >= 500)) {
d->last_rtp_stun_sent_time = f->ticker->time;
send_stun_packet(s,TRUE,FALSE);
send_stun_packet(d,TRUE,FALSE);
}
if ( rtp_session_rtcp_enabled(s) && (d->last_rtcp_stun_sent_time == -1
|| (rtp_session_get_stats(s)->recv_rtcp_packets == 0 /*no need to send stun packets if rtcp packet already received*/
&& (f->ticker->time - d->last_rtcp_stun_sent_time) >= 500))) {
d->last_rtcp_stun_sent_time = f->ticker->time;
send_stun_packet(s,FALSE,TRUE);
send_stun_packet(d,FALSE,TRUE);
}
}
......@@ -481,6 +487,12 @@ static int sender_send_generic_cn(MSFilter *f, void *data){
return 0;
}
static int sender_enable_stun(MSFilter *f, void *data) {
SenderData *d = (SenderData *)f->data;
d->stun_enabled = *((bool_t *)data);
return 0;
}
static MSFilterMethod sender_methods[] = {
{MS_RTP_SEND_MUTE, sender_mute},
{MS_RTP_SEND_UNMUTE, sender_unmute},
......@@ -491,6 +503,7 @@ static MSFilterMethod sender_methods[] = {
{MS_FILTER_GET_NCHANNELS, sender_get_ch },
{MS_RTP_SEND_SET_DTMF_DURATION, sender_set_dtmf_duration },
{MS_RTP_SEND_SEND_GENERIC_CN, sender_send_generic_cn },
{ MS_RTP_SEND_ENABLE_STUN, sender_enable_stun },
{0, NULL}
};
......
/* msdscap-mingw - mediastreamer2 plugin for video capture using directshow
Unlike winvideods.c filter, the following source code compiles with mingw.
winvideods.c requires visual studio to build.
/* msdscap - mediastreamer2 plugin for video capture using directshow
This source code requires visual studio to build.
Copyright (C) 2009 Simon Morlat
......@@ -17,353 +16,52 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
This plugin has been written by Simon Morlat based on the work made by
Jan Wedekind, posted on mingw tracker here:
http://sourceforge.net/tracker/index.php?func=detail&aid=1819367&group_id=2435&atid=302435
He wrote all the declarations missing to get directshow capture working
with mingw, and provided a demo code that worked great with minimal code.
*/
#include <mediastreamer2/mswebcam.h>
#include <mediastreamer2/msfilter.h>
#include <mediastreamer2/msticker.h>
#include <mediastreamer2/msvideo.h>
#include <dshow.h>
#include <basetyps.h>
#include <initguid.h>
#include <ocidl.h>
#undef CINTERFACE
#define MAX_FILTER_NAME 128
#define MAX_PIN_NAME 128
// -- format types ---
// 0F6417D6-C318-11D0-A43F-00A0C9223196 FORMAT_None
DEFINE_GUID(FORMAT_None,
0x0F6417D6, 0xc318, 0x11d0, 0xa4, 0x3f, 0x00, 0xa0, 0xc9, 0x22, 0x31, 0x96);
// 05589f80-c356-11ce-bf01-00aa0055595a FORMAT_VideoInfo
DEFINE_GUID(FORMAT_VideoInfo,
0x05589f80, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a);
// F72A76A0-EB0A-11d0-ACE4-0000C0CC16BA FORMAT_VideoInfo2
DEFINE_GUID(FORMAT_VideoInfo2,
0xf72a76A0, 0xeb0a, 0x11d0, 0xac, 0xe4, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba);
DEFINE_GUID( CLSID_VideoInputDeviceCategory, 0x860BB310, 0x5D01,
0x11d0, 0xBD, 0x3B, 0x00, 0xA0, 0xC9, 0x11, 0xCE, 0x86);
DEFINE_GUID( CLSID_SystemDeviceEnum, 0x62BE5D10, 0x60EB, 0x11d0,
0xBD, 0x3B, 0x00, 0xA0, 0xC9, 0x11, 0xCE, 0x86 );
DEFINE_GUID( CLSID_FilterGraph, 0xe436ebb3, 0x524f, 0x11ce,
0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70);
DEFINE_GUID( CLSID_SampleGrabber, 0xc1f400a0, 0x3f08, 0x11d3,
0x9f, 0x0b, 0x00, 0x60, 0x08, 0x03, 0x9e, 0x37 );
DEFINE_GUID( CLSID_NullRenderer,0xc1f400a4, 0x3f08, 0x11d3,
0x9f, 0x0b, 0x00, 0x60, 0x08, 0x03, 0x9e, 0x37 );
DEFINE_GUID( IID_IGraphBuilder, 0x56a868a9, 0x0ad4, 0x11ce,
0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70);
DEFINE_GUID( IID_IBaseFilter, 0x56a86895, 0x0ad4, 0x11ce,
0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 );
DEFINE_GUID( IID_ICreateDevEnum, 0x29840822, 0x5b84, 0x11d0,
0xbd, 0x3b, 0x00, 0xa0, 0xc9, 0x11, 0xce, 0x86 );
DEFINE_GUID( IID_IEnumPins, 0x56a86892, 0x0ad4, 0x11ce,
0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 );
DEFINE_GUID( IID_IPin, 0x56a86891, 0x0ad4, 0x11ce,
0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 );
DEFINE_GUID( IID_ISampleGrabber, 0x6b652fff, 0x11fe, 0x4fce,
0x92, 0xad, 0x02, 0x66, 0xb5, 0xd7, 0xc7, 0x8f );
DEFINE_GUID( IID_ISampleGrabberCB, 0x0579154a, 0x2b53, 0x4994,
0xb0, 0xd0, 0xe7, 0x73, 0x14, 0x8e, 0xff, 0x85 );
DEFINE_GUID( IID_IMediaEvent, 0x56a868b6, 0x0ad4, 0x11ce,
0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 );
DEFINE_GUID( IID_IMediaControl, 0x56a868b1, 0x0ad4, 0x11ce,
0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 );
DEFINE_GUID( IID_IAMStreamConfig, 0xc6e13340, 0x30ac, 0x11d0,
0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56 );
DEFINE_GUID( MEDIATYPE_Video, 0x73646976, 0x0000, 0x0010,
0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 );
typedef interface IBaseFilter IBaseFilter;
typedef interface IReferenceClock IReferenceClock;
typedef interface IFilterGraph IFilterGraph;
typedef LONGLONG REFERENCE_TIME;
typedef long OAFilterState;
typedef LONG_PTR OAEVENT;
/*DECLARE_ENUMERATOR_ is defined in mingw, but maybe not in VisualStudio.*/
#ifndef DECLARE_ENUMERATOR_
#define DECLARE_ENUMERATOR_(I,T) \
DECLARE_INTERFACE_(I,IUnknown) \
{ \
STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; \
STDMETHOD_(ULONG,AddRef)(THIS) PURE; \
STDMETHOD_(ULONG,Release)(THIS) PURE; \
STDMETHOD(Next)(THIS_ ULONG,T*,ULONG*) PURE;\
STDMETHOD(Skip)(THIS_ ULONG) PURE; \
STDMETHOD(Reset)(THIS) PURE; \
STDMETHOD(Clone)(THIS_ I**) PURE; \
}
#endif
typedef struct tagVIDEOINFOHEADER {
RECT rcSource;
RECT rcTarget;
DWORD dwBitRate;
DWORD dwBitErrorRate;
REFERENCE_TIME AvgTimePerFrame;
BITMAPINFOHEADER bmiHeader;
} VIDEOINFOHEADER;
typedef struct _AMMediaType {
GUID majortype;
GUID subtype;
BOOL bFixedSizeSamples;
BOOL bTemporalCompression;
ULONG lSampleSize;
GUID formattype;
IUnknown *pUnk;
ULONG cbFormat;
BYTE *pbFormat;
} AM_MEDIA_TYPE;
DECLARE_ENUMERATOR_(IEnumMediaTypes,AM_MEDIA_TYPE*);
typedef struct _VIDEO_STREAM_CONFIG_CAPS
{
GUID guid;
ULONG VideoStandard;
SIZE InputSize;
SIZE MinCroppingSize;
SIZE MaxCroppingSize;
int CropGranularityX;
int CropGranularityY;
int CropAlignX;
int CropAlignY;
SIZE MinOutputSize;
SIZE MaxOutputSize;
int OutputGranularityX;
int OutputGranularityY;
int StretchTapsX;
int StretchTapsY;
int ShrinkTapsX;
int ShrinkTapsY;
LONGLONG MinFrameInterval;
LONGLONG MaxFrameInterval;
LONG MinBitsPerSecond;
LONG MaxBitsPerSecond;
} VIDEO_STREAM_CONFIG_CAPS;
typedef enum _FilterState {
State_Stopped,
State_Paused,
State_Running
} FILTER_STATE;
//http://msdn.microsoft.com/en-us/library/windows/desktop/dd375787%28v=vs.85%29.aspx
typedef struct _FilterInfo {
WCHAR achName[MAX_FILTER_NAME];
IFilterGraph *pGraph;
} FILTER_INFO;
typedef enum _PinDirection {
PINDIR_INPUT,
PINDIR_OUTPUT
} PIN_DIRECTION;
typedef struct _PinInfo {
IBaseFilter *pFilter;
PIN_DIRECTION dir;
WCHAR achName[MAX_PIN_NAME];
} PIN_INFO;
//http://msdn.microsoft.com/en-us/library/windows/desktop/dd390397%28v=vs.85%29.aspx
#undef INTERFACE
#define INTERFACE IPin
DECLARE_INTERFACE_(IPin,IUnknown)
{
STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
STDMETHOD(Connect)(THIS_ IPin*,const AM_MEDIA_TYPE*) PURE;
STDMETHOD(ReceiveConnection)(THIS_ IPin*,const AM_MEDIA_TYPE*) PURE;
STDMETHOD(Disconnect)(THIS) PURE;
STDMETHOD(ConnectedTo)(THIS_ IPin**) PURE;
STDMETHOD(ConnectionMediaType)(THIS_ AM_MEDIA_TYPE*) PURE;
STDMETHOD(QueryPinInfo)(THIS_ PIN_INFO*) PURE;
STDMETHOD(QueryDirection)(THIS_ PIN_DIRECTION*) PURE;
};
#undef INTERFACE
DECLARE_ENUMERATOR_(IEnumPins,IPin*);
#define INTERFACE IMediaEvent
DECLARE_INTERFACE_(IMediaEvent,IDispatch)
{
STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
STDMETHOD(GetEventHandle)(THIS_ OAEVENT*) PURE;
STDMETHOD(GetEvent)(THIS_ long*,LONG_PTR,LONG_PTR,long) PURE;
STDMETHOD(WaitForCompletion)(THIS_ long,long*) PURE;
STDMETHOD(CancelDefaultHandling)(THIS_ long) PURE;
STDMETHOD(RestoreDefaultHandling)(THIS_ long) PURE;
STDMETHOD(FreeEventParams)(THIS_ long,LONG_PTR,LONG_PTR) PURE;
};
#undef INTERFACE
#define INTERFACE IMediaControl
DECLARE_INTERFACE_(IMediaControl,IDispatch)
{
STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
STDMETHOD(Run)(THIS) PURE;
STDMETHOD(Pause)(THIS) PURE;
STDMETHOD(Stop)(THIS) PURE;
STDMETHOD(GetState)(THIS_ LONG,OAFilterState*) PURE;
STDMETHOD(RenderFile)(THIS_ BSTR) PURE;
STDMETHOD(AddSourceFilter)(THIS_ BSTR,IDispatch**) PURE;
STDMETHOD(get_FilterCollection)(THIS_ IDispatch**) PURE;
STDMETHOD(get_RegFilterCollection)(THIS_ IDispatch**) PURE;
STDMETHOD(StopWhenReady)(THIS) PURE;
};
#undef INTERFACE
#define INTERFACE IAMStreamConfig
DECLARE_INTERFACE_(IAMStreamConfig,IUnknown)
{
STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
STDMETHOD(SetFormat)(THIS_ AM_MEDIA_TYPE*) PURE;
STDMETHOD(GetFormat)(THIS_ AM_MEDIA_TYPE**) PURE;
STDMETHOD(GetNumberOfCapabilities)(THIS_ int*,int*) PURE;
STDMETHOD(GetStreamCaps)(THIS_ int,AM_MEDIA_TYPE**,BYTE*) PURE;
};
#undef INTERFACE
#define INTERFACE IMediaFilter
DECLARE_INTERFACE_(IMediaFilter,IPersist){
STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
STDMETHOD(Stop)(THIS) PURE;
STDMETHOD(Pause)(THIS) PURE;
STDMETHOD(Run)(THIS_ REFERENCE_TIME) PURE;
STDMETHOD(GetState)(THIS_ DWORD,FILTER_STATE*) PURE;
STDMETHOD(SetSyncSource)(THIS_ IReferenceClock*) PURE;
STDMETHOD(GetSyncSource)(THIS_ IReferenceClock**) PURE;
};
#undef INTERFACE
#define INTERFACE IBaseFilter
DECLARE_INTERFACE_(IBaseFilter,IMediaFilter)
{
STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
STDMETHOD(EnumPins)(THIS_ IEnumPins**) PURE;
STDMETHOD(FindPin)(THIS_ LPCWSTR,IPin**) PURE;
STDMETHOD(QueryFilterInfo)(THIS_ FILTER_INFO*) PURE;
STDMETHOD(JoinFilterGraph)(THIS_ IFilterGraph*,LPCWSTR) PURE;
STDMETHOD(QueryVendorInfo)(THIS_ LPWSTR*) PURE;
};
#undef INTERFACE
DECLARE_ENUMERATOR_(IEnumFilters,IBaseFilter*);
#define INTERFACE IFilterGraph
DECLARE_INTERFACE_(IFilterGraph,IUnknown)
{
STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
STDMETHOD(AddFilter)(THIS_ IBaseFilter*,LPCWSTR) PURE;
STDMETHOD(RemoveFilter)(THIS_ IBaseFilter*) PURE;
STDMETHOD(EnumFilters)(THIS_ IEnumFilters**) PURE;
STDMETHOD(FindFilterByName)(THIS_ LPCWSTR,IBaseFilter**) PURE;
STDMETHOD(ConnectDirect)(THIS_ IPin*,IPin*,const AM_MEDIA_TYPE*) PURE;
STDMETHOD(Reconnect)(THIS_ IPin*) PURE;
STDMETHOD(Disconnect)(THIS_ IPin*) PURE;
STDMETHOD(SetDefaultSyncSource)(THIS) PURE;
};
#undef INTERFACE
#define INTERFACE IGraphBuilder
DECLARE_INTERFACE_(IGraphBuilder,IFilterGraph)
{
STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
STDMETHOD(Connect)(THIS_ IPin*,IPin*) PURE;
STDMETHOD(Render)(THIS_ IPin*) PURE;
STDMETHOD(RenderFile)(THIS_ LPCWSTR,LPCWSTR) PURE;
STDMETHOD(AddSourceFilter)(THIS_ LPCWSTR,LPCWSTR,IBaseFilter**) PURE;
STDMETHOD(SetLogFile)(THIS_ DWORD_PTR) PURE;
STDMETHOD(Abort)(THIS) PURE;
STDMETHOD(ShouldOperationContinue)(THIS) PURE;
};
#undef INTERFACE
#define INTERFACE ICreateDevEnum
DECLARE_INTERFACE_(ICreateDevEnum,IUnknown)
{
STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
STDMETHOD(CreateClassEnumerator)(THIS_ REFIID,IEnumMoniker**,DWORD) PURE;
};
#undef INTERFACE
#define INTERFACE IMediaSample
DECLARE_INTERFACE_(IMediaSample,IUnknown)
{
STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
STDMETHOD(GetPointer)(THIS_ BYTE **) PURE;
STDMETHOD_(long, GetSize)(THIS) PURE;
};
#undef INTERFACE
#define INTERFACE ISampleGrabberCB
DECLARE_INTERFACE_(ISampleGrabberCB,IUnknown)
/*
* The following definitions are normally in Qedit.h that is now deprecated by Microsoft.
* Therefore we need to duplicate them here.
*/
DEFINE_GUID(CLSID_SampleGrabber, 0xc1f400a0, 0x3f08, 0x11d3,
0x9f, 0x0b, 0x00, 0x60, 0x08, 0x03, 0x9e, 0x37);
DEFINE_GUID(IID_ISampleGrabber, 0x6b652fff, 0x11fe, 0x4fce,
0x92, 0xad, 0x02, 0x66, 0xb5, 0xd7, 0xc7, 0x8f);
DEFINE_GUID(CLSID_NullRenderer, 0xc1f400a4, 0x3f08, 0x11d3,
0x9f, 0x0b, 0x00, 0x60, 0x08, 0x03, 0x9e, 0x37);
DECLARE_INTERFACE_(ISampleGrabberCB, IUnknown)
{
STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
STDMETHOD(SampleCB)(THIS_ double,IMediaSample*) PURE;
STDMETHOD(BufferCB)(THIS_ double,BYTE*,long) PURE;
STDMETHOD(QueryInterface)(THIS_ REFIID, PVOID*) PURE;
STDMETHOD_(ULONG, AddRef)(THIS)PURE;
STDMETHOD_(ULONG, Release)(THIS)PURE;
STDMETHOD(SampleCB)(THIS_ double, IMediaSample*) PURE;
STDMETHOD(BufferCB)(THIS_ double, BYTE*, long) PURE;
};
#undef INTERFACE
#define INTERFACE ISampleGrabber
DECLARE_INTERFACE_(ISampleGrabber,IUnknown){
STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
DECLARE_INTERFACE_(ISampleGrabber, IUnknown){
STDMETHOD(QueryInterface)(THIS_ REFIID, PVOID*) PURE;
STDMETHOD_(ULONG, AddRef)(THIS)PURE;
STDMETHOD_(ULONG, Release)(THIS)PURE;
STDMETHOD(SetOneShot)(THIS_ BOOL) PURE;
STDMETHOD(SetMediaType)(THIS_ const AM_MEDIA_TYPE*) PURE;
STDMETHOD(GetConnectedMediaType)(THIS_ AM_MEDIA_TYPE*) PURE;
STDMETHOD(SetBufferSamples)(THIS_ BOOL) PURE;
STDMETHOD(GetCurrentBuffer)(THIS_ long*,long*) PURE;
STDMETHOD(GetCurrentBuffer)(THIS_ long*, long*) PURE;
STDMETHOD(GetCurrentSample)(THIS_ IMediaSample**) PURE;
STDMETHOD(SetCallBack)(THIS_ ISampleGrabberCB *,long) PURE;
STDMETHOD(SetCallBack)(THIS_ ISampleGrabberCB *, long) PURE;
};
#undef INTERFACE
......
......@@ -1348,7 +1348,7 @@ static void ice_send_binding_response(IceCheckList *cl, const RtpSession *rtp_se
char source_addr_str[256];
char tr_id_str[25];
ice_get_transport_from_rtp_session(rtp_session, evt_data,&rtptp);
ice_get_transport_from_rtp_session(rtp_session, evt_data, &rtptp);
if (!rtptp) return;
memset(&response, 0, sizeof(response));
......@@ -1423,7 +1423,8 @@ static void ice_send_error_response(const RtpSession *rtp_session, const OrtpEve
memset(&response, 0, sizeof(response));
memset(&dest_addr, 0, sizeof(dest_addr));
memset(&source_addr, 0, sizeof(source_addr));
ice_get_transport_from_rtp_session(rtp_session, evt_data,&rtptp);
ice_get_transport_from_rtp_session(rtp_session, evt_data, &rtptp);
if (!rtptp) return;
/* Copy magic cookie and transaction ID from the request. */
response.msgHdr.magic_cookie = ntohl(msg->msgHdr.magic_cookie);
......@@ -1440,7 +1441,6 @@ static void ice_send_error_response(const RtpSession *rtp_session, const OrtpEve
len = stunEncodeMessage(&response, buf, len, &password);
if (len > 0) {
RtpTransport *rtpt=NULL;
transactionID2string(&response.msgHdr.tr_id, tr_id_str);
dest_addr.sin_addr.s_addr = htonl(dest->addr);
dest_addr.sin_port = htons(dest->port);
......@@ -1451,12 +1451,7 @@ static void ice_send_error_response(const RtpSession *rtp_session, const OrtpEve
source_addr.sin_family = AF_INET;
ice_inet_ntoa((struct sockaddr *)&source_addr, sizeof(source_addr), source_addr_str, sizeof(source_addr_str));
ms_message("ice: Send error response: %s:%u --> %s:%u [%s]", source_addr_str, recvport, dest_addr_str, dest->port, tr_id_str);
rtp_session_get_transports(rtp_session,&rtpt,NULL);
ice_send_message_to_socket( rtpt
, buf
, len
, (struct sockaddr *)&dest_addr
, sizeof(dest_addr));
ice_send_message_to_socket(rtptp, buf, len, (struct sockaddr *)&dest_addr, sizeof(dest_addr));
}
}