[PATCH] add frame-by-frame function to modules/control/rc.c

chenee chenee at hhcn.com
Fri Jul 31 02:38:15 CEST 2009


---
 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_int=
f
);
             }
         }
         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 =3D 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 =3D var_GetInteger( p_input, "state" );
     if( ( state =3D=3D PAUSE_S ) &&
-        ( strcmp( psz_cmd, "pause" ) !=3D 0 ) )
+        ( strcmp( psz_cmd, "pause" ) !=3D 0 ) && (strcmp( psz_cmd,"frame")=
 !=3D
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 =3D VLC_SUCCESS;
     }
+    else if ( !strcmp( psz_cmd, "frame" ) )
+    {
+    var_TriggerCallback( p_input, "frame-next" );
+        i_error =3D VLC_SUCCESS;
+    }
     else if( !strcmp( psz_cmd, "chapter" ) ||
              !strcmp( psz_cmd, "chapter_n" ) ||
              !strcmp( psz_cmd, "chapter_p" ) )
--=20
1.6.0.4











--=20
--------------
=BB=AA=BA=E3=BF=C6=BC=BC =B3=C2=D2=CB=D2=E5 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

--0016361e868e6a424a046ff5d44a
Content-Type: text/html; charset=GB2312
Content-Transfer-Encoding: quoted-printable

<br>
&gt; Hello,<br>
&gt; could you resubmit it using git-format-patch ?<br>
&gt; <br>
&gt; <br>
&gt; Best regards.<br>
&gt; <br>
&gt; --<br>
&gt; R?mi Duraffort | ivoire<br clear=3D"all"><br>Hi; <br>&nbsp;&nbsp;&nbsp=
; i&#39;d like to do that ,below;<br>&nbsp;&nbsp;&nbsp; (this patch add fra=
me-by-frame function to rc interface. almost cp from Qt4. wish it could hel=
p.)<br>-------------------------<br>
<br><br>From 47a68f18400cf58cb27360855922a1b488f11eef Mon Sep 17 00:00:00 2=
001<br>From: chenee &lt;<a href=3D"mailto:chenee at hhcn.com">chenee at hhcn.com<=
/a>&gt;<br>Date: Fri, 31 Jul 2009 08:38:15 +0800<br>Subject: [PATCH] add fr=
ame-by-frame function to modules/control/rc.c<br>
<br>---<br>&nbsp;modules/control/rc.c |&nbsp;&nbsp; 12 +++++++++++-<br>&nbs=
p;1 files changed, 11 insertions(+), 1 deletions(-)<br><br>diff --git a/mod=
ules/control/rc.c b/modules/control/rc.c<br>index e1edcaf..430dc8b 100644<b=
r>--- a/modules/control/rc.c<br>
+++ b/modules/control/rc.c<br>@@ -412,6 +412,7 @@ static void RegisterCallb=
acks( intf_thread_t *p_intf )<br>&nbsp;&nbsp;&nbsp;&nbsp; ADD( &quot;faster=
&quot;, VOID, Input )<br>&nbsp;&nbsp;&nbsp;&nbsp; ADD( &quot;slower&quot;, =
VOID, Input )<br>&nbsp;&nbsp;&nbsp;&nbsp; ADD( &quot;normal&quot;, VOID, In=
put )<br>
+&nbsp;&nbsp;&nbsp; ADD( &quot;frame&quot;, VOID, Input )<br>&nbsp;<br>&nbs=
p;&nbsp;&nbsp;&nbsp; ADD( &quot;atrack&quot;, STRING, Input )<br>&nbsp;&nbs=
p;&nbsp;&nbsp; ADD( &quot;vtrack&quot;, STRING, Input )<br>@@ -514,6 +515,7=
 @@ static void Run( intf_thread_t *p_intf )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var_A=
