]> git.sesse.net Git - vlc/blobdiff - modules/access/rtsp/access.c
vlc_plugin: fix non-LGPL plugins meta infos
[vlc] / modules / access / rtsp / access.c
index b23634bbf1d71ec1ca32f560363d2ea75092c95a..3a05be833a05865d88e340c03b8cb4a4e450eb8f 100644 (file)
@@ -28,6 +28,7 @@
 # include "config.h"
 #endif
 
+#define VLC_MODULE_LICENSE VLC_LICENSE_GPL_2_PLUS
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_access.h>
 static int  Open ( vlc_object_t * );
 static void Close( vlc_object_t * );
 
-#define CACHING_TEXT N_("Caching value (ms)")
-#define CACHING_LONGTEXT N_( \
-    "Caching value for RTSP streams. This " \
-    "value should be set in milliseconds." )
-
 vlc_module_begin ()
     set_description( N_("Real RTSP") )
     set_shortname( N_("Real RTSP") )
     set_category( CAT_INPUT )
     set_subcategory( SUBCAT_INPUT_ACCESS )
-    add_integer( "realrtsp-caching", 3000, NULL,
-                 CACHING_TEXT, CACHING_LONGTEXT, true )
-        change_safe()
     set_capability( "access", 10 )
     set_callbacks( Open, Close )
-    add_shortcut( "realrtsp" )
-    add_shortcut( "rtsp" )
-    add_shortcut( "pnm" )
+    add_shortcut( "realrtsp", "rtsp", "pnm" )
 vlc_module_end ()
 
 
@@ -142,7 +133,7 @@ static int RtspWrite( void *p_userdata, uint8_t *p_buffer, int i_buffer )
 
     //fprintf(stderr, "Write: %s", p_buffer);
 
-    net_Printf( VLC_OBJECT(p_access), p_sys->fd, 0, "%s", p_buffer );
+    net_Printf( p_access, p_sys->fd, 0, "%s", p_buffer );
 
     return 0;
 }
@@ -169,12 +160,8 @@ static int Open( vlc_object_t *p_this )
     p_access->pf_block = BlockRead;
     p_access->pf_seek = Seek;
     p_access->pf_control = Control;
-    p_access->info.i_update = 0;
-    p_access->info.i_size = 0;
     p_access->info.i_pos = 0;
     p_access->info.b_eof = false;
-    p_access->info.i_title = 0;
-    p_access->info.i_seekpoint = 0;
     p_access->p_sys = p_sys = malloc( sizeof( access_sys_t ) );
     if( !p_sys )
         return VLC_ENOMEM;
@@ -193,10 +180,10 @@ static int Open( vlc_object_t *p_this )
     p_sys->p_rtsp->pf_read_line = RtspReadLine;
     p_sys->p_rtsp->pf_write = RtspWrite;
 
-    i_result = rtsp_connect( p_sys->p_rtsp, p_access->psz_path, 0 );
+    i_result = rtsp_connect( p_sys->p_rtsp, p_access->psz_location, 0 );
     if( i_result )
     {
-        msg_Dbg( p_access, "could not connect to: %s", p_access->psz_path );
+        msg_Dbg( p_access, "could not connect to: %s", p_access->psz_location );
         free( p_sys->p_rtsp );
         p_sys->p_rtsp = NULL;
         goto error;
@@ -240,7 +227,7 @@ static int Open( vlc_object_t *p_this )
             goto error;
         }
 
-        p_sys->p_header = block_New( p_access, 4096 );
+        p_sys->p_header = block_Alloc( 4096 );
         p_sys->p_header->i_buffer =
             rmff_dump_header( h, (char *)p_sys->p_header->p_buffer, 1024 );
         rmff_free_header( h );
@@ -251,10 +238,6 @@ static int Open( vlc_object_t *p_this )
         goto error;
     }
 
-    /* Update default_pts to a suitable value for file access */
-    var_Create( p_access, "realrtsp-caching",
-                VLC_VAR_INTEGER | VLC_VAR_DOINHERIT);
-
     free( psz_server );
     return VLC_SUCCESS;
 
@@ -297,7 +280,7 @@ static block_t *BlockRead( access_t *p_access )
     i_size = real_get_rdt_chunk_header( p_access->p_sys->p_rtsp, &pheader );
     if( i_size <= 0 ) return NULL;
 
-    p_block = block_New( p_access, i_size );
+    p_block = block_Alloc( i_size );
     p_block->i_buffer = real_get_rdt_chunk( p_access->p_sys->p_rtsp, &pheader,
                                             &p_block->p_buffer );
 
@@ -321,7 +304,6 @@ static int Control( access_t *p_access, int i_query, va_list args )
 {
     switch( i_query )
     {
-        /* */
         case ACCESS_CAN_SEEK:
         case ACCESS_CAN_FASTSEEK:
         case ACCESS_CAN_PAUSE:
@@ -333,25 +315,15 @@ static int Control( access_t *p_access, int i_query, va_list args )
             break;
 
         case ACCESS_GET_PTS_DELAY:
-            *va_arg( args, int64_t * ) =
-                    (int64_t)var_GetInteger(p_access,"realrtsp-caching")*1000;
+            *va_arg( args, int64_t * ) = INT64_C(1000)
+                * var_InheritInteger(p_access, "network-caching");
             break;
 
-        /* */
         case ACCESS_SET_PAUSE_STATE:
             /* Nothing to do */
             break;
 
-        case ACCESS_GET_TITLE_INFO:
-        case ACCESS_SET_TITLE:
-        case ACCESS_SET_SEEKPOINT:
-        case ACCESS_SET_PRIVATE_ID_STATE:
-        case ACCESS_GET_META:
-        case ACCESS_GET_CONTENT_TYPE:
-            return VLC_EGENERIC;
-
         default:
-            msg_Warn( p_access, "unimplemented query in control" );
             return VLC_EGENERIC;
     }