[vlc-devel] [PATCH 1/1] Supporting ONVIF PRofile-G recording playback

David R. Robison david.robison at openroadsconsulting.com
Mon Aug 4 20:17:26 CEST 2014


See inline. David

David R Robison
Open Roads Consulting, Inc.
103 Watson Road, Chesapeake, VA 23320
phone: (757) 546-3401
e-mail: david.robison at openroadsconsulting.com
web: http://openroadsconsulting.com
blog: http://therobe.blogspot.com
book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526

On 8/4/2014 1:47 PM, Rémi Denis-Courmont wrote:
> Le lundi 4 août 2014, 13:31:28 David R. Robison a écrit :
>> diff --git a/include/vlc_variables.h b/include/vlc_variables.h
>> index 420f0b4..4f7c432 100644
>> --- a/include/vlc_variables.h
>> +++ b/include/vlc_variables.h
>> @@ -60,6 +60,7 @@
>>    #define VLC_VAR_TIME      0x0060
>>    #define VLC_VAR_ADDRESS   0x0070
>>    #define VLC_VAR_COORDS    0x00A0
>> +#define VLC_VAR_TIMERNG   0x00B0
> Why do you need a new variable type?
>
> That's a lot of code for just one variable.
This is because it has two values like the COORS, a from and a to value.
>
>>    /**@}*/
>>
>>    /** \defgroup var_flags Additive flags
>> diff --git a/lib/libvlc.sym b/lib/libvlc.sym
>> index c0c66dd..858af30 100644
>> --- a/lib/libvlc.sym
>> +++ b/lib/libvlc.sym
>> @@ -173,6 +173,7 @@ libvlc_media_player_set_nsobject
>>    libvlc_media_player_set_position
>>    libvlc_media_player_set_rate
>>    libvlc_media_player_set_time
>> +libvlc_media_player_set_timerng
> Maybe just me, but that does not sound very evocative as a function name.
>
> Plus RNG means Random Number Generator in IT context.
OK, I could call it set_absolute_range. How does this sound?
>
>>    libvlc_media_player_set_title
>>    libvlc_media_player_set_xwindow
>>    libvlc_media_player_stop
>> diff --git a/lib/media_player.c b/lib/media_player.c
>> index b31a832..a440cba 100644
>> --- a/lib/media_player.c
>> +++ b/lib/media_player.c
>> @@ -1070,6 +1070,19 @@ void libvlc_media_player_set_time(
>> libvlc_media_player_t *p_mi,
>>        vlc_object_release( p_input_thread );
>>    }
>>
>> +void libvlc_media_player_set_timerng( libvlc_media_player_t *p_mi,
>> +                                   libvlc_time_t i_time_f,
>> libvlc_time_t i_time_t )
>> +{
>> +    input_thread_t *p_input_thread;
>> +
>> +    p_input_thread = libvlc_get_input_thread ( p_mi );
>> +    if( !p_input_thread )
>> +        return;
>> +
>> +    var_SetTimeRng( p_input_thread, "timerng", to_mtime(i_time_f),
>> to_mtime(i_time_t) );
>> +    vlc_object_release( p_input_thread );
>> +}
> How is that different from setting (start-)time *and* end-time?

Hmmm. Maybe I missed something. I see a set time but not a set end time. 
Also, by allowing both to be set at once we can process them together 
which means a single PLAY request to the video source. I guess I could 
set the end first and then the start to get the same effect.

>
>> +
>>    void libvlc_media_player_set_position( libvlc_media_player_t *p_mi,
>>                                           float position )
>>    {
>> diff --git a/modules/access/live555.cpp b/modules/access/live555.cpp
>> index b14898c..cfbc95a 100644
>> --- a/modules/access/live555.cpp
>> +++ b/modules/access/live555.cpp
>> @@ -233,6 +233,8 @@ struct demux_sys_t
>>        int              i_live555_ret; /* live555 callback return code */
>>
>>        float            f_seek_request;/* In case we receive a seek
>> request while paused*/
>> +    mtime_t          i_timerng_request_f;/* In case we receive a set
>> time range request while paused*/
>> +    mtime_t          i_timerng_request_t;/* In case we receive a set
>> time range request while paused*/
>>    };
>>
>>
>> @@ -317,6 +319,8 @@ static int  Open ( vlc_object_t *p_this )
>>        p_sys->psz_path = strdup( p_demux->psz_location );
>>        p_sys->b_force_mcast = var_InheritBool( p_demux, "rtsp-mcast" );
>>        p_sys->f_seek_request = -1;
>> +    p_sys->i_timerng_request_f = -1;
>> +    p_sys->i_timerng_request_t = -1;
>>
>>        /* parse URL for rtsp://[user:[passwd]@]serverip:port/options */
>>        vlc_UrlParse( &p_sys->url, p_sys->psz_path, 0 );
>> @@ -1415,6 +1419,16 @@ static int Demux( demux_t *p_demux )
>>    }
>>
>>   
>> /**************************************************************************
>> *** + * Format a time string for the RTSP header
>> +
>> ****************************************************************************
>> */ +static char* makeRtspTime(char* buf, int buflen, mtime_t msecs) { +
>> time_t secs = msecs / 1000;
>> +    if (secs <= 0) return NULL;
>> +    strftime(buf, buflen, "%Y%m%dT%H%M%S.000Z", gmtime(&secs));
>> +    return buf;
> Not reentrant.
Is it the call to strftime that is not reentrant?
>
>> +}
>> +
>> +/**************************************************************************
>> *** * Control:
>> ****************************************************************************
>> */ static int Control( demux_t *p_demux, int i_query, va_list args ) @@
>> -1521,6 +1535,62 @@ static int Control( demux_t *p_demux, int
>> i_query, va_list args )
>>                }
>>                return VLC_EGENERIC;
>>
>> +        case DEMUX_SET_TIMERNG:
>> +            if( p_sys->rtsp )
>> +            {
>> +                int i;
>> +                mtime_t timerng_f = (mtime_t)va_arg( args, mtime_t );
>> +                mtime_t timerng_t = (mtime_t)va_arg( args, mtime_t );
> What's the cast for? And confusing variable names IMHO.
Understood. I can remove the cast. I was copying what was done in other 
blocks. I can change this.
>



This email communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed.
If you are not the intended recipient, please delete this email immediately.




More information about the vlc-devel mailing list