<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[Freeswitch-trunk][15615] </title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<div id="header">FreeSWITCH Subversion</div>
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://fisheye.freeswitch.org/changelog/FreeSWITCH?cs=15615">15615</a></dd>
<dt>Author</dt> <dd>mikej</dd>
<dt>Date</dt> <dd>2009-11-23 10:02:06 -0600 (Mon, 23 Nov 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>Update to unimrcp 1297, remove API change

commit b3466f12a82fcfe9261d6af57fb8ad74d5140bc0
Author: achaloyan &lt;achaloyan@f001bc3a-424a-0410-80a0-a715b8f413a8&gt;
Date:   Sun Nov 22 19:30:30 2009 +0000

    Provided the same functionality to change scheduler rate (if needed) without modifying existing API (ensured backward compatibility)
    
    git-svn-id: https://unimrcp.googlecode.com/svn/trunk@1297 f001bc3a-424a-0410-80a0-a715b8f413a8</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchtrunklibsunimrcpupdate">freeswitch/trunk/libs/unimrcp/.update</a></li>
<li><a href="#freeswitchtrunklibsunimrcplibsmpfincludempf_engineh">freeswitch/trunk/libs/unimrcp/libs/mpf/include/mpf_engine.h</a></li>
<li><a href="#freeswitchtrunklibsunimrcplibsmpfincludempf_schedulerh">freeswitch/trunk/libs/unimrcp/libs/mpf/include/mpf_scheduler.h</a></li>
<li><a href="#freeswitchtrunklibsunimrcplibsmpfsrcmpf_enginec">freeswitch/trunk/libs/unimrcp/libs/mpf/src/mpf_engine.c</a></li>
<li><a href="#freeswitchtrunklibsunimrcplibsmpfsrcmpf_schedulerc">freeswitch/trunk/libs/unimrcp/libs/mpf/src/mpf_scheduler.c</a></li>
<li><a href="#freeswitchtrunklibsunimrcpplatformslibunimrcpclientsrcunimrcp_clientc">freeswitch/trunk/libs/unimrcp/platforms/libunimrcp-client/src/unimrcp_client.c</a></li>
<li><a href="#freeswitchtrunklibsunimrcpplatformslibunimrcpserversrcunimrcp_serverc">freeswitch/trunk/libs/unimrcp/platforms/libunimrcp-server/src/unimrcp_server.c</a></li>
<li><a href="#freeswitchtrunklibsunimrcptestsmpftestsrcmpf_suitec">freeswitch/trunk/libs/unimrcp/tests/mpftest/src/mpf_suite.c</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunklibsunimrcpupdate"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/libs/unimrcp/.update (15614 => 15615)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/unimrcp/.update        2009-11-23 15:39:03 UTC (rev 15614)
+++ freeswitch/trunk/libs/unimrcp/.update        2009-11-23 16:02:06 UTC (rev 15615)
</span><span class="lines">@@ -1 +1 @@
</span><del>-Fri Nov 20 16:02:03 CST 2009
</del><ins>+Mon Nov 23 10:00:46 CST 2009
</ins></span></pre></div>
<a id="freeswitchtrunklibsunimrcplibsmpfincludempf_engineh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/libs/unimrcp/libs/mpf/include/mpf_engine.h (15614 => 15615)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/unimrcp/libs/mpf/include/mpf_engine.h        2009-11-23 15:39:03 UTC (rev 15614)
+++ freeswitch/trunk/libs/unimrcp/libs/mpf/include/mpf_engine.h        2009-11-23 16:02:06 UTC (rev 15615)
</span><span class="lines">@@ -32,10 +32,9 @@
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="cx">  * Create MPF engine.
</span><del>- * @param rate the rate (n times faster than real-time)
</del><span class="cx">  * @param pool the pool to allocate memory from
</span><span class="cx">  */
</span><del>-MPF_DECLARE(mpf_engine_t*) mpf_engine_create(unsigned long rate, apr_pool_t *pool);
</del><ins>+MPF_DECLARE(mpf_engine_t*) mpf_engine_create(apr_pool_t *pool);
</ins><span class="cx"> 
</span><span class="cx"> /**
</span><span class="cx">  * Create MPF codec manager.
</span><span class="lines">@@ -142,7 +141,14 @@
</span><span class="cx">  */
</span><span class="cx"> MPF_DECLARE(apt_bool_t) mpf_engine_message_send(mpf_engine_t *engine, mpf_task_msg_t **task_msg);
</span><span class="cx"> 
</span><ins>+/**
+ * Set scheduler rate.
+ * @param engine the engine to set rate for
+ * @param rate the rate (n times faster than real-time)
+ */
+MPF_DECLARE(apt_bool_t) mpf_engine_scheduler_rate_set(mpf_engine_t *engine, unsigned long rate);
</ins><span class="cx"> 
</span><ins>+
</ins><span class="cx"> APT_END_EXTERN_C
</span><span class="cx"> 
</span><span class="cx"> #endif /*__MPF_ENGINE_H__*/
</span></span></pre></div>
<a id="freeswitchtrunklibsunimrcplibsmpfincludempf_schedulerh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/libs/unimrcp/libs/mpf/include/mpf_scheduler.h (15614 => 15615)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/unimrcp/libs/mpf/include/mpf_scheduler.h        2009-11-23 15:39:03 UTC (rev 15614)
+++ freeswitch/trunk/libs/unimrcp/libs/mpf/include/mpf_scheduler.h        2009-11-23 16:02:06 UTC (rev 15615)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx"> typedef void (*mpf_scheduler_proc_f)(mpf_scheduler_t *scheduler, void *obj);
</span><span class="cx"> 
</span><span class="cx"> /** Create scheduler */
</span><del>-MPF_DECLARE(mpf_scheduler_t*) mpf_scheduler_create(unsigned long rate, apr_pool_t *pool);
</del><ins>+MPF_DECLARE(mpf_scheduler_t*) mpf_scheduler_create(apr_pool_t *pool);
</ins><span class="cx"> 
</span><span class="cx"> /** Destroy scheduler */
</span><span class="cx"> MPF_DECLARE(void) mpf_scheduler_destroy(mpf_scheduler_t *scheduler);
</span><span class="lines">@@ -49,6 +49,11 @@
</span><span class="cx">                                                                 mpf_scheduler_proc_f proc,
</span><span class="cx">                                                                 void *obj);
</span><span class="cx"> 
</span><ins>+/** Set scheduler rate (n times faster than real-time) */
+MPF_DECLARE(apt_bool_t) mpf_scheduler_rate_set(
+                                                                mpf_scheduler_t *scheduler,
+                                                                unsigned long rate);
+
</ins><span class="cx"> /** Start scheduler */
</span><span class="cx"> MPF_DECLARE(apt_bool_t) mpf_scheduler_start(mpf_scheduler_t *scheduler);
</span><span class="cx"> 
</span></span></pre></div>
<a id="freeswitchtrunklibsunimrcplibsmpfsrcmpf_enginec"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/libs/unimrcp/libs/mpf/src/mpf_engine.c (15614 => 15615)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/unimrcp/libs/mpf/src/mpf_engine.c        2009-11-23 15:39:03 UTC (rev 15614)
+++ freeswitch/trunk/libs/unimrcp/libs/mpf/src/mpf_engine.c        2009-11-23 16:02:06 UTC (rev 15615)
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx"> mpf_codec_t* mpf_codec_g711u_create(apr_pool_t *pool);
</span><span class="cx"> mpf_codec_t* mpf_codec_g711a_create(apr_pool_t *pool);
</span><span class="cx"> 
</span><del>-MPF_DECLARE(mpf_engine_t*) mpf_engine_create(unsigned long rate, apr_pool_t *pool)
</del><ins>+MPF_DECLARE(mpf_engine_t*) mpf_engine_create(apr_pool_t *pool)
</ins><span class="cx"> {
</span><span class="cx">         apt_task_vtable_t *vtable;
</span><span class="cx">         apt_task_msg_pool_t *msg_pool;
</span><span class="lines">@@ -87,7 +87,7 @@
</span><span class="cx">         engine-&gt;request_queue = apt_cyclic_queue_create(CYCLIC_QUEUE_DEFAULT_SIZE);
</span><span class="cx">         apr_thread_mutex_create(&amp;engine-&gt;request_queue_guard,APR_THREAD_MUTEX_UNNESTED,engine-&gt;pool);
</span><span class="cx"> 
</span><del>-        engine-&gt;scheduler = mpf_scheduler_create(rate,engine-&gt;pool);
</del><ins>+        engine-&gt;scheduler = mpf_scheduler_create(engine-&gt;pool);
</ins><span class="cx">         mpf_scheduler_media_clock_set(engine-&gt;scheduler,CODEC_FRAME_TIME_BASE,mpf_engine_main,engine);
</span><span class="cx"> 
</span><span class="cx">         engine-&gt;timer_manager = mpf_timer_manager_create(engine-&gt;scheduler,engine-&gt;pool);
</span><span class="lines">@@ -426,3 +426,8 @@
</span><span class="cx">         engine-&gt;codec_manager = codec_manager;
</span><span class="cx">         return TRUE;
</span><span class="cx"> }
</span><ins>+
+MPF_DECLARE(apt_bool_t) mpf_engine_scheduler_rate_set(mpf_engine_t *engine, unsigned long rate)
+{
+        return mpf_scheduler_rate_set(engine-&gt;scheduler,rate);
+}
</ins></span></pre></div>
<a id="freeswitchtrunklibsunimrcplibsmpfsrcmpf_schedulerc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/libs/unimrcp/libs/mpf/src/mpf_scheduler.c (15614 => 15615)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/unimrcp/libs/mpf/src/mpf_scheduler.c        2009-11-23 15:39:03 UTC (rev 15614)
+++ freeswitch/trunk/libs/unimrcp/libs/mpf/src/mpf_scheduler.c        2009-11-23 16:02:06 UTC (rev 15615)
</span><span class="lines">@@ -38,7 +38,6 @@
</span><span class="cx"> struct mpf_scheduler_t {
</span><span class="cx">         apr_pool_t          *pool;
</span><span class="cx">         unsigned long        resolution; /* scheduler resolution */
</span><del>-        unsigned long        rate; /* faster than real-time simulation */
</del><span class="cx"> 
</span><span class="cx">         unsigned long        media_resolution;
</span><span class="cx">         mpf_scheduler_proc_f media_proc;
</span><span class="lines">@@ -60,19 +59,12 @@
</span><span class="cx"> static APR_INLINE void mpf_scheduler_init(mpf_scheduler_t *scheduler);
</span><span class="cx"> 
</span><span class="cx"> /** Create scheduler */
</span><del>-MPF_DECLARE(mpf_scheduler_t*) mpf_scheduler_create(unsigned long rate, apr_pool_t *pool)
</del><ins>+MPF_DECLARE(mpf_scheduler_t*) mpf_scheduler_create(apr_pool_t *pool)
</ins><span class="cx"> {
</span><span class="cx">         mpf_scheduler_t *scheduler = apr_palloc(pool,sizeof(mpf_scheduler_t));
</span><span class="cx">         mpf_scheduler_init(scheduler);
</span><span class="cx">         scheduler-&gt;pool = pool;
</span><span class="cx">         scheduler-&gt;resolution = 0;
</span><del>-        if(rate == 0 || rate &gt; 10) {
-                /* rate shows how many times scheduler should be faster than real-time,
-                1 is the defualt and probably the only reasonable value, 
-                however, the rates up to 10 times faster should be acceptable */
-                rate = 1;
-        }
-        scheduler-&gt;rate = rate;
</del><span class="cx"> 
</span><span class="cx">         scheduler-&gt;media_resolution = 0;
</span><span class="cx">         scheduler-&gt;media_obj = NULL;
</span><span class="lines">@@ -98,7 +90,7 @@
</span><span class="cx">                                                                 mpf_scheduler_proc_f proc,
</span><span class="cx">                                                                 void *obj)
</span><span class="cx"> {
</span><del>-        scheduler-&gt;media_resolution = resolution / scheduler-&gt;rate;
</del><ins>+        scheduler-&gt;media_resolution = resolution;
</ins><span class="cx">         scheduler-&gt;media_proc = proc;
</span><span class="cx">         scheduler-&gt;media_obj = obj;
</span><span class="cx">         return TRUE;
</span><span class="lines">@@ -111,13 +103,30 @@
</span><span class="cx">                                                                 mpf_scheduler_proc_f proc,
</span><span class="cx">                                                                 void *obj)
</span><span class="cx"> {
</span><del>-        scheduler-&gt;timer_resolution = resolution / scheduler-&gt;rate;
</del><ins>+        scheduler-&gt;timer_resolution = resolution;
</ins><span class="cx">         scheduler-&gt;timer_elapsed_time = 0;
</span><span class="cx">         scheduler-&gt;timer_proc = proc;
</span><span class="cx">         scheduler-&gt;timer_obj = obj;
</span><span class="cx">         return TRUE;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+/** Set scheduler rate (n times faster than real-time) */
+MPF_DECLARE(apt_bool_t) mpf_scheduler_rate_set(
+                                                                mpf_scheduler_t *scheduler,
+                                                                unsigned long rate)
+{
+        if(rate == 0 || rate &gt; 10) {
+                /* rate shows how many times scheduler should be faster than real-time,
+                1 is the defualt and probably the only reasonable value, 
+                however, the rates up to 10 times faster should be acceptable */
+                rate = 1;
+        }
+        
+        scheduler-&gt;media_resolution /= rate;
+        scheduler-&gt;timer_resolution /= rate;
+        return TRUE;
+}
+
</ins><span class="cx"> static APR_INLINE void mpf_scheduler_resolution_set(mpf_scheduler_t *scheduler)
</span><span class="cx"> {
</span><span class="cx">         if(scheduler-&gt;media_resolution) {
</span></span></pre></div>
<a id="freeswitchtrunklibsunimrcpplatformslibunimrcpclientsrcunimrcp_clientc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/libs/unimrcp/platforms/libunimrcp-client/src/unimrcp_client.c (15614 => 15615)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/unimrcp/platforms/libunimrcp-client/src/unimrcp_client.c        2009-11-23 15:39:03 UTC (rev 15614)
+++ freeswitch/trunk/libs/unimrcp/platforms/libunimrcp-client/src/unimrcp_client.c        2009-11-23 16:02:06 UTC (rev 15615)
</span><span class="lines">@@ -462,8 +462,9 @@
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">                         apt_log(APT_LOG_MARK,APT_PRIO_DEBUG,&quot;Loading Media Engine&quot;);
</span><del>-                        media_engine = mpf_engine_create(rate,pool);
</del><ins>+                        media_engine = mpf_engine_create(pool);
</ins><span class="cx">                         if(media_engine) {
</span><ins>+                                mpf_engine_scheduler_rate_set(media_engine,rate);
</ins><span class="cx">                                 mrcp_client_media_engine_register(client,media_engine,name);
</span><span class="cx">                         }
</span><span class="cx">                 }
</span></span></pre></div>
<a id="freeswitchtrunklibsunimrcpplatformslibunimrcpserversrcunimrcp_serverc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/libs/unimrcp/platforms/libunimrcp-server/src/unimrcp_server.c (15614 => 15615)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/unimrcp/platforms/libunimrcp-server/src/unimrcp_server.c        2009-11-23 15:39:03 UTC (rev 15614)
+++ freeswitch/trunk/libs/unimrcp/platforms/libunimrcp-server/src/unimrcp_server.c        2009-11-23 16:02:06 UTC (rev 15615)
</span><span class="lines">@@ -495,8 +495,9 @@
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">                         apt_log(APT_LOG_MARK,APT_PRIO_DEBUG,&quot;Loading Media Engine&quot;);
</span><del>-                        media_engine = mpf_engine_create(rate,pool);
</del><ins>+                        media_engine = mpf_engine_create(pool);
</ins><span class="cx">                         if(media_engine) {
</span><ins>+                                mpf_engine_scheduler_rate_set(media_engine,rate);
</ins><span class="cx">                                 mrcp_server_media_engine_register(server,media_engine,name);
</span><span class="cx">                         }
</span><span class="cx">                 }
</span></span></pre></div>
<a id="freeswitchtrunklibsunimrcptestsmpftestsrcmpf_suitec"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/libs/unimrcp/tests/mpftest/src/mpf_suite.c (15614 => 15615)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/unimrcp/tests/mpftest/src/mpf_suite.c        2009-11-23 15:39:03 UTC (rev 15614)
+++ freeswitch/trunk/libs/unimrcp/tests/mpftest/src/mpf_suite.c        2009-11-23 16:02:06 UTC (rev 15615)
</span><span class="lines">@@ -95,7 +95,7 @@
</span><span class="cx"> 
</span><span class="cx">         suite_engine = apr_palloc(suite-&gt;pool,sizeof(mpf_suite_engine_t));
</span><span class="cx"> 
</span><del>-        engine = mpf_engine_create(1,suite-&gt;pool);
</del><ins>+        engine = mpf_engine_create(suite-&gt;pool);
</ins><span class="cx">         if(!engine) {
</span><span class="cx">                 apt_log(APT_LOG_MARK,APT_PRIO_WARNING,&quot;Failed to Create MPF Engine&quot;);
</span><span class="cx">                 return FALSE;
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>

</body>
</html>