]> git.sesse.net Git - vlc/blobdiff - modules/access/linsys/linsys_sdi.c
Fix YV12 support in opengl output (when shader is in use).
[vlc] / modules / access / linsys / linsys_sdi.c
index 4a14c5b1e5769556d3ada89b9cee8450f4b6be12..3b6f9c168e5619220376eb24c7a13a510cc0efa5 100644 (file)
 /*****************************************************************************
  * Module descriptor
  *****************************************************************************/
-#define CACHING_TEXT N_("Caching value in ms")
-#define CACHING_LONGTEXT N_( \
-    "Allows you to modify the default caching value for sdi capture " \
-    "streams. This value should be set in millisecond units." )
 #define LINK_TEXT N_("Link #")
 #define LINK_LONGTEXT N_( \
     "Allows you to set the desired link of the board for the capture (starting at 0)." )
@@ -94,12 +90,10 @@ static void DemuxClose( vlc_object_t * );
 
 vlc_module_begin()
     set_description( N_("SDI Input") )
-    set_shortname( N_("sdi") )
+    set_shortname( N_("SDI") )
     set_category( CAT_INPUT )
     set_subcategory( SUBCAT_INPUT_ACCESS )
 
-    add_integer( "linsys-sdi-caching", DEFAULT_PTS_DELAY / 1000,
-        CACHING_TEXT, CACHING_LONGTEXT, true )
     add_integer( "linsys-sdi-link", 0,
         LINK_TEXT, LINK_LONGTEXT, true )
 
@@ -309,9 +303,6 @@ static int Open( vlc_object_t *p_this )
     p_demux->pf_control  = Control;
     p_sys = p_demux->p_sys;
 
-    /* Update default_pts to a suitable value for sdi access */
-    var_Create( p_demux, "linsys-sdi-caching", VLC_VAR_INTEGER|VLC_VAR_DOINHERIT );
-
     p_sys->i_link = var_InheritInteger( p_demux, "linsys-sdi-link" );
 
     if( InitCapture( p_demux ) != VLC_SUCCESS )
@@ -392,7 +383,8 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
 
         case DEMUX_GET_PTS_DELAY:
             pi64 = (int64_t*)va_arg( args, int64_t * );
-            *pi64 = (int64_t)var_GetInteger( p_demux, "linsys-sdi-caching" ) * 1000;
+            *pi64 = INT64_C(1000)
+                  * var_InheritInteger( p_demux, "live-caching" );
             return VLC_SUCCESS;
 
         /* TODO implement others */
@@ -1768,7 +1760,7 @@ static int InitCapture( demux_t *p_demux )
                                            PROT_READ, MAP_SHARED, p_sys->i_fd,
                                            i * i_bufmemsize )) == MAP_FAILED )
         {
-            msg_Err( p_demux, "couldn't mmap(%d): %s", i, strerror(errno) );
+            msg_Err( p_demux, "couldn't mmap(%d): %m", i );
             free( p_sys->pp_buffers );
             return VLC_EGENERIC;
         }
@@ -1798,7 +1790,7 @@ static int Capture( demux_t *p_demux )
 
     if ( poll( &pfd, 1, READ_TIMEOUT ) < 0 )
     {
-        msg_Warn( p_demux, "couldn't poll(): %s", strerror(errno) );
+        msg_Warn( p_demux, "couldn't poll(): %m" );
         return VLC_EGENERIC;
     }
 
@@ -1807,7 +1799,7 @@ static int Capture( demux_t *p_demux )
         unsigned int i_val;
 
         if ( ioctl( p_sys->i_fd, SDI_IOC_RXGETEVENTS, &i_val ) < 0 )
-            msg_Warn( p_demux, "couldn't SDI_IOC_RXGETEVENTS %s", strerror(errno) );
+            msg_Warn( p_demux, "couldn't SDI_IOC_RXGETEVENTS %m" );
         else
         {
             if ( i_val & SDI_EVENT_RX_BUFFER )
@@ -1827,7 +1819,7 @@ static int Capture( demux_t *p_demux )
 
         if ( ioctl( p_sys->i_fd, SDI_IOC_DQBUF, p_sys->i_current_buffer ) < 0 )
         {
-            msg_Warn( p_demux, "couldn't SDI_IOC_DQBUF %s", strerror(errno) );
+            msg_Warn( p_demux, "couldn't SDI_IOC_DQBUF %m" );
             return VLC_EGENERIC;
         }
 
@@ -1837,7 +1829,7 @@ static int Capture( demux_t *p_demux )
 
         if ( ioctl( p_sys->i_fd, SDI_IOC_QBUF, p_sys->i_current_buffer ) < 0 )
         {
-            msg_Warn( p_demux, "couldn't SDI_IOC_QBUF %s", strerror(errno) );
+            msg_Warn( p_demux, "couldn't SDI_IOC_QBUF %m" );
             return VLC_EGENERIC;
         }