[MPlayer-dev-eng] [PATCH] shmem - stream

Vladimir Voroshilov voroshil at gmail.com
Wed Sep 12 10:48:48 CEST 2007


2007/9/12, Ötvös Attila <oattila at chello.hu>:
> 2007. szeptember 12. 09.04 dátummal Vladimir Voroshilov ezt írta:
> > 2007/9/12, Ötvös Attila <oattila at chello.hu>:
> > > Hi All!
> > >
> > > This patch implement shared video frames between more programs
(mplayer
> > > or mencoder) with shared memory special stream (similar TV stream).
> > >
> > > This patch add shmem and semaprhore detect to configure, add
> > > stream_shmem.c.
> >
> > shmem detect already exists in configure (search for HAVE_SHM)
>
> Hi Vladimir Voroshilov!
>
> I used shared memory:
> "#define HAVE_SHMEM 1" in config.h
> "SHMEM=yes" in config.mak
>
> semaphores:
> "#define HAVE_SHEMAPOHORE 1" in config.h
>
> configure part in patch:
>
> @@ -5489,6 +5497,45 @@
>      _noinputmodules="cddb $_noinputmodules"
>  fi
>
> +echocheck "shmem"
> +if test "$_shmem" = auto ; then
> +  cat > $TMPC << EOF
> +#include <sys/types.h>
> +#include <sys/shm.h>
> +int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return
> 0; }
> +EOF
> +  _shmem=no
> +  cc_check && _shmem=yes
> +fi
> +if test "$_shmem" = yes ; then
> +  _def_shmem='#define HAVE_SHMEM 1'
> +  _inputmodules="shmem $_inputmodules"
> +else
> +  _def_shmem='#undef HAVE_SHMEM'
> +  _noinputmodules="shmem $_noinputmodules"
> +fi
> +echores "$_shmem"

compare above code with:

echocheck "shm"
if test "$_shm" = auto ; then
  cat > $TMPC << EOF
#include <sys/types.h>
#include <sys/shm.h>
int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0;
}
EOF
  _shm=no
  cc_check && _shm=yes
fi
if test "$_shm" = yes ; then
  _def_shm='#define HAVE_SHM 1'
else
  _def_shm='#undef HAVE_SHM'
fi
echores "$_shm"

...  and "find ten differences" (c)

You'll should only change HAVE_SHMEM to HAVE_SHM,
add "SHM=$_shm" in proper place into configure and change $(SHMEM) to $(SHM)
in your make files.


-- 
Regards,
Vladimir Voroshilov     mailto:voroshil at gmail.com
JID: voroshil at gmail.com, voroshil at jabber.ru
ICQ: 95587719



More information about the MPlayer-dev-eng mailing list