[asterisk-commits] oej: branch oej/videocaps r103766 - in /team/oej/videocaps: channels/ main/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Feb 18 09:58:32 CST 2008
Author: oej
Date: Mon Feb 18 09:58:32 2008
New Revision: 103766
URL: http://svn.digium.com/view/asterisk?view=rev&rev=103766
Log:
Apply codec preferences to video codecs too.
You want to be able to say "I prefer H.264, but if that doesn't work, I'll settle with something more fuzzy and not very sexy."
Modified:
team/oej/videocaps/channels/chan_sip.c
team/oej/videocaps/main/frame.c
Modified: team/oej/videocaps/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/channels/chan_sip.c?view=diff&rev=103766&r1=103765&r2=103766
==============================================================================
--- team/oej/videocaps/channels/chan_sip.c (original)
+++ team/oej/videocaps/channels/chan_sip.c Mon Feb 18 09:58:32 2008
@@ -8592,13 +8592,22 @@
if (alreadysent & codec)
continue;
- add_codec_to_sdp(p, codec, SDP_SAMPLE_RATE(codec),
- &m_audio, &a_audio,
- debug, &min_audio_packet_size);
- alreadysent |= codec;
+ if (codec & AST_FORMAT_AUDIO_MASK) {
+ add_codec_to_sdp(p, codec, SDP_SAMPLE_RATE(codec),
+ &m_audio, &a_audio,
+ debug, &min_audio_packet_size);
+ alreadysent |= codec;
+ } else if (codec & AST_FORMAT_VIDEO_MASK) {
+ add_vcodec_to_sdp(p, codec, 90000,
+ &m_video, &a_video, debug, &min_video_packet_size);
+ alreadysent |= codec;
+ }
}
/* Now send any other common audio and video codecs, and non-codec formats: */
+ /*! \note Find out: Shouldn't this be done in the order preferred from frame.c ???
+ Going in the bitmap order doesn't make sense at all.
+ */
for (x = 1; x <= (needtext ? AST_FORMAT_TEXT_MASK : (needvideo ? AST_FORMAT_VIDEO_MASK : AST_FORMAT_AUDIO_MASK)); x <<= 1) {
if (!(capability & x)) /* Codec not requested */
continue;
@@ -12822,7 +12831,8 @@
if (!codec)
break;
ast_cli(fd, "%s", ast_getformatname(codec));
- ast_cli(fd, ":%d", pref->framing[x]);
+ if(pref->framing[x])
+ ast_cli(fd, ":%d", pref->framing[x]);
if (x < 31 && ast_codec_pref_index(pref, x + 1))
ast_cli(fd, ",");
}
Modified: team/oej/videocaps/main/frame.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/main/frame.c?view=diff&rev=103766&r1=103765&r2=103766
==============================================================================
--- team/oej/videocaps/main/frame.c (original)
+++ team/oej/videocaps/main/frame.c Mon Feb 18 09:58:32 2008
@@ -1221,10 +1221,10 @@
*mask &= ~format;
}
- /* Set up a preference list for audio. Do not include video in preferences
- since we can not transcode video and have to use whatever is offered
+ /* Set up a preference list for audio and video codecs, so that we can offer them in
+ order on outbound invites.
*/
- if (pref && (format & AST_FORMAT_AUDIO_MASK)) {
+ if (pref && (format & AST_FORMAT_VIDEO_MASK)) { /* Avoid text codecs, since we only have one of them */
if (strcasecmp(this, "all")) {
if (allowing) {
ast_codec_pref_append(pref, format);
More information about the asterisk-commits
mailing list