<div dir="ltr">hi, <div><br></div><div>i&#39;m experiencing some strange behavior with pix_share_write/read</div><div>sometimes i get this error when setting pix_share_write : </div><div>couldn&#39;t get shm_id: error 0<br>



</div>
<div>but i couldn&#39;t reproduce this, it seems it happens when a patch with pix_share_write crashes (due to errors in a V4L2 device)</div><div>after reloading the patch, pix_share_write can&#39;t initialize correctly</div>

<div>it happens not so often, but when it does i can&#39;t understand why and I have to change the ID in the [set( message to find a working one</div><div><br></div><div style>I made few changes in the code of pix_share_* to forward the error though an outlet</div>

<div style>so I can automatically try another ID</div><div style><br></div><div style>this is in my github repos in the branch pix_share_write :</div><div style><a href="https://github.com/avilleret/Gem/tree/pix_share_write">https://github.com/avilleret/Gem/tree/pix_share_write</a><br>

</div><div style><br></div><div style>I don&#39;t know if it&#39;s a good idea but it seems to work for me</div><div style><br></div><div style>I&#39;m wondering if it could be good to have a dictionary instead of a hash table :</div>

<div style>when we use [set id sizex sizey pixel_format( message, pix_share* could try to find the id in the dictionary</div><div style>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</div>

<div style>if it fails it could generates another id until it succeed and store the id in the dictionary</div><div style><br></div><div style>pix_share_read will know the dictionary and can find the right shmem id</div><div style>

<br></div><div style>what do you think about that ?</div><div style><br></div><div style>kind regards</div><div style><br></div><div style>antoine</div>
<div><br><div><div class="gmail_extra"><br clear="all"><div>--<br>do it yourself                       <br><a href="http://antoine.villeret.free.fr" target="_blank">http://antoine.villeret.free.fr</a><br></div>


<br></div></div></div></div>