On 6/8/06, IOhannes m zmoelnig <zmoelnig@iem.at> wrote:
> I put a simple if statement in pix_share_write to replace the
> imageStruct call and it works fine. I think setCSizeByFormat() might
> not be working on the Mac. All those #ifdefs are hard to read! I will
> try to replace it with a single one for __APPLE__ and see if that helps.
i agree that it might be better to just have one big #ifdef _APPLE__
#endif instead of 4 of them
would you change it or should i do it? (and honestly, i much prefer an
#ifdef over an #ifndef for readability)
> This is the tricky part of these objects to deal with. You can either
> allow the user to whatever they want when setting up shm or put in a
> check to help keep them from doing something which might crash or become
> unusable. My original thinking was that anyone using these objects
> would have to really know what they are doing to set them up properly
> and to just let them do it.
i see.
since there were no help-patches, you were the only person who knew
exactly what the objects were doing. when i first tried to use them they
just plain crashed which i found a bit "unusable".
so i was kind of a burnt child and tried to make it nice.
that if pd is meant to be a real programming language then the user must
be able to crash the computer :-)
actually i never really tried to do change the size, but i am not sure
how this would be done (i haven't found a way to resize an already
existing shared memory segment as long as processes are attached to it)
so we might have to notify all related objects that they should detach
themselves (which i don't know how to do)
remember that the given size is just the amount of memory reserved.
you can send images of any size via this segment, as long as the data
fits into the reserved memory.
so i am not sure whether there is a realy need for resizing on the fly.
one possibility that comes to my mind is, that we could use 2 portions
of shared memory: one fixed-sized segment which just holds the key to
the actual data segment (and probably all the meta-data such as
dimensions,...)
however, i am not sure whether this all would work with multiple
[pix_share_write]s accessing the same memory (which i think is a nice
feature, though i don't have an application at hand)
hmm. one of my ideas was to export the shared-memory thing into a
different set of objects (not related to Gem!)
then a pointer to this memory would be passed to the read/write objects.
this way they would not need to know anything about shared memory and it
would allow for the biggest flexibility.