[vlc-devel] [PATCH] Add motiondetect options to resend values over UDP
Jean-Baptiste Kempf
jb at videolan.org
Mon Jun 11 17:38:05 CEST 2012
On Sat, Jun 09, 2012 at 01:56:01PM +0200, Gonzague Defos du Rau wrote :
> If --motiondetect-port is given, detected boxes values are send on the specified UDP port.
> You can also use --motiondetect-ip.
Does it work on Ipv6 ?
> +/* Boxes UDP resend */
> +#include <vlc_network.h>
Put it on the same line.
> + /* Boxes UDP resend . Default port is to zero = unactive */
> + add_integer(FILTER_PREFIX "port", 0, "motiondetect resend udp port", "resend detected boxes values over udp, default is not active", false)
> + add_string(FILTER_PREFIX "ip", "127.0.0.1", "motiondetect resend udp ip", "resend detected boxes values over udp, default is localhost", true)
Wrap your line and use translatable strings and remove comment.
> +/* Boxes UDP resend, options */
> +static const char *const ppsz_filter_options[] = {
> + "port", "ip", NULL
> +};
Why not using a classical dest?
> + config_ChainParse( p_filter, FILTER_PREFIX, ppsz_filter_options, p_filter->p_cfg );
> + int i_port = var_CreateGetIntegerCommand( p_filter, FILTER_PREFIX "port" );
> + char *psz_master = var_InheritString( p_filter, FILTER_PREFIX "ip");
Why the difference in var_ ?
> + /* Boxes UDP resend, send boxes datas */
> + if( p_sys->port > 0)
> + {
> + char buffer[NUM_COLORS] = "";
> + sprintf(buffer, "%d %d %d %d %d ;\n", j, color_x_min, color_x_max, color_y_min, color_y_max);
> + if ( send( p_sys->fd, buffer, sizeof( buffer ), 0 ) <= 0 )
> + {
> + msg_Err( p_filter, "Can not send to socket");
> + }
> + }
Where is the format documented?
Best regards,
--
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device
More information about the vlc-devel
mailing list