Op vrijdag 28 april 2006 01:38, schreef Harry Vennik:
> Op donderdag 27 april 2006 23:58, schreef Harry Vennik:
> > Op donderdag 27 april 2006 23:06, schreef Youness Alaoui:
> > > On Thu, 27 Apr 2006 15:29:26 -0400, Philippe Valembois - Phil
> > >
> > > <[EMAIL PROTECTED]> wrote:
> > > > Hi,
> > > > I confirm I haven't time but these 2 messages motivated me to see a
> > > > little
> > > > where could be the error...
> > > > And I saw sth : in fact the support is incomplete and it remind me
> > > > that I didn't do the thing I only saw it was here... By the way I
> > > > know where I should fix but I don't know well what I should do yet ;)
> > > > By the way, I will try to fix that Saturday...
> > > > Phil
> > > > P.S. A bad thing with webcam : look at
> > > > https://sourceforge.net/tracker/?func=detail&atid=472655&aid=1421971&;
> > > >gr ou p_id=54091
> > >
> > > I didn't understand all of your mail, but it's ok! :) I know you'll
> > > manage and about the webcam thing... I didn't understand all he said,
> > > do you know what he meant ?
> > >
> > > p.s.: too much "not understand" right now... probably I should head
> > > back to my bed...
> > >
> > >
> > > KKRT
> >
> > I do understand the webcam-issue, and I am trying to find how it can be
> > fixed.
> >
> > Harry
>
> I think I fixed the mmap/munmap thing on my local copy, but I am not sure
> if the fix is ok, so I'll have to take more time, also to find out about
> the open/close device part.
>
> Need to go to bed now... I'll work on it again in the weekend.
>
Okay, fix attached. Cannot find any problems with it, so I think it is ok.

However, the mmap/munmap should be fixed. Depending on the driver 
capabilities, getimage could start and stop the stream for each frame, which 
involves an mmap on starting stream and an munmap on stopping the stream. 
Therefore I use nextframe instead of getimage, and the problem is fixed.

The opening and closing of the device for each frame that was reported is 
probably not a real open() and close(), but simply the start/stop stream.

Harry
*** msn/utils/linux/capture/capture.c	2006-01-28 00:17:40.000000000 +0100
--- msn-camfix/utils/linux/capture/capture.c	2006-04-29 10:12:20.000000000 +0200
***************
*** 480,485 ****
--- 480,487 ----
      captureItem->rgb_buffer = ng_malloc_video_buf(&captureItem->dev, &captureItem->fmt);
    }
    
+   captureItem->dev.v->startvideo(captureItem->dev.handle, 25, 1);
+   
    Tcl_SetObjResult(interp, Tcl_NewStringObj(captureItem->captureName,-1));
    
    return TCL_OK;
***************
*** 506,511 ****
--- 508,515 ----
      return TCL_ERROR;
    }
    
+   capItem->dev.v->stopvideo(capItem->handle);
+   
    // If a converter was used, close it and release the rgb_buffer
    if (capItem->handle) {
      ng_process_fini(capItem->handle);
***************
*** 607,613 ****
    // - High resolution
    // - Low resolution
    for (dim_idx = resolution;;) {
!     if ((capItem->image_data = capItem->dev.v->getimage(capItem->dev.handle)) == NULL) {
  #   ifdef DEBUG
        fprintf(stderr,"Capturing image failed at %d, %d\n", fmt.width, fmt.height);
  #   endif
--- 611,617 ----
    // - High resolution
    // - Low resolution
    for (dim_idx = resolution;;) {
!     if ((capItem->image_data = capItem->dev.v->nextframe(capItem->dev.handle)) == NULL) {
  #   ifdef DEBUG
        fprintf(stderr,"Capturing image failed at %d, %d\n", fmt.width, fmt.height);
  #   endif

Reply via email to