]> git.sesse.net Git - vlc/blobdiff - src/video_output/control.c
Use var_Inherit* instead of var_CreateGet*.
[vlc] / src / video_output / control.c
index 6e4e3abda9b1c9410ca288d19569d78c51d9f79a..96cb186c894dd582d32674a40449ac27fbab1fd2 100644 (file)
@@ -26,6 +26,7 @@
 #endif
 
 #include <vlc_common.h>
+#include <vlc_vout.h>
 #include "control.h"
 
 /* */
@@ -38,21 +39,15 @@ void vout_control_cmd_Init(vout_control_cmd_t *cmd, int type)
 void vout_control_cmd_Clean(vout_control_cmd_t *cmd)
 {
     switch (cmd->type) {
-    //case VOUT_CONTROL_OSD_MESSAGE:
-    case VOUT_CONTROL_OSD_TITLE:
-        free(cmd->u.message.string);
-        break;
-#if 0
-    case VOUT_CONTROL_OSD_TEXT:
-        free(cmd->text.string);
-        if (cmd->text.style)
-            text_style_Delete(cmd->text.style);
+    case VOUT_CONTROL_SUBPICTURE:
+        if (cmd->u.subpicture)
+            subpicture_Delete(cmd->u.subpicture);
         break;
-    case VOUT_CONTROL_OSD_SUBPICTURE:
-        if (cmd->subpicture)
-            subpicture_Delete(cmd->subpicture);
+    case VOUT_CONTROL_OSD_TITLE:
+    case VOUT_CONTROL_CHANGE_FILTERS:
+    case VOUT_CONTROL_CHANGE_SUB_FILTERS:
+        free(cmd->u.string);
         break;
-#endif
     default:
         break;
     }
@@ -139,6 +134,14 @@ void vout_control_PushBool(vout_control_t *ctrl, int type, bool boolean)
     cmd.u.boolean = boolean;
     vout_control_Push(ctrl, &cmd);
 }
+void vout_control_PushInteger(vout_control_t *ctrl, int type, int integer)
+{
+    vout_control_cmd_t cmd;
+
+    vout_control_cmd_Init(&cmd, type);
+    cmd.u.integer = integer;
+    vout_control_Push(ctrl, &cmd);
+}
 void vout_control_PushTime(vout_control_t *ctrl, int type, mtime_t time)
 {
     vout_control_cmd_t cmd;
@@ -165,6 +168,14 @@ void vout_control_PushPair(vout_control_t *ctrl, int type, int a, int b)
     cmd.u.pair.b = b;
     vout_control_Push(ctrl, &cmd);
 }
+void vout_control_PushString(vout_control_t *ctrl, int type, const char *string)
+{
+    vout_control_cmd_t cmd;
+
+    vout_control_cmd_Init(&cmd, type);
+    cmd.u.string = strdup(string);
+    vout_control_Push(ctrl, &cmd);
+}
 
 int vout_control_Pop(vout_control_t *ctrl, vout_control_cmd_t *cmd,
                      mtime_t deadline, mtime_t timeout)