From b2ec873480feedee8af98779ed2e4a6f2f695877 Mon Sep 17 00:00:00 2001 From: oej Date: Wed, 21 Jun 2006 20:11:09 +0000 Subject: Add video support to chan_agent. More ideas for developing better video support in Asterisk? Join the asterisk-video mailing list to help out in the Asterisk Video Task Force! git-svn-id: http://svn.digium.com/svn/asterisk/trunk@35365 f38db490-d61c-443f-a65b-d21fe96a405b --- channels/chan_agent.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'channels') diff --git a/channels/chan_agent.c b/channels/chan_agent.c index 71be99a4c..867f82a8c 100644 --- a/channels/chan_agent.c +++ b/channels/chan_agent.c @@ -263,6 +263,7 @@ static const struct ast_channel_tech agent_tech = { .answer = agent_answer, .read = agent_read, .write = agent_write, + .write_video = agent_write, .send_html = agent_sendhtml, .send_text = agent_sendtext, .exception = agent_read, @@ -503,7 +504,8 @@ static struct ast_frame *agent_read(struct ast_channel *ast) } break; case AST_FRAME_VOICE: - /* don't pass voice until the call is acknowledged */ + case AST_FRAME_VIDEO: + /* don't pass voice or video until the call is acknowledged */ if (!p->acknowledged) { ast_frfree(f); f = &ast_null_frame; @@ -554,16 +556,20 @@ static int agent_write(struct ast_channel *ast, struct ast_frame *f) int res = -1; CHECK_FORMATS(ast, p); ast_mutex_lock(&p->lock); - if (p->chan) { + if (!p->chan) + res = 0; + else { if ((f->frametype != AST_FRAME_VOICE) || + (f->frametype != AST_FRAME_VIDEO) || (f->subclass == p->chan->writeformat)) { res = ast_write(p->chan, f); } else { - ast_log(LOG_DEBUG, "Dropping one incompatible voice frame on '%s' to '%s'\n", ast->name, p->chan->name); + ast_log(LOG_DEBUG, "Dropping one incompatible %s frame on '%s' to '%s'\n", + f->frametype == AST_FRAME_VOICE ? "audio" : "video", + ast->name, p->chan->name); res = 0; } - } else - res = 0; + } CLEANUP(ast, p); ast_mutex_unlock(&p->lock); return res; -- cgit v1.2.3