summaryrefslogtreecommitdiff
path: root/zttranscode.c
diff options
context:
space:
mode:
authormogorman <mogorman@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2006-12-11 19:45:18 +0000
committermogorman <mogorman@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2006-12-11 19:45:18 +0000
commit2f198d98a8150963b7154c18930173b8b871f6c3 (patch)
tree19e2a7ec583c6741bd008c01b7d3b167a46ab37b /zttranscode.c
parent1bfb68dfe23e791a6dacc7b59a65e6f5341c4973 (diff)
updates for dynamic channel creation on transcoder card.
from jsloan's branch git-svn-id: http://svn.digium.com/svn/zaptel/trunk@1703 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'zttranscode.c')
-rw-r--r--zttranscode.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/zttranscode.c b/zttranscode.c
index 5c9f26b..58bdcef 100644
--- a/zttranscode.c
+++ b/zttranscode.c
@@ -72,6 +72,8 @@ struct zt_transcoder *zt_transcoder_alloc(int numchans)
init_waitqueue_head(&ztc->channels[x].ready);
ztc->channels[x].parent = ztc;
ztc->channels[x].offset = x;
+ ztc->channels[x].chan_built = 0;
+ ztc->channels[x].built_fmts = 0;
}
return ztc;
@@ -214,6 +216,7 @@ static void ztc_release(struct zt_transcoder_channel *ztc)
if (ztc->tch)
kfree(ztc->tch);
ztc->tch = NULL;
+ /* Actually reset the transcoder channel */
if (ztc->flags & ZT_TC_FLAG_TRANSIENT)
kfree(ztc);
if (debug)
@@ -250,6 +253,8 @@ static int do_reset(struct zt_transcoder_channel **ztc)
for (x = 0; x < tc->numchannels; x++) {
if (tc->channels[x].flags & ZT_TC_FLAG_BUSY)
continue;
+ if ((tc->channels[x].chan_built) && ((zth->srcfmt | zth->dstfmt) != tc->channels[x].built_fmts))
+ continue;
newztc = &tc->channels[x];
newztc->flags = ZT_TC_FLAG_BUSY;
@@ -306,6 +311,7 @@ static int zt_tc_getinfo(unsigned long data)
return -ENOSYS;
strncpy(info.name, tc->name, sizeof(info.name) - 1);
+ info.numchannels = tc->numchannels;
info.srcfmts = tc->srcfmts;
info.dstfmts = tc->dstfmts;
@@ -336,6 +342,9 @@ static int zt_tc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
ret = do_reset(&ztc);
file->private_data = ztc;
break;
+ case ZT_TCOP_RELEASE:
+ ret = ztc->parent->operation(ztc, ZT_TCOP_RELEASE);
+ break;
case ZT_TCOP_TRANSCODE:
if (!ztc->parent->operation)
return -EINVAL;