[MPlayer-dev-eng] [PATCH] shared memory stream - part 1

Diego Biurrun diego at biurrun.de
Sun Aug 12 14:41:36 CEST 2007


On Sun, Aug 12, 2007 at 02:49:36AM +0200, Ötvös Attila wrote:
> 
> I updated.
> 
> --- stream/Makefile	(revision 24045)
> +++ stream/Makefile	(working copy)
> @@ -54,6 +54,7 @@
>  SRCS_COMMON-$(TV_V4L2)           += tvi_v4l2.c audio_in.c
>  SRCS_COMMON-$(VCD)               += stream_vcd.c
>  SRCS_COMMON-$(VSTREAM)           += stream_vstream.c
> +SRCS_COMMON-$(SHMEM)             += stream_shmem.c

alphabetical order

> --- stream/stream_shmem.c	(revision 0)
> +++ stream/stream_shmem.c	(revision 0)
> @@ -0,0 +1,492 @@
> +/*
> + *  stream_shmem.c
> + *
[...]
> +
> +/*
> + *  Shmem stream allow you sharing video frames through shared memory.
> + */

This does not address Benjamin's comment.  The first line of a file
header should not be the filename.  That is redundant and useless
information.  Put a line or two there that describe what the file is all
about.

> --- stream/stream_shmem.h	(revision 0)
> +++ stream/stream_shmem.h	(revision 0)
> @@ -0,0 +1,5 @@
> +
> +#define SHMEM_RAWREAD   0
> +#define SHMEM_MAX_TYPE	0
> +
> +void set_shmem_opts(int type, int size, int demuxer_type, int format, int width, int height);

Please add a license header to all new files.

> --- configure	(revision 24045)
> +++ configure	(working copy)
> @@ -5269,6 +5273,27 @@
>  fi #if irix
>  
>  
> +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"
> +
> +
> +
>  echocheck "VCD support"
>  if linux || bsdos || freebsd || netbsd || sunos || darwin || mingw32; then
>    _inputmodules="vcd $_inputmodules"

I would prefer if you could add this below the other input modules
(CDDB).

> @@ -7788,6 +7814,9 @@
>  /* Define to include support for libdv-0.9.5 */
>  $_def_libdv
>  
> +/* Define this if use shmem  */
> +$_def_shmem
> +
>  /* If build mencoder */
>  $_mencoder_flag

same here

Admittedly, configure is a bit messy about the order of tests, I'll try
to clean this up eventually.

> --- DOCS/man/en/mplayer.1	(revision 24045)
> +++ DOCS/man/en/mplayer.1	(working copy)
> @@ -6786,8 +6805,41 @@
>  Threshold below which a pixel value is considered black (default: 32).
>  .RE
>  .
> +.TP
> +.B shmemout[=shmemid:fmt:w:h:o]
> +Export video frames to shared memory.
> +.RSs
> +.IPs <shmemid>
> +shared memory id (default: 1000).

ID

> +.IPs <fmt>
> +format name of export video frames: yv12, i420, yuy2, y8, y800, rgb24, bgr24.

format of exported video frames

> +.IPs <w,h>
> +width and height of export video frames (default: current video width and height)

exported

> +1: enable (only shared memory, without osd scale)
> +.br
> +2: enable (only shared memory, with osd scale)

OSD

> +.IPs <shmemid>
> +shared memory id (default: 1000).

ID

> +.IPs <x,y>
> +top left corner of import video frames (default: 0,0)

imported

> +.IPs <w,h>
> +width and height of import video frames (default: exported video frames width and height)

imported

> @@ -10558,7 +10610,34 @@
>  .
> +.PP
> +.B Show the encoded tv channels on shared screen (eg. CCTV):

TV

> +.B Preview encoding file with osd:

?

> --- cfg-common.h	(revision 24045)
> +++ cfg-common.h	(working copy)
> @@ -147,6 +147,9 @@
>  #else
>  	{"tv", "MPlayer was compiled without TV interface support.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL},
>  #endif
> +#ifdef HAVE_SHMEM
> +	{"ors", &out_raw_stream_name, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL},
> +#endif

I thought this was unneeded...

Diego



More information about the MPlayer-dev-eng mailing list