On Wed, 6 Mar 2013, Albert Wang wrote: [snip] > >> + if (cam->frame_state.usebufs == 0) > >> + cam->frame_state.usebufs++; > >> + else { > >> + set_bit(CF_SINGLE_BUFFER, &cam->flags); > >> + cam->frame_state.singles++; > >> + if (cam->frame_state.usebufs < 2) > >> + cam->frame_state.usebufs++; > > > >What is this .usebufs actually supposed to do? AFAICS, it is only used to > >decide, whether it should be changed, I don't see it having any effect on > >anything else? > > > Actually, we use .usebufs to decide if will enter single buffer mode. > Only usebufs == 2 can enter single buffer mode. > But when init it: > If CCIC use Two Buffers mode, init usebufs == 1 > If CCIC use Three Buffers mode, init usebufs == 0 > That means when CCIC use Two Buffers mode, once buffer used out, CCIC will enter single buffer mode soon > But when CCIC use Two Buffers mode, we can have 1 frame time to wait for > new buffer and needn't enter single buffer mode. > If we still can't get new buffer after 1 frame, then CCIC has to enter single buffer mode. > But if we are lucky enough and get new buffer when next frame come, then > we can still run in normal mode. Thanks for the explanation. Could you please tell me where in the code this .usebufs field is used as you describe? Thanks Guennadi --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Developer http://www.open-technology.de/ -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html