Problem using MediaStreamTerminal to record.rtf
- From: "truthseeker" <truthseeker88@xxxxxxxxx>
- Date: Mon, 23 Jun 2008 15:43:24 +0300
Hi
I am trying to record from the phone using MediaStreamTerminal, I am
implementing my code using Julmar TAPI 3 wrraper
The problem is that I don't recieve events from the stream, The method
waitformultipleobjects always returns -1
My code is :
1- Allocate events
IntPtr[] AllocateEvents(Int32 NUmberOfSamples)
{
IntPtr[] ReadySampleEvents = new IntPtr[NUmberOfSamples];
for (int i = 0; i < NUmberOfSamples; i++)
{
AutoResetEvent Event=new AutoResetEvent(false);
ReadySampleEvents[i] = Event.Handle;
}
return ReadySampleEvents;
}
2- Allocate Stream Samples
IStreamSample[] AllocateStreamSamples(Int32 NumberOFSamples,TTerminal
MSTerminal)
{
IMediaStream I_MediaStream =
MSTerminal.QueryInterface(typeof(IMediaStream)) as IMediaStream;
IStreamSample[] I_StreamSample = new
IStreamSample[NumberOFSamples];
for (int i = 0; i < NumberOFSamples; i++)
{
I_MediaStream.AllocateSample(0, out I_StreamSample[i]);
}
return I_StreamSample;
}
3- Associate Events with sample
void AssociateEventsWithSamples(ref IntPtr[]
ReadyEvents,IStreamSample[]StreamSamples,Int32 NumberOFSamples)
{
//theevent passed to Update will be signaled when the sample is
// filled with data
for (int i = 0; i < NumberOFSamples; i++)
{
int Result= StreamSamples[i].Update(0,
ReadyEvents[i],(IntPtr) null,(IntPtr) 0);
}
}
4- Wait for event
void WaitForEvent(IntPtr[] PSampleEvents, Int32
NNumberOfSamples,IStreamSample[] StreamSamples)
{
while (f.Disconnect==false)
{
Int32 WaitCode =
WaitForMultipleObjects((uint)NNumberOfSamples, PSampleEvents, false,
0xFFFFFFFF);//
.........................
........................
The waitcode is always -1 , Can anyone tell me why ?
Thanks in advance
.
- Prev by Date: Re: Redirect outbound call (Windows Mobile 5)
- Next by Date: Re: Installing a TSP
- Previous by thread: why my xp phone dialer didn't show incoming call...
- Next by thread: Re: how to use the device num returned by lineInitialize
- Index(es):