[zaptel-commits] sruffell: branch sruffell/zaptel-1.4-transcoder r4207 - /team/sruffell/zaptel...
SVN commits to the Zaptel project
zaptel-commits at lists.digium.com
Wed Apr 30 18:17:58 CDT 2008
Author: sruffell
Date: Wed Apr 30 18:17:57 2008
New Revision: 4207
URL: http://svn.digium.com/view/zaptel?view=rev&rev=4207
Log:
- Working on G723 transcoding (in progress).
- By default, do not export debugfs files.
- Changed type of GFP allocation flags in order to work with some older
kernels.
Modified:
team/sruffell/zaptel-1.4-transcoder/kernel/wctc4xxp/base.c
team/sruffell/zaptel-1.4-transcoder/kernel/wctc4xxp/codec_test.h
team/sruffell/zaptel-1.4-transcoder/kernel/wctc4xxp/codec_test_threaded.c
Modified: team/sruffell/zaptel-1.4-transcoder/kernel/wctc4xxp/base.c
URL: http://svn.digium.com/view/zaptel/team/sruffell/zaptel-1.4-transcoder/kernel/wctc4xxp/base.c?view=diff&rev=4207&r1=4206&r2=4207
==============================================================================
--- team/sruffell/zaptel-1.4-transcoder/kernel/wctc4xxp/base.c (original)
+++ team/sruffell/zaptel-1.4-transcoder/kernel/wctc4xxp/base.c Wed Apr 30 18:17:57 2008
@@ -52,6 +52,9 @@
#endif
#include "zaptel.h"
+
+/* \todo Need to check these functions with more linux versions... */
+#undef CONFIG_DEBUG_FS
#define INTERRUPT 0
#define WORKQUEUE 1
@@ -595,7 +598,7 @@
}
static inline struct dte_cmd *
-__alloc_cmd(gfp_t alloc_flags, unsigned long cmd_flags)
+__alloc_cmd(unsigned alloc_flags, unsigned long cmd_flags)
{
struct dte_cmd *cmd;
@@ -1277,6 +1280,16 @@
return -EINVAL;
}
+ if (ZT_FORMAT_G723_1 == ztc->srcfmt) {
+ if (G723_LENGTH != count) {
+ DTE_DEBUG(wc, DTE_DEBUG_GENERAL,
+ "Trying to transcode packet into G723 format " \
+ "that is %d bytes instead of the expected " \
+ "%d bytes.\n", count, G723_LENGTH);
+ return -EINVAL;
+ }
+ }
+
if (!(cmd = alloc_cmd())) {
LEAVING();
return -ENOMEM;
@@ -1355,8 +1368,9 @@
* back to back from causing another waiting thread from missing a
* particular response?
*/
-#define MESSAGE_PACKET 0x80
-#define SUPPRESS_ACK 0x40
+ const int MESSAGE_PACKET = 0x80;
+ const int SUPPRESS_ACK = 0x40;
+
if (!(hdr->control & MESSAGE_PACKET)) {
const __u16 function = be16_to_cpu(hdr->function);
if (!(hdr->control & SUPPRESS_ACK)) {
Modified: team/sruffell/zaptel-1.4-transcoder/kernel/wctc4xxp/codec_test.h
URL: http://svn.digium.com/view/zaptel/team/sruffell/zaptel-1.4-transcoder/kernel/wctc4xxp/codec_test.h?view=diff&rev=4207&r1=4206&r2=4207
==============================================================================
--- team/sruffell/zaptel-1.4-transcoder/kernel/wctc4xxp/codec_test.h (original)
+++ team/sruffell/zaptel-1.4-transcoder/kernel/wctc4xxp/codec_test.h Wed Apr 30 18:17:57 2008
@@ -1,10 +1,12 @@
/*
- * Wilcard TC400B Digium Transcoder Engine Interface Driver for Zapata Telephony interface test tool.
+ * Wilcard TC400B Digium Transcoder Engine Interface Driver for Zapata
+ * Telephony interface test tool.
*
* Written by Patrick Himebrook <thuper at digium.com>
- * Matt O'Gorman <mogorman at digium.com>
- *
- * Copyright (C) 2006-2007, Digium, Inc.
+ * Matt O'Gorman <mogorman at digium.com>
+ * Shaun Ruffell <sruffell at digium.com>
+ *
+ * Copyright (C) 2006-2008, Digium, Inc.
*
* All rights reserved.
*
@@ -33,7 +35,7 @@
#define FORMAT_G729A (1 << 8)
#define G729_SIZE 20
-#define G723_SIZE 20
+#define G723_SIZE 30
#define LAW_30MS_SIZE 240
#define LAW_20MS_SIZE 160
Modified: team/sruffell/zaptel-1.4-transcoder/kernel/wctc4xxp/codec_test_threaded.c
URL: http://svn.digium.com/view/zaptel/team/sruffell/zaptel-1.4-transcoder/kernel/wctc4xxp/codec_test_threaded.c?view=diff&rev=4207&r1=4206&r2=4207
==============================================================================
--- team/sruffell/zaptel-1.4-transcoder/kernel/wctc4xxp/codec_test_threaded.c (original)
+++ team/sruffell/zaptel-1.4-transcoder/kernel/wctc4xxp/codec_test_threaded.c Wed Apr 30 18:17:57 2008
@@ -265,29 +265,6 @@
{
int res;
-#if 0
- ztp->hdr->srcoffset = 0;
-
- memcpy(ztp->hdr->srcdata + ztp->hdr->srcoffset + ztp->hdr->srclen, packet_in, tst_data.srcsize);
-
- ztp->hdr->srclen += tst_data.srcsize;
-
- ztp->hdr->dstoffset = TC_FRIENDLY_OFFSET;
-
- x = ZT_TCOP_TRANSCODE;
- if (ioctl(ztp->fd, ZT_TRANSCODE_OP, &x))
- printf("Failed to transcode: %s\n", strerror(errno));
-
- usleep(20000);
-
- if (ztp->hdr->dstlen) {
- memcpy(ztp->packet_out, ztp->hdr->dstdata + ztp->hdr->dstoffset, ztp->hdr->dstlen);
- ztp->hdr->dstlen = 0;
- return 0;
- }
- else
- return -1;
-#endif
res = write(ztp->fd, packet_in, tst_data.srcsize);
if (res <= 0) {
fprintf(stderr, "Failed to write: %s\n", strerror(errno));
More information about the zaptel-commits
mailing list