mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 02:26:23 +00:00
Start on video mode for meetme, change symantics of iax2 marker in full frames
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1142 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -51,6 +51,7 @@ static char *descrip =
|
|||||||
" 'p' -- allow user to exit the conference by pressing '#'\n"
|
" 'p' -- allow user to exit the conference by pressing '#'\n"
|
||||||
" 's' -- send user to admin/user menu if '*' is received\n"
|
" 's' -- send user to admin/user menu if '*' is received\n"
|
||||||
" 't' -- set talk only mode\n"
|
" 't' -- set talk only mode\n"
|
||||||
|
" 'v' -- video mode\n"
|
||||||
" 'q' -- quiet mode (don't play enter/leave sounds)\n";
|
" 'q' -- quiet mode (don't play enter/leave sounds)\n";
|
||||||
|
|
||||||
static char *descrip2 =
|
static char *descrip2 =
|
||||||
@@ -87,6 +88,7 @@ static pthread_mutex_t conflock = AST_MUTEX_INITIALIZER;
|
|||||||
#define CONFFLAG_STARMENU (1 << 4) /* If set asterisk will provide a menu to the user what '*' is pressed */
|
#define CONFFLAG_STARMENU (1 << 4) /* If set asterisk will provide a menu to the user what '*' is pressed */
|
||||||
#define CONFFLAG_TALKER (1 << 5) /* If set the use can only send audio to the conference */
|
#define CONFFLAG_TALKER (1 << 5) /* If set the use can only send audio to the conference */
|
||||||
#define CONFFLAG_QUIET (1 << 6) /* If set there will be no enter or leave sounds */
|
#define CONFFLAG_QUIET (1 << 6) /* If set there will be no enter or leave sounds */
|
||||||
|
#define CONFFLAG_VIDEO (1 << 7) /* Set to enable video mode */
|
||||||
|
|
||||||
static int careful_write(int fd, unsigned char *data, int len)
|
static int careful_write(int fd, unsigned char *data, int len)
|
||||||
{
|
{
|
||||||
@@ -234,6 +236,7 @@ static int conf_run(struct ast_channel *chan, struct conf *conf, int confflags)
|
|||||||
int origfd;
|
int origfd;
|
||||||
int firstpass = 0;
|
int firstpass = 0;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
int x;
|
||||||
|
|
||||||
ZT_BUFFERINFO bi;
|
ZT_BUFFERINFO bi;
|
||||||
char __buf[CONF_SIZE + AST_FRIENDLY_OFFSET];
|
char __buf[CONF_SIZE + AST_FRIENDLY_OFFSET];
|
||||||
@@ -243,17 +246,31 @@ static int conf_run(struct ast_channel *chan, struct conf *conf, int confflags)
|
|||||||
if (!ast_streamfile(chan, "conf-onlyperson", chan->language))
|
if (!ast_streamfile(chan, "conf-onlyperson", chan->language))
|
||||||
ast_waitstream(chan, "");
|
ast_waitstream(chan, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set it into U-law mode (write) */
|
|
||||||
if (ast_set_write_format(chan, AST_FORMAT_ULAW) < 0) {
|
|
||||||
ast_log(LOG_WARNING, "Unable to set '%s' to write ulaw mode\n", chan->name);
|
|
||||||
goto outrun;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Set it into U-law mode (read) */
|
if (confflags & CONFFLAG_VIDEO) {
|
||||||
if (ast_set_read_format(chan, AST_FORMAT_ULAW) < 0) {
|
/* Set it into linear mode (write) */
|
||||||
ast_log(LOG_WARNING, "Unable to set '%s' to read ulaw mode\n", chan->name);
|
if (ast_set_write_format(chan, AST_FORMAT_SLINEAR) < 0) {
|
||||||
goto outrun;
|
ast_log(LOG_WARNING, "Unable to set '%s' to write linear mode\n", chan->name);
|
||||||
|
goto outrun;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Set it into linear mode (read) */
|
||||||
|
if (ast_set_read_format(chan, AST_FORMAT_SLINEAR) < 0) {
|
||||||
|
ast_log(LOG_WARNING, "Unable to set '%s' to read linear mode\n", chan->name);
|
||||||
|
goto outrun;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/* Set it into U-law mode (write) */
|
||||||
|
if (ast_set_write_format(chan, AST_FORMAT_ULAW) < 0) {
|
||||||
|
ast_log(LOG_WARNING, "Unable to set '%s' to write ulaw mode\n", chan->name);
|
||||||
|
goto outrun;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Set it into U-law mode (read) */
|
||||||
|
if (ast_set_read_format(chan, AST_FORMAT_ULAW) < 0) {
|
||||||
|
ast_log(LOG_WARNING, "Unable to set '%s' to read ulaw mode\n", chan->name);
|
||||||
|
goto outrun;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ast_indicate(chan, -1);
|
ast_indicate(chan, -1);
|
||||||
retryzap = strcasecmp(chan->type, "Zap");
|
retryzap = strcasecmp(chan->type, "Zap");
|
||||||
@@ -288,6 +305,14 @@ zapretry:
|
|||||||
close(fd);
|
close(fd);
|
||||||
goto outrun;
|
goto outrun;
|
||||||
}
|
}
|
||||||
|
if (confflags & CONFFLAG_VIDEO) {
|
||||||
|
x = 1;
|
||||||
|
if (ioctl(fd, ZT_SETLINEAR, &x)) {
|
||||||
|
ast_log(LOG_WARNING, "Unable to set linear mode: %s\n", strerror(errno));
|
||||||
|
close(fd);
|
||||||
|
goto outrun;
|
||||||
|
}
|
||||||
|
}
|
||||||
nfds = 1;
|
nfds = 1;
|
||||||
} else {
|
} else {
|
||||||
/* XXX Make sure we're not running on a pseudo channel XXX */
|
/* XXX Make sure we're not running on a pseudo channel XXX */
|
||||||
|
@@ -2210,7 +2210,7 @@ static int iax2_send(struct chan_iax2_pvt *pvt, struct ast_frame *f, unsigned in
|
|||||||
pvt->aseqno = fr->iseqno;
|
pvt->aseqno = fr->iseqno;
|
||||||
fh->type = fr->af.frametype & 0xFF;
|
fh->type = fr->af.frametype & 0xFF;
|
||||||
if (fr->af.frametype == AST_FRAME_VIDEO)
|
if (fr->af.frametype == AST_FRAME_VIDEO)
|
||||||
fh->csub = compress_subclass(fr->af.subclass & ~0x1) | (fr->af.subclass & 0x1);
|
fh->csub = compress_subclass(fr->af.subclass & ~0x1) | ((fr->af.subclass & 0x1) << 6);
|
||||||
else
|
else
|
||||||
fh->csub = compress_subclass(fr->af.subclass);
|
fh->csub = compress_subclass(fr->af.subclass);
|
||||||
if (transfer) {
|
if (transfer) {
|
||||||
@@ -3696,7 +3696,7 @@ static int socket_read(int *id, int fd, short events, void *cbdata)
|
|||||||
/* Retrieve the type and subclass */
|
/* Retrieve the type and subclass */
|
||||||
f.frametype = fh->type;
|
f.frametype = fh->type;
|
||||||
if (f.frametype == AST_FRAME_VOICE) {
|
if (f.frametype == AST_FRAME_VOICE) {
|
||||||
f.subclass = uncompress_subclass(fh->csub & ~0x1) | (fh->csub & 0x1);
|
f.subclass = uncompress_subclass(fh->csub & ~0x40) | ((fh->csub & 0x40) >> 6);
|
||||||
} else {
|
} else {
|
||||||
f.subclass = uncompress_subclass(fh->csub);
|
f.subclass = uncompress_subclass(fh->csub);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user