]> git.sesse.net Git - vlc/blobdiff - modules/access/eyetv.m
macosx/open: added controls to capture Live Audio along with the current screen content
[vlc] / modules / access / eyetv.m
index dad8c053f1c5b1ee085df6b36ac49fe9aec6668b..bc02edaf72b6b51e2455a7ac49601e1f0dc87a72 100644 (file)
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * eyetv.c : Access module to connect to our plugin running within EyeTV
+ * eyetv.m : Access module to connect to our plugin running within EyeTV
  *****************************************************************************
  * Copyright (C) 2006-2007 the VideoLAN team
  * $Id$
@@ -58,25 +58,18 @@ static void Close( vlc_object_t * );
     "EyeTV program number, or use 0 for last channel, " \
     "-1 for S-Video input, -2 for Composite input" )
 
-#define CACHING_TEXT N_("Caching value in ms")
-#define CACHING_LONGTEXT N_( \
-    "Caching value for EyeTV captures. This " \
-    "value should be set in milliseconds." )
-
 vlc_module_begin ()
     set_shortname( "EyeTV" )
-    set_description( N_("EyeTV access module") )
+    set_description( N_("EyeTV input") )
     set_category( CAT_INPUT )
     set_subcategory( SUBCAT_INPUT_ACCESS )
 
-    add_integer( "eyetv-channel", 0, NULL,
-                 CHANNEL_TEXT, CHANNEL_LONGTEXT, false );
+    add_integer( "eyetv-channel", 0,
+                 CHANNEL_TEXT, CHANNEL_LONGTEXT, false )
 
     set_capability( "access", 0 )
     add_shortcut( "eyetv" )
     set_callbacks( Open, Close )
-    add_integer( "eyetv-caching", DEFAULT_PTS_DELAY / 1000, NULL,
-                 CACHING_TEXT, CACHING_LONGTEXT, true);
 vlc_module_end ()
 
 /*****************************************************************************
@@ -85,7 +78,6 @@ vlc_module_end ()
 struct access_sys_t
 {
     int eyetvSock;
-    int i_pts_delay;
 };
 
 static block_t *BlockRead( access_t *);
@@ -160,23 +152,15 @@ static int Open( vlc_object_t *p_this )
     struct sockaddr_un publicAddr, peerAddr;
     int publicSock;
  
-    vlc_value_t val;
-
     /* Init p_access */
-    access_InitFields( p_access ); \
-    ACCESS_SET_CALLBACKS( NULL, BlockRead, Control, NULL ); \
-    MALLOC_ERR( p_access->p_sys, access_sys_t ); \
-    p_access->info.b_prebuffered = false;
-
-    p_sys = p_access->p_sys; memset( p_sys, 0, sizeof( access_sys_t ) );
-    p_sys->i_pts_delay = var_CreateGetInteger( p_access, "eyetv-caching" );
-
-    var_Create( p_access, "eyetv-channel", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
-    var_Get( p_access, "eyetv-channel", &val);
+    access_InitFields( p_access );
+    ACCESS_SET_CALLBACKS( NULL, BlockRead, Control, NULL );
+    p_sys = p_access->p_sys = calloc( 1, sizeof( access_sys_t ) );
+    if( !p_sys )
+        return VLC_ENOMEM;
 
     msg_Dbg( p_access, "coming up" );
-
-    selectChannel(p_this, val.i_int);
+    selectChannel( p_this, var_InheritInteger( p_access, "eyetv-channel" ) );
 
     /* socket */
     memset(&publicAddr, 0, sizeof(publicAddr));
@@ -190,7 +174,7 @@ static int Open( vlc_object_t *p_this )
         return VLC_EGENERIC;
     }
 
-    publicSock = socket(AF_UNIX, SOCK_STREAM, 0);
+    publicSock = socket(PF_UNIX, SOCK_STREAM, 0);
     if( publicSock == -1 )
     {
         msg_Err( p_access, "create local socket failed (errno=%d)", errno );
@@ -267,7 +251,8 @@ static void Close( vlc_object_t *p_this )
  
     msg_Dbg( p_access, "plugin notified" );
 
-       close(p_sys->eyetvSock);
+
+close(p_sys->eyetvSock);
  
     msg_Dbg( p_access, "msg port closed and freed" );
  
@@ -327,16 +312,12 @@ static int Control( access_t *p_access, int i_query, va_list args )
             break;
 
         /* */
-        case ACCESS_GET_MTU:
-            pi_int = (int*)va_arg( args, int * );
-            *pi_int = MTU;
-            break;
-
         case ACCESS_GET_PTS_DELAY:
             pi_64 = (int64_t*)va_arg( args, int64_t * );
-            *pi_64 = (int64_t) p_sys->i_pts_delay * 1000;
+            *pi_64 =
+                INT64_C(1000) * var_InheritInteger( p_access, "live-caching" );
             break;
-        
+
         case ACCESS_SET_PAUSE_STATE:
         case ACCESS_GET_TITLE_INFO:
         case ACCESS_SET_TITLE: