[vlc-devel] [PATCH] Add motiondetect options to resend values over UDP

gonzague gonzagueddr at gmail.com
Wed Jun 13 07:01:58 CEST 2012


Hi, and thanks for reply.
Sorry to say that again, but i'm not a developer, all i've done is some 
copy/paste, that's why most of my reply will be "i don't understand" or 
"i don't know".

On 11/06/2012 17:38, Jean-Baptiste Kempf wrote:
> 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 ?
I don't know. i've try --motiondetect-ip=fe80::230:5ff:feea:8379/64 and 
it "Can not open socket".
So i've tried "ping6 fe80::230:5ff:feea:8379/64" and it returns  
"unknown host", so i don't know how to test this.
Should i remove this ip option ?

>
>> +/*  Boxes UDP resend */
>> +#include<vlc_network.h>
> Put it on the same line.

I was not sure, i just remove the comment, ok ?

>
>> +    /*  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.
Not sure i get that, i have modified doing :

#define PORT_TEXT N_( "motiondetect resend udp port" )
#define PORT_LONGTEXT N_( \
         "resend detected boxes values over udp, default is not active" )

and then using :

     add_integer(FILTER_PREFIX "port", 0,
              PORT_TEXT, PORT_LONGTEXT, false)


Is that what i have to do ? ( also i did it for IP_TEXT )

>
>> +/*  Boxes UDP resend, options */
>> +static const char *const ppsz_filter_options[] = {
>> +    "port", "ip", NULL
>> +};
> Why not using a classical dest?

If you mean "localhost", i think it's a good idea to be able to use 
another machine to parse received datas, it also allow broadcasting ( 
--motiondetect-ip=192.168.255.255 )

>
>> +    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_ ?

I really don't know, i thought this was the way to "get" the arguments, 
i've just copy/paste this from another module.

>
>> +        /*  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?

I guess you're talking about the format of the sent packet.
If so, i had this comment :

         /**
          * Boxes UDP resend, send boxes datas.
          * The packet concatenate boxe's number,
          * x_min, x_max, y_min and y_max separated by a space.
          * Packet is ending with "space semi-colon new-line" (" ;\n")
          * so it can be read by others soft like puredata.
          */

Is that ok or should i put this elsewhere ?

Thanks again for your time.

Gonzague

>
> Best regards,
>






More information about the vlc-devel mailing list