Expand codec bitfield from 32 bits to 64 bits.

Reviewboard: https://reviewboard.asterisk.org/r/416/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227580 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2009-11-04 14:05:12 +00:00
parent 6a50e7a031
commit d8e0c58437
124 changed files with 1777 additions and 1366 deletions

View File

@@ -64,7 +64,7 @@ static int h263_open(struct ast_filestream *s)
static struct ast_frame *h263_read(struct ast_filestream *s, int *whennext)
{
int res;
int mark;
format_t mark;
unsigned short len;
unsigned int ts;
struct h263_desc *fs = (struct h263_desc *)s->_private;
@@ -80,7 +80,7 @@ static struct ast_frame *h263_read(struct ast_filestream *s, int *whennext)
return NULL;
}
s->fr.frametype = AST_FRAME_VIDEO;
s->fr.subclass = AST_FORMAT_H263;
s->fr.subclass.codec = AST_FORMAT_H263;
s->fr.mallocd = 0;
AST_FRAME_SET_BUFFER(&s->fr, s->buf, AST_FRIENDLY_OFFSET, len);
if ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) != s->fr.datalen) {
@@ -90,7 +90,7 @@ static struct ast_frame *h263_read(struct ast_filestream *s, int *whennext)
}
s->fr.samples = fs->lastts; /* XXX what ? */
s->fr.datalen = len;
s->fr.subclass |= mark;
s->fr.subclass.codec |= mark;
s->fr.delivery.tv_sec = 0;
s->fr.delivery.tv_usec = 0;
if ((res = fread(&ts, 1, sizeof(ts), s->f)) == sizeof(ts)) {
@@ -106,18 +106,18 @@ static int h263_write(struct ast_filestream *fs, struct ast_frame *f)
int res;
unsigned int ts;
unsigned short len;
int subclass;
int mark=0;
format_t subclass;
format_t mark=0;
if (f->frametype != AST_FRAME_VIDEO) {
ast_log(LOG_WARNING, "Asked to write non-video frame!\n");
return -1;
}
subclass = f->subclass;
subclass = f->subclass.codec;
if (subclass & 0x1)
mark=0x8000;
subclass &= ~0x1;
if (subclass != AST_FORMAT_H263) {
ast_log(LOG_WARNING, "Asked to write non-h263 frame (%d)!\n", f->subclass);
ast_log(LOG_WARNING, "Asked to write non-h263 frame (%s)!\n", ast_getformatname(f->subclass.codec));
return -1;
}
ts = htonl(f->samples);