[vlc-devel] patch: add "frame-by-frame" function to modules/control/rc.c

Andy chenee chenee543216 at gmail.com
Fri Jul 31 02:52:08 CEST 2009


> Hello,
> could you resubmit it using git-format-patch ?
>
>
> Best regards.
>
> --
> R?mi Duraffort | ivoire

Hi;
    i'd like to do that ,below;
    (this patch add frame-by-frame function to rc interface. almost cp from
Qt4. wish it could help.)
-------------------------


>From 47a68f18400cf58cb27360855922a1b488f11eef Mon Sep 17 00:00:00 2001
From: chenee <chenee at hhcn.com>
Date: Fri, 31 Jul 2009 08:38:15 +0800
Subject: [PATCH] add frame-by-frame function to modules/control/rc.c

---
 modules/control/rc.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/modules/control/rc.c b/modules/control/rc.c
index e1edcaf..430dc8b 100644
--- a/modules/control/rc.c
+++ b/modules/control/rc.c
@@ -412,6 +412,7 @@ static void RegisterCallbacks( intf_thread_t *p_intf )
     ADD( "faster", VOID, Input )
     ADD( "slower", VOID, Input )
     ADD( "normal", VOID, Input )
+    ADD( "frame", VOID, Input )

     ADD( "atrack", STRING, Input )
     ADD( "vtrack", STRING, Input )
@@ -514,6 +515,7 @@ static void Run( intf_thread_t *p_intf )
                 var_AddCallback( p_input, "rate", RateChanged, p_intf );
                 var_AddCallback( p_input, "time-offset", TimeOffsetChanged,
                                  p_intf );
+                var_AddCallback( p_input, "frame-next", RateChanged, p_intf
);
             }
         }
         else if( p_input->b_dead )
@@ -524,6 +526,7 @@ static void Run( intf_thread_t *p_intf )
             var_DelCallback( p_input, "rate", RateChanged, p_intf );
             var_DelCallback( p_input, "time-offset", TimeOffsetChanged,
                              p_intf );
+            var_DelCallback( p_input, "frame-next", RateChanged, p_intf );
             vlc_object_release( p_input );
             p_input = NULL;

@@ -818,6 +821,7 @@ static void Run( intf_thread_t *p_intf )
         var_DelCallback( p_input, "rate-slower", RateChanged, p_intf );
         var_DelCallback( p_input, "rate", RateChanged, p_intf );
         var_DelCallback( p_input, "time-offset", TimeOffsetChanged, p_intf
);
+        var_DelCallback( p_input, "frame-next", RateChanged, p_intf );
         vlc_object_release( p_input );
     }

@@ -858,6 +862,7 @@ static void Help( intf_thread_t *p_intf, bool
b_longhelp)
     msg_rc("%s", _("| faster . . . . . . . . . .  faster playing of
stream"));
     msg_rc("%s", _("| slower . . . . . . . . . .  slower playing of
stream"));
     msg_rc("%s", _("| normal . . . . . . . . . .  normal playing of
stream"));
+    msg_rc("%s", _("| frame. . . . . . . . . .  play frame by frame"));
     msg_rc("%s", _("| f [on|off] . . . . . . . . . . . . toggle
fullscreen"));
     msg_rc("%s", _("| info . . . . .  information about the current
stream"));
     msg_rc("%s", _("| stats  . . . . . . . .  show statistical
information"));
@@ -1030,7 +1035,7 @@ static int Input( vlc_object_t *p_this, char const
*psz_cmd,

     int state = var_GetInteger( p_input, "state" );
     if( ( state == PAUSE_S ) &&
-        ( strcmp( psz_cmd, "pause" ) != 0 ) )
+        ( strcmp( psz_cmd, "pause" ) != 0 ) && (strcmp( psz_cmd,"frame") !=
0 ) )
     {
         msg_rc( "%s", _("Press menu select or pause to continue.") );
     }
@@ -1099,6 +1104,11 @@ static int Input( vlc_object_t *p_this, char const
*psz_cmd,
         var_SetInteger( p_input, "rate", INPUT_RATE_DEFAULT );
         i_error = VLC_SUCCESS;
     }
+    else if ( !strcmp( psz_cmd, "frame" ) )
+    {
+    var_TriggerCallback( p_input, "frame-next" );
+        i_error = VLC_SUCCESS;
+    }
     else if( !strcmp( psz_cmd, "chapter" ) ||
              !strcmp( psz_cmd, "chapter_n" ) ||
              !strcmp( psz_cmd, "chapter_p" ) )
-- 
1.6.0.4











-- 
--------------
华恒科技 陈宜义 chenee at hhcn.com
Tel/Fax: +86-551-5325652,5325653-820
Products Info. : http://www.hhcn.com
Tech. Support  : http://www.hhcn.org
HHTech : An Embedded Linux Tech. Provider in Mainland China
2008-08-13
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20090731/7f818ea2/attachment.html>


More information about the vlc-devel mailing list