]> git.sesse.net Git - vlc/blobdiff - modules/access/dv.c
More avoidable directories
[vlc] / modules / access / dv.c
index 6dc1da4a4f69bb51ce509202b713df89f1981362..1fd7cd52fad9ed6a3a1c937d2d9b8d5f91ec9885 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include <vlc/vlc.h>
 #include <vlc_access.h>
 
-#include <stdlib.h>
-#include <string.h>
 #include <errno.h>
 #ifdef HAVE_SYS_TYPES_H
 #   include <sys/types.h>
@@ -75,8 +77,8 @@ vlc_module_begin();
     set_shortname( _("dv") );
     set_category( CAT_INPUT );
     set_subcategory( SUBCAT_INPUT_ACCESS );
-    add_integer( "dv-caching", 60000 / 1000, NULL, CACHING_TEXT, CACHING_LONGTEXT, VLC_TRUE );
-    set_capability( "access2", 0 );
+    add_integer( "dv-caching", 60000 / 1000, NULL, CACHING_TEXT, CACHING_LONGTEXT, true );
+    set_capability( "access", 0 );
     add_shortcut( "dv" );
     add_shortcut( "dv1394" );
     add_shortcut( "raw1394" );
@@ -144,7 +146,7 @@ static int Open( vlc_object_t *p_this )
     /* Set up p_access */
     access_InitFields( p_access );
     ACCESS_SET_CALLBACKS( NULL, Block, Control, NULL );
-    p_access->info.b_prebuffered = VLC_FALSE;
+    p_access->info.b_prebuffered = false;
 
     p_access->p_sys = p_sys = malloc( sizeof( access_sys_t ) );
     if( !p_sys )
@@ -163,7 +165,7 @@ static int Open( vlc_object_t *p_this )
     p_sys->p_frame = NULL;
     p_sys->p_ev = NULL;
 
-    vlc_mutex_init( p_access, &p_sys->lock );
+    vlc_mutex_init( &p_sys->lock );
 
     p_sys->i_node = DiscoverAVC( p_access, &p_sys->i_port, p_sys->i_guid );
     if( p_sys->i_node < 0 )
@@ -229,13 +231,13 @@ static int Open( vlc_object_t *p_this )
         free( psz_name );
         return VLC_EGENERIC;
     }
-    
     p_sys->p_ev->p_frame = NULL;
     p_sys->p_ev->pp_last = &p_sys->p_ev->p_frame;
     p_sys->p_ev->p_access = p_access;
-    vlc_mutex_init( p_access, &p_sys->p_ev->lock );
+    vlc_mutex_init( &p_sys->p_ev->lock );
     vlc_thread_create( p_sys->p_ev, "dv event thread handler", Raw1394EventThread,
-                       VLC_THREAD_PRIORITY_OUTPUT, VLC_FALSE );
+                       VLC_THREAD_PRIORITY_OUTPUT, false );
 
     free( psz_name );
     return VLC_SUCCESS;
@@ -252,7 +254,7 @@ static void Close( vlc_object_t *p_this )
     if( p_sys->p_ev )
     {
         /* stop the event handler */
-        p_sys->p_ev->b_die = VLC_TRUE;
+        vlc_object_kill( p_sys->p_ev );
 
         if( p_sys->p_raw1394 )
             raw1394_stop_iso_rcv( p_sys->p_raw1394, p_sys->i_channel );
@@ -269,7 +271,7 @@ static void Close( vlc_object_t *p_this )
             p_sys->p_ev->pp_last = &p_sys->p_frame;
             vlc_mutex_unlock( &p_sys->p_ev->lock );
         }
-        vlc_object_destroy( p_sys->p_ev );
+        vlc_object_release( p_sys->p_ev );
     }
 
     if( p_sys->p_frame )
@@ -289,22 +291,22 @@ static void Close( vlc_object_t *p_this )
 static int Control( access_t *p_access, int i_query, va_list args )
 {
     access_sys_t *p_sys = p_access->p_sys;
-    vlc_bool_t   *pb_bool;
+    bool   *pb_bool;
     int64_t      *pi_64;
 
     switch( i_query )
     {
         /* */
         case ACCESS_CAN_PAUSE:
-            pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t* );
-            *pb_bool = VLC_TRUE;
+            pb_bool = (bool*)va_arg( args, bool* );
+            *pb_bool = true;
             break;
 
        case ACCESS_CAN_SEEK:
        case ACCESS_CAN_FASTSEEK:
        case ACCESS_CAN_CONTROL_PACE:
-            pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t* );
-            *pb_bool = VLC_FALSE;
+            pb_bool = (bool*)va_arg( args, bool* );
+            *pb_bool = false;
             break;
 
         case ACCESS_GET_PTS_DELAY:
@@ -321,6 +323,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
         case ACCESS_SET_TITLE:
         case ACCESS_SET_SEEKPOINT:
         case ACCESS_SET_PRIVATE_ID_STATE:
+        case ACCESS_GET_CONTENT_TYPE:
             return VLC_EGENERIC;
 
         default:
@@ -471,13 +474,13 @@ static int Raw1394GetNumPorts( access_t *p_access )
     /* get a raw1394 handle */
     if ( !( handle = raw1394_new_handle() ) )
     {
-        msg_Err( p_access, "raw1394 - failed to get handle: %s.\n", strerror( errno ) );
+        msg_Err( p_access, "raw1394 - failed to get handle: %m." );
         return VLC_EGENERIC;
     }
 
     if ( ( n_ports = raw1394_get_port_info( handle, pinf, 16 ) ) < 0 )
     {
-        msg_Err( p_access, "raw1394 - failed to get port info: %s.\n", strerror( errno ) );
+        msg_Err( p_access, "raw1394 - failed to get port info: %m.\n" );
         raw1394_destroy_handle( handle );
         return VLC_EGENERIC;
     }
@@ -503,13 +506,13 @@ static raw1394handle_t Raw1394Open( access_t *p_access, int port )
 
     if ( !handle )
     {
-        msg_Err( p_access, "raw1394 - failed to get handle: %s.\n", strerror( errno ) );
+        msg_Err( p_access, "raw1394 - failed to get handle: %m." );
         return NULL;
     }
 
     if ( ( n_ports = raw1394_get_port_info( handle, pinf, 16 ) ) < 0 )
     {
-        msg_Err( p_access, "raw1394 - failed to get port info: %s.\n", strerror( errno ) );
+        msg_Err( p_access, "raw1394 - failed to get port info: %m." );
         raw1394_destroy_handle( handle );
         return NULL;
     }
@@ -517,7 +520,7 @@ static raw1394handle_t Raw1394Open( access_t *p_access, int port )
     /* tell raw1394 which host adapter to use */
     if ( raw1394_set_port( handle, port ) < 0 )
     {
-        msg_Err( p_access, "raw1394 - failed to set set port: %s.\n", strerror( errno ) );
+        msg_Err( p_access, "raw1394 - failed to set set port: %m." );
         return NULL;
     }