[svn-commits] branch file/coremedia - r7312 in /team/file/coremedia: ./ codecs/ include/ast...

svn-commits at lists.digium.com svn-commits at lists.digium.com
Sat Dec 3 14:10:30 CST 2005


Author: file
Date: Sat Dec  3 14:10:28 2005
New Revision: 7312

URL: http://svn.digium.com/view/asterisk?rev=7312&view=rev
Log:
Change terminology and remove translation.h dependencies some more

Modified:
    team/file/coremedia/codecs/codec_gsm.c
    team/file/coremedia/codecs/codec_ulaw.c
    team/file/coremedia/coremedia.c
    team/file/coremedia/include/asterisk/coremedia.h

Modified: team/file/coremedia/codecs/codec_gsm.c
URL: http://svn.digium.com/view/asterisk/team/file/coremedia/codecs/codec_gsm.c?rev=7312&r1=7311&r2=7312&view=diff
==============================================================================
--- team/file/coremedia/codecs/codec_gsm.c (original)
+++ team/file/coremedia/codecs/codec_gsm.c Sat Dec  3 14:10:28 2005
@@ -43,7 +43,6 @@
 #include "asterisk/module.h"
 #include "asterisk/logger.h"
 #include "asterisk/channel.h"
-#include "asterisk/translate.h"
 #include "asterisk/coremedia.h"
 
 #include "gsm/inc/gsm.h"

Modified: team/file/coremedia/codecs/codec_ulaw.c
URL: http://svn.digium.com/view/asterisk/team/file/coremedia/codecs/codec_ulaw.c?rev=7312&r1=7311&r2=7312&view=diff
==============================================================================
--- team/file/coremedia/codecs/codec_ulaw.c (original)
+++ team/file/coremedia/codecs/codec_ulaw.c Sat Dec  3 14:10:28 2005
@@ -39,7 +39,7 @@
 #include "asterisk/module.h"
 #include "asterisk/config.h"
 #include "asterisk/options.h"
-#include "asterisk/translate.h"
+#include "asterisk/coremedia.h"
 #include "asterisk/channel.h"
 #include "asterisk/ulaw.h"
 

Modified: team/file/coremedia/coremedia.c
URL: http://svn.digium.com/view/asterisk/team/file/coremedia/coremedia.c?rev=7312&r1=7311&r2=7312&view=diff
==============================================================================
--- team/file/coremedia/coremedia.c (original)
+++ team/file/coremedia/coremedia.c Sat Dec  3 14:10:28 2005
@@ -273,7 +273,7 @@
   struct ast_coremedia_entry *entry = NULL;
 
   /* Make sure we have a coremedia entry for whichever thing this RTP mapping is for */
-  entry = ast_coremedia_get(rtp->entry_name, rtp->bitrate, rtp->frequency);
+  entry = ast_coremedia_get(rtp->entry_name, rtp->bitrate, rtp->samples);
   if (entry == NULL) {
     /* No coremedia entry... either loading order is wrong or this is for a non-existant entry */
     return -1;
@@ -297,7 +297,7 @@
   ast_mutex_unlock(&rtplock);
 
   if (option_verbose > 1)
-    ast_verbose(VERBOSE_PREFIX_2 "Registered RTP mapping %d %s/%d to coremedia handler %s\n", rtp->payload, rtp->name, rtp->frequency, rtp->entry->name);
+    ast_verbose(VERBOSE_PREFIX_2 "Registered RTP mapping %d %s/%d to coremedia handler %s\n", rtp->payload, rtp->name, rtp->samples, rtp->entry->name);
 
   return 0;
 }
@@ -312,7 +312,7 @@
     success = 0;
     rtp_root[rtp->payload] = NULL;
     if (option_verbose > 1)
-      ast_verbose(VERBOSE_PREFIX_2 "Unregistered RTP mapping %d %s/%d from coremedia handler %s\n", rtp->payload, rtp->name, rtp->frequency, rtp->entry->name);
+      ast_verbose(VERBOSE_PREFIX_2 "Unregistered RTP mapping %d %s/%d from coremedia handler %s\n", rtp->payload, rtp->name, rtp->samples, rtp->entry->name);
   }
   ast_mutex_unlock(&rtplock);
 
@@ -349,15 +349,15 @@
   return entry;
 }
 
-/* Find a coremedia handler by name, bitrate, and frequency */
-struct ast_coremedia_entry *ast_coremedia_get(char *name, int bitrate, int frequency)
+/* Find a coremedia handler by name, bitrate, and samples */
+struct ast_coremedia_entry *ast_coremedia_get(char *name, int bitrate, int samples)
 {
   struct ast_coremedia_entry *entry = NULL;
 
   ast_mutex_lock(&medialock);
   entry = ach_root;
   while (entry) {
-    if (entry->name && !strcasecmp(entry->name, name) && entry->bitrate == bitrate && entry->frequency == frequency)
+    if (entry->name && !strcasecmp(entry->name, name) && entry->bitrate == bitrate && entry->samples == samples)
       break;
     entry = entry->next;
   }
@@ -379,18 +379,18 @@
   ast_mutex_unlock(&medialock);
 
   if (option_verbose > 1)
-    ast_verbose(VERBOSE_PREFIX_2 "Linked %s to coremedia handler '%s' of type '%s' with bitrate %d and frequency %d\n", direction ? "decoder" : "encoder", cm->name, type_to_name(cm->type), cm->bitrate, cm->frequency);
+    ast_verbose(VERBOSE_PREFIX_2 "Linked %s to coremedia handler '%s' of type '%s' with bitrate %d and sample size of %d\n", direction ? "decoder" : "encoder", cm->name, type_to_name(cm->type), cm->bitrate, cm->samples);
 
   return 0;
 }
 
