Although it is used in DirectFB, I do not recommend using the Lock/Unlock functions. They bypass the API, and raise other issues that can be problematic. I do not think there is ever a case where using Lock to gain direct access to the encapsulated pixel data is really necessary - it can always be done using the standard API. If you explain what you are trying to do then perhaps I can suggest another way to do it. ================================== Chris Bore Training Director BORES Signal Processing ch...@bores.com www.bores.com +44 (0)1483 740138
________________________________ From: ravi <ravi...@gmail.com> To: Sriram Neelakandan <sriram.neelakan...@gmail.com> Cc: directfb-users@directfb.org Sent: Thu, 23 December, 2010 4:58:32 Subject: Re: [directfb-users] accessing the row If i unlock the surface first then how can i return the pointer to the caller? I'm unlocking the surface in a different function that caller will call after this function. On Thu, Dec 23, 2010 at 10:02 AM, Sriram Neelakandan <sriram.neelakan...@gmail.com> wrote: well that means the surface is already locked .. u must unlock each Lock after usage > >1. Lock >2. use the pointer >3. UnLock > > > >On Wed, Dec 22, 2010 at 4:31 PM, ravi <ravi...@gmail.com> wrote: > >Hell, >> i have a function to implement that returns a pointer to an array >> of >>pixels representing the >>pixels in the specified row of the surface columns from x (inclusive) to x + w >>(exclusive), I implemented it like this...... >> >> >>{ void *data; >> int pitch; >> surface->Lock(surface, DSLF_READ, &data, &pitch ); >> >> >>return (pointer *)data + pitch*row; >> >> >>} >> >> >>running this function is aborting the program with this message...... >> >> >> DirectFBError [>surface->Lock( surface, (DFBSurfaceLockFlags)(DSLF_READ | >>DSLF_WRITE), &data, &pitch )]: Resource is locked! >> >> >> >> >>-- >>Regards >> >>Ravi Swami >>EnMedia Software Technologies >>Ph +91-974-264-3747 >> >>_______________________________________________ >>directfb-users mailing list >>directfb-users@directfb.org >>http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users >> >> > > >-- >Sriram Neelakandan >Author - Embedded Linux System Design And Development >(http://tinyurl.com/2doosu) > -- Regards Ravi Swami EnMedia Software Technologies Ph +91-974-264-3747
_______________________________________________ directfb-users mailing list directfb-users@directfb.org http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users