Hi Mr Ferguson,
Yeah, I have built a user space camera driver as a quicktime component.
But I have found something wrong when running my camera.That is, sometimes
the isoch pipe will stop in a sudden and no any debug information I can
find.On
the other way, I want to send some control commands when doing preview with
my camera, But now camera is opened exclusively so no any application can
open
device again.So I want to built a KEXT for my camera.
Now, I have a problem is, Should I create a timer(workLoop) for my
isoch read request?
Since I issue isoch read request as some sample code I got from internet,
but only the first
request I can get data from device, the code list as below:
StartIsocRead
{
if(fDeviceConfigured != true) return kIOReturnNoDevice;
IOReturn result = kIOReturnSuccess;
UInt32 i;
frameStart = fDevice->GetBus()->GetFrameNumber();
for(i = 0; i < MAX_FRAME; i++)
{
frameList[i].frStatus = kIOReturnSuccess;
frameList[i].frReqCount = MAX_FRAME_SIZE;
frameList[i].frActCount = 0;
}
completion.target = this;
completion.action = IsocReadCompletion;
completion.parameter = NULL;
result = fIsoPipe->Read(fIsoMDP, frameStart + 0x0064, MAX_FRAME,
frameList, &completion);
return result;
}
IsocReadCompletion(void* target, void* parameter, IOReturn status,
IOUSBIsocFrame* framelist)
{
UInt32 total;
UInt32 i;
VM0303* me = (VM0303 *)target;
IOReturn result = kIOReturnSuccess;
total = 0;
for(i = 0; i < MAX_FRAME; i++)
{
total += me->frameList[i].frActCount;
}
if(me->fDeviceConfigured != true) return ;
for(i = 0; i < MAX_FRAME; i++)
{
me->frameList[i].frStatus = kIOReturnSuccess;
me->frameList[i].frReqCount = MAX_FRAME_SIZE;
me->frameList[i].frActCount = 0;
}
me->completion.target = me;
me->completion.action = IsocReadCompletion;
me->completion.parameter = me->frameList;
result = me->fIsoPipe->Read(me->fIsoMDP, me->frameStart + MAX_FRAME,
MAX_FRAME, me->frameList, &me->completion);
}
Could you tell me how to solve this problem?
Thanks & Best regards.
Vimicro Corporation
email@hidden
----- Original Message -----
From: <email@hidden>
To: <email@hidden>
Sent: Wednesday, October 12, 2005 1:19 AM
Subject: Usb Digest, Vol 2, Issue 226
> Message: 5
> Date: Tue, 11 Oct 2005 07:55:51 -0700
> From: David Ferguson <email@hidden>
> Subject: Re: Usb Digest, Vol 2, Issue 225
> To: email@hidden
> Message-ID: <p06020415bf7181bc398d@[17.206.37.158]>
> Content-Type: text/plain; charset="us-ascii" ; format="flowed"
>
> Is there some reason you are trying to do Isoch from a KEXT? Most
> of our Isoch clients (Audio, Video) are user-mode clients. Unless
> you need to provide services to an entity that lives in the kernel,
> you should probably consider doing all your work from user space.
>
> As a KEXT, you are linked in with the kernel, and completion
> functions can be called directly.
>
> David Ferguson
> Apple Computer
>
> At 9:49 AM +0800 10/11/05, Gordon wrote:
>>Hi Mr.Ferguson,
>> Thanks,I get it.
>> But I have another problem.That is,
>>As you know,On application layer when we start
>>isoch reading we should create an event source
>>and add it to current RunLoop. When event comes
>>our callback function will be invoked.Is it the same
>> in KEXT. If not, then how to do it.
>> Thanks & Best regards.
>>
>>Vimicro Corporation
>>email@hidden
>>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Usb mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/usb/email@hidden
This email sent to email@hidden