-/* Link an encoder or decoder to a coremedia handler by name, bitrate, and frequency */
-int ast_coremedia_link_by_data(char *name, int bitrate, int frequency, struct ast_coremedia_translator *tl, int direction)
+/* Link an encoder or decoder to a coremedia handler by name, bitrate, and samples */
+int ast_coremedia_link_by_data(char *name, int bitrate, int samples, struct ast_coremedia_translator *tl, int direction)
 {
   int success = -1;
   struct ast_coremedia_entry *entry = NULL;
 
-  entry = ast_coremedia_get(name, bitrate, frequency);
+  entry = ast_coremedia_get(name, bitrate, samples);
   if (entry != NULL) {
     success = 0;
     ast_coremedia_link(entry, tl, direction);
@@ -405,15 +405,15 @@
   struct ast_coremedia_entry *entry = NULL;
 
   /* Make sure a handler of this information is not already registered */
-  entry = ast_coremedia_get(cm->name, cm->bitrate, cm->frequency);
+  entry = ast_coremedia_get(cm->name, cm->bitrate, cm->samples);
   if (entry != NULL) {
     /* Already registered */
     return -1;
   }
 
   /* Sanitize the entry before using it */
-  if (cm->frequency == 0)
-    cm->frequency = 8000; /* Assume 8000Hz if not specified */
+  if (cm->samples == 0)
+    cm->samples = 8000; /* Assume 8000Hz if not specified */
 
   /* Generate a unique subclass identifier for this coremedia entry */
   ast_mutex_lock(&subclasslock);
@@ -422,7 +422,7 @@
   ast_mutex_unlock(&subclasslock);
 
   if (option_verbose > 1) {
-    ast_verbose(VERBOSE_PREFIX_2 "Registered coremedia handler '%s' of type '%s' with bitrate %d and frequency %d\n", cm->name, type_to_name(cm->type), cm->bitrate, cm->frequency);
+    ast_verbose(VERBOSE_PREFIX_2 "Registered coremedia handler '%s' of type '%s' with bitrate %d and sample size of %d\n", cm->name, type_to_name(cm->type), cm->bitrate, cm->samples);
 
     /* If encoder or decoder is already present... say it's there */
     if (cm->encoder != NULL)
@@ -460,7 +460,7 @@
       /* There should not be any more entries - so break */
       success = 0;
       if (option_verbose > 1)
-	ast_verbose(VERBOSE_PREFIX_2 "Unregistered coremedia handler '%s' of type '%s' with bitrate %d and frequency %d\n", cm->name, type_to_name(cm->type), cm->bitrate, cm->frequency);
+	ast_verbose(VERBOSE_PREFIX_2 "Unregistered coremedia handler '%s' of type '%s' with bitrate %d and sample size of %d\n", cm->name, type_to_name(cm->type), cm->bitrate, cm->samples);
       break;
     } else {
       previous = entry;

Modified: team/file/coremedia/include/asterisk/coremedia.h
URL: http://svn.digium.com/view/asterisk/team/file/coremedia/include/asterisk/coremedia.h?rev=7312&r1=7311&r2=7312&view=diff
==============================================================================
--- team/file/coremedia/include/asterisk/coremedia.h (original)
+++ team/file/coremedia/include/asterisk/coremedia.h Sat Dec  3 14:10:28 2005
@@ -51,8 +51,8 @@
     int payload;
     /*! Bitrate */
     int bitrate;
-    /*! Frequency */
-    int frequency;
+    /*! Samples */
+    int samples;
     /*! Name of coremedia entry */
     char *entry_name;
     /*! Registered coremedia entry */
@@ -81,8 +81,8 @@
     int type;
     /*! Bitrate of handler if applicable */
     int bitrate;
-    /*! Frequency if applicable - if not defined, assumed to be 8000 */
-    int frequency;
+    /*! Samples if applicable - if not defined, assumed to be 8000 */
+    int samples;
     /*! The old AST_FORMAT (if applicable) */
     int format;
     /*! Encoder */
@@ -139,13 +139,13 @@
   int ast_coremedia_rtp_register(struct ast_coremedia_rtp *rtp);
   int ast_coremedia_rtp_unregister(struct ast_coremedia_rtp *rtp);
 
-  struct ast_coremedia_entry *ast_coremedia_get(char *name, int bitrate, int frequency);
+  struct ast_coremedia_entry *ast_coremedia_get(char *name, int bitrate, int samples);
   struct ast_coremedia_entry *ast_coremedia_get_by_format(int format);
   int ast_coremedia_register(struct ast_coremedia_entry *cm);
   int ast_coremedia_unregister(struct ast_coremedia_entry *cm);
 
   int ast_coremedia_link(struct ast_coremedia_entry *cm, struct ast_coremedia_translator *tl, int direction);
-  int ast_coremedia_link_by_data(char *name, int bitrate, int frequency, struct ast_coremedia_translator *tl, int direction);
+  int ast_coremedia_link_by_data(char *name, int bitrate, int samples, struct ast_coremedia_translator *tl, int direction);
 
 #if defined(__cplusplus) || defined(c_plusplus)
 }



More information about the svn-commits mailing list