diff options
author | oej <oej@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-06-06 16:09:33 +0000 |
---|---|---|
committer | oej <oej@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-06-06 16:09:33 +0000 |
commit | 4506e03f3d24f4bd4f6b17803031ede1e353de28 (patch) | |
tree | b849a5c247c05d8e052b854defc2526e0f341a64 /channel.c | |
parent | 77abfdfd00db4460aeb6e9c3b5065406486ca4f4 (diff) |
Merge of the "sdpcleanup" branch. Thanks to John Martin for a lot of tests
and some patches (all disclaimed).
- Don't change RTP properties if we reject a re-INVITE
- Don't add video to an outbound channel if there's no video on the inbound channel
- Don't include video in the "preferred codec" list for codec selection
- Clean up and document code that parses and adds SDP attachments
Since we do not transcode video, we can't handle video the same way as audio. This is a
bug fix patch. In future releases, we need to work on a solution for video negotiation,
not codecs but formats and framerates instead.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@32597 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channel.c')
-rw-r--r-- | channel.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -539,7 +539,7 @@ char *ast_transfercapability2str(int transfercapability) } } -/*! \brief Pick the best codec */ +/*! \brief Pick the best audio codec */ int ast_best_codec(int fmts) { /* This just our opinion, expressed in code. We are asked to choose @@ -572,7 +572,9 @@ int ast_best_codec(int fmts) /*! Down to G.723.1 which is proprietary but at least designed for voice */ AST_FORMAT_G723_1, }; - + + /* Strip out video */ + fmts &= AST_FORMAT_AUDIO_MASK; /* Find the first preferred codec in the format given */ for (x=0; x < (sizeof(prefs) / sizeof(prefs[0]) ); x++) @@ -2614,6 +2616,7 @@ struct ast_channel *ast_request(const char *type, int format, void *data, int *c int fmt; int res; int foo; + int videoformat = format & AST_FORMAT_VIDEO_MASK; if (!cause) cause = &foo; @@ -2629,7 +2632,7 @@ struct ast_channel *ast_request(const char *type, int format, void *data, int *c continue; capabilities = chan->tech->capabilities; - fmt = format; + fmt = format & AST_FORMAT_AUDIO_MASK; res = ast_translator_best_choice(&fmt, &capabilities); if (res < 0) { ast_log(LOG_WARNING, "No translator path exists for channel type %s (native %d) to %d\n", type, chan->tech->capabilities, format); @@ -2640,7 +2643,7 @@ struct ast_channel *ast_request(const char *type, int format, void *data, int *c if (!chan->tech->requester) return NULL; - if (!(c = chan->tech->requester(type, capabilities, data, cause))) + if (!(c = chan->tech->requester(type, capabilities | videoformat, data, cause))) return NULL; if (c->_state == AST_STATE_DOWN) { |