hi,
i'm experiencing some strange behavior with pix_share_write/read
sometimes i get this error when setting pix_share_write :
couldn't get shm_id: error 0
but i couldn't reproduce this, it seems it happens when a patch with pix_share_write crashes (due to errors in a V4L2 device)
after reloading the patch, pix_share_write can't initialize correctly
it happens not so often, but when it does i can't understand why and I have to change the ID in the [set( message to find a working one
I made few changes in the code of pix_share_* to forward the error though an outlet
so I can automatically try another ID
this is in my github repos in the branch pix_share_write :
I don't know if it's a good idea but it seems to work for me
I'm wondering if it could be good to have a dictionary instead of a hash table :
when we use [set id sizex sizey pixel_format( message, pix_share* could try to find the id in the dictionary
if there is no entry with that id, it generates a random shmem id, verify that nobody else is using it and tries to allocated data
if it fails it could generates another id until it succeed and store the id in the dictionary
pix_share_read will know the dictionary and can find the right shmem id
what do you think about that ?
kind regards
antoine