[vlc-commits] rc: add "record" command

Thomas Guillem git at videolan.org
Fri Jul 12 13:16:30 CEST 2019


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Jul 11 12:44:33 2019 +0200| [11e66453134f04b2049ce6406ba857e07827a415] | committer: Thomas Guillem

rc: add "record" command

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=11e66453134f04b2049ce6406ba857e07827a415
---

 modules/control/rc.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/modules/control/rc.c b/modules/control/rc.c
index d150de891d..5de30ea119 100644
--- a/modules/control/rc.c
+++ b/modules/control/rc.c
@@ -278,6 +278,7 @@ static void Help( intf_thread_t *p_intf)
     msg_rc("%s", _("| vcrop [X]  . . . . . . . . . . .  set/get video crop"));
     msg_rc("%s", _("| vzoom [X]  . . . . . . . . . . .  set/get video zoom"));
     msg_rc("%s", _("| snapshot . . . . . . . . . . . . take video snapshot"));
+    msg_rc("%s", _("| record [on|off] . . . . . . . . . . toggle recording"));
     msg_rc("%s", _("| strack [X] . . . . . . . . .  set/get subtitle track"));
     msg_rc("%s", _("| key [hotkey name] . . . . . .  simulate hotkey press"));
     msg_rc(  "| ");
@@ -568,6 +569,25 @@ static void Input(intf_thread_t *intf, char const *psz_cmd,
             msg_print(intf, "+----[ end of %s ]", name);
         }
     }
+    else if( !strcmp( psz_cmd, "record" ) )
+    {
+        bool b_update = true;
+        bool b_value = vlc_player_IsRecording(player);
+
+        if( newval.psz_string[0] != '\0' )
+        {
+            if ( ( !strncmp( newval.psz_string, "on", 2 )  &&  b_value ) ||
+                 ( !strncmp( newval.psz_string, "off", 3 ) && !b_value ) )
+            {
+                b_update = false;
+            }
+        }
+        if( b_update )
+        {
+            b_value = !b_value;
+            vlc_player_SetRecordingEnabled( player, b_value );
+        }
+    }
 out:
     vlc_player_Unlock(player);
 }
@@ -1302,6 +1322,7 @@ static const struct
     { "atrack", Input },
     { "vtrack", Input },
     { "strack", Input },
+    { "record", Input },
 
     /* video commands */
     { "vratio", VideoConfig },



More information about the vlc-commits mailing list