This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DM355 IPIPE resize

Hello,everyone:

      I have a trouble now . The platform which I use is DM355.

      In  the encode  demo,  there  are   five threads of  capture,display,video,writer  and  ctrl  .  And  in  capture  thread   and  display  thread ,there are two 

       Rszcopy_create()   calls .  Now , in  the display  thread, I  add  a  RSZ_init()  call  to  resize  the   image .   But   when  I  run   it   , it  tells  me : device  is  already opened

       Failed  to  open  /dev/dm355_ipipe  .  Why ?

      Thanks  a  lot .  If   I  want  to use  resizer  to  realize   my  copy job  and  resize job  ,how  should  I do ?  Can  I  open  the dev  /dev/dm355_ipipe  for  2  or 3 times ?

  • How many instances of a particular device you can open depends on how driver was written; a device instance returns a handle that will allow user application to access corresponding hardware.  For video hardware, more often than not, it does not make sense to allow multiple clients (we must assume independant clients since we have no knowledege or control on how users will write their applications) to get access to same video hardware since they will be trampling on each other and perhaps thrashing the video data that hardware is processing for the other user thread.  Therefore, for most video hardware, you will find only once instance of a device representing a particular piece of hardware can be opened at any one time.

    If multiple interdependant threads need access to same hardware, then device should be opened once during init, and the handle should be shared among interdependant threads in a manner in which they do not trample on each other.

    That said, resizer is already being used by demos (see utils/rszcopy) and hence you can add calls to resizer, but there is no need to open new instance.