]> git.sesse.net Git - vlc/blobdiff - modules/access_filter/dump.c
XCB: fill in RGB mask information
[vlc] / modules / access_filter / dump.c
index 24e656d9b5b968e552505e6518f331a4b450e1c6..37bb33d70b823eff02874c1cdccf57710a2383ae 100644 (file)
@@ -25,7 +25,8 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
+#include <vlc_plugin.h>
 
 #include <assert.h>
 #include <time.h>
 static int  Open (vlc_object_t *);
 static void Close (vlc_object_t *);
 
-vlc_module_begin ();
-    set_shortname (_("Dump"));
-    set_description (_("Dump"));
-    set_category (CAT_INPUT);
-    set_subcategory (SUBCAT_INPUT_ACCESS_FILTER);
-    set_capability ("access_filter", 0);
-    add_shortcut ("dump");
-    set_callbacks (Open, Close);
-
-    add_bool ("dump-force", VLC_FALSE, NULL, FORCE_TEXT,
-              FORCE_LONGTEXT, VLC_FALSE);
+vlc_module_begin ()
+    set_shortname (N_("Dump"))
+    set_description (N_("Dump"))
+    set_category (CAT_INPUT)
+    set_subcategory (SUBCAT_INPUT_ACCESS_FILTER)
+    set_capability ("access_filter", 0)
+    add_shortcut ("dump")
+    set_callbacks (Open, Close)
+
+    add_bool ("dump-force", false, NULL, FORCE_TEXT,
+              FORCE_LONGTEXT, false);
     add_integer ("dump-margin", DEFAULT_MARGIN, NULL, MARGIN_TEXT,
-                 MARGIN_LONGTEXT, VLC_FALSE);
-vlc_module_end();
+                 MARGIN_LONGTEXT, false);
+vlc_module_end ()
 
 static ssize_t Read (access_t *access, uint8_t *buffer, size_t len);
 static block_t *Block (access_t *access);
@@ -90,8 +91,8 @@ static int Open (vlc_object_t *obj)
 
     if (!var_CreateGetBool (access, "dump-force"))
     {
-        vlc_bool_t b;
-        if ((access2_Control (src, ACCESS_CAN_FASTSEEK, &b) == 0) && b)
+        bool b;
+        if ((access_Control (src, ACCESS_CAN_FASTSEEK, &b) == 0) && b)
         {
             msg_Dbg (obj, "dump filter useless");
             return VLC_EGENERIC;
@@ -108,12 +109,16 @@ static int Open (vlc_object_t *obj)
     access->pf_control = Control;
     access->info = src->info;
 
-    access_sys_t *p_sys = access->p_sys = malloc (sizeof (*p_sys));
-    if (p_sys == NULL)
+    access_sys_t *p_sys = access->p_sys = calloc( 1, sizeof (*p_sys) );
+    if( !p_sys )
         return VLC_ENOMEM;
-    memset (p_sys, 0, sizeof (*p_sys));
 
+# ifndef UNDER_CE
     if ((p_sys->stream = tmpfile ()) == NULL)
+# else
+    char buf[75];
+    if(GetTempFileName("\\Temp\\","vlc",0,buf) || ((p_sys->stream = fopen(buf,"wb+")) ==NULL))
+#endif
     {
         msg_Err (access, "cannot create temporary file: %m");
         free (p_sys);
@@ -266,7 +271,7 @@ static void Trigger (access_t *access)
         // and there is an off-by-one in the following sprintf().
         return;
 
-    const char *home = access->p_libvlc->psz_homedir;
+    const char *home = config_GetHomeDir();
 
     /* Hmm what about the extension?? */
     char filename[strlen (home) + sizeof ("/vlcdump-YYYYYYYYY-MM-DD-HH-MM-SS.ts")];
@@ -324,6 +329,7 @@ static int KeyHandler (vlc_object_t *obj, char const *varname,
 {
     access_t *access = data;
 
+    (void)varname;
     (void)oldval;
     (void)obj;