ddCallback( p_input, &quot;rate&quot;, RateChanged, p_intf );<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp; var_AddCallback( p_input, &quot;time-offset&quot;, Ti=
meOffsetChanged,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p_intf=
 );<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp; var_AddCallback( p_input, &quot;frame-next&quot;, R=
ateChanged, p_intf );<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<=
br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else if( p_input-&gt;b_dead )<br>@@ -524,6 +=
526,7 @@ static void Run( intf_thread_t *p_intf )<br>&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var_DelCallback( p_input=
, &quot;rate&quot;, RateChanged, p_intf );<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; va=
r_DelCallback( p_input, &quot;time-offset&quot;, TimeOffsetChanged,<br>&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp; p_intf );<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp; var_DelCallback( p_input, &quot;frame-next&quot;=
, RateChanged, p_intf );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp; vlc_object_release( p_input );<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p_=
input =3D NULL;<br>&nbsp;<br>@@ -818,6 +821,7 @@ static void Run( intf_thre=
ad_t *p_intf )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var_DelC=
allback( p_input, &quot;rate-slower&quot;, RateChanged, p_intf );<br>&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var_DelCallback( p_input, &quot;=
rate&quot;, RateChanged, p_intf );<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var_DelCallback( p_input, =
&quot;time-offset&quot;, TimeOffsetChanged, p_intf );<br>+&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp; var_DelCallback( p_input, &quot;frame-next&quot;,=
 RateChanged, p_intf );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
 vlc_object_release( p_input );<br>&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;<br>@@ -858,6 +862,7 @@ static void Help( intf_thread_t *p_intf, bool=
 b_longhelp)<br>&nbsp;&nbsp;&nbsp;&nbsp; msg_rc(&quot;%s&quot;, _(&quot;| f=
aster . . . . . . . . . .&nbsp; faster playing of stream&quot;));<br>&nbsp;=
&nbsp;&nbsp;&nbsp; msg_rc(&quot;%s&quot;, _(&quot;| slower . . . . . . . . =
. .&nbsp; slower playing of stream&quot;));<br>
&nbsp;&nbsp;&nbsp;&nbsp; msg_rc(&quot;%s&quot;, _(&quot;| normal . . . . . =
. . . . .&nbsp; normal playing of stream&quot;));<br>+&nbsp;&nbsp;&nbsp; ms=
g_rc(&quot;%s&quot;, _(&quot;| frame. . . . . . . . . .&nbsp; play frame by=
 frame&quot;));<br>&nbsp;&nbsp;&nbsp;&nbsp; msg_rc(&quot;%s&quot;, _(&quot;=
| f [on|off] . . . . . . . . . . . . toggle fullscreen&quot;));<br>
&nbsp;&nbsp;&nbsp;&nbsp; msg_rc(&quot;%s&quot;, _(&quot;| info . . . . .&nb=
sp; information about the current stream&quot;));<br>&nbsp;&nbsp;&nbsp;&nbs=
p; msg_rc(&quot;%s&quot;, _(&quot;| stats&nbsp; . . . . . . . .&nbsp; show =
statistical information&quot;));<br>@@ -1030,7 +1035,7 @@ static int Input(=
 vlc_object_t *p_this, char const *psz_cmd,<br>
&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp; int state =3D var_GetInteger( p_input, &=
quot;state&quot; );<br>&nbsp;&nbsp;&nbsp;&nbsp; if( ( state =3D=3D PAUSE_S =
) &amp;&amp;<br>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ( strcmp( psz_c=
md, &quot;pause&quot; ) !=3D 0 ) )<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp; ( strcmp( psz_cmd, &quot;pause&quot; ) !=3D 0 ) &amp;&amp; (strcmp( =
psz_cmd,&quot;frame&quot;) !=3D 0 ) )<br>
&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp; msg_rc( &quot;%s&quot;, _(&quot;Press menu select or pause to continue.=
&quot;) );<br>&nbsp;&nbsp;&nbsp;&nbsp; }<br>@@ -1099,6 +1104,11 @@ static i=
nt Input( vlc_object_t *p_this, char const *psz_cmd,<br>&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var_SetInteger( p_input, &quot;rate&quot;, IN=
PUT_RATE_DEFAULT );<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; i_error =3D VLC_SUCCESS;<b=
r>&nbsp;&nbsp;&nbsp;&nbsp; }<br>+&nbsp;&nbsp;&nbsp; else if ( !strcmp( psz_=
cmd, &quot;frame&quot; ) )<br>+&nbsp;&nbsp;&nbsp; {<br>+&nbsp;&nbsp;&nbsp; =
var_TriggerCallback( p_input, &quot;frame-next&quot; );<br>+&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp; i_error =3D VLC_SUCCESS;<br>+&nbsp;&nbsp;&nbsp;=
 }<br>
&nbsp;&nbsp;&nbsp;&nbsp; else if( !strcmp( psz_cmd, &quot;chapter&quot; ) |=
|<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp; !strcmp( psz_cmd, &quot;chapter_n&quot; ) ||<br>&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; !strcmp( psz_c=
md, &quot;chapter_p&quot; ) )<br>-- <br>1.6.0.4<br><br><br><br><br><br>
<br><br><br><br><br><br>-- <br>--------------<br>=BB=AA=BA=E3=BF=C6=BC=BC =
=B3=C2=D2=CB=D2=E5 <a href=3D"mailto:chenee at hhcn.com">chenee at hhcn.com</a><b=
r>Tel/Fax: +86-551-5325652,5325653-820<br>Products Info. : <a href=3D"http:=
//www.hhcn.com">http://www.hhcn.com</a><br>
Tech. Support &nbsp;: <a href=3D"http://www.hhcn.org">http://www.hhcn.org</=
a><br>HHTech : An Embedded Linux Tech. Provider in Mainland China<br>2008-0=
8-13<br>

--0016361e868e6a424a046ff5d44a--


More information about the vlc-devel mailing list