channel: Add ast_read_stream function for reading frames from all streams.

This change introduces an ast_read_stream function and callback in
the channel technology which allows reading frames from all streams
and not just the default streams.

The stream number has also been added to frames. This is to allow the
case where frames are queued onto the channel instead of being read
directly from the driver.

This change does impose a restriction on reading though: a chain of
frames can only contain frames from the same stream.

ASTERISK-26816

Change-Id: I5d7dc35e86694df91fd025126f6cfe0453aa38ce
This commit is contained in:
Joshua Colp
2017-02-23 19:03:15 +00:00
committed by George Joseph
parent 6cc890b880
commit c07c6714f2
4 changed files with 105 additions and 8 deletions

View File

@@ -222,6 +222,7 @@ struct ast_frame *ast_frisolate(struct ast_frame *fr)
out->len = fr->len;
out->seqno = fr->seqno;
}
out->stream_num = fr->stream_num;
} else {
out = fr;
}
@@ -370,6 +371,7 @@ struct ast_frame *ast_frdup(const struct ast_frame *f)
out->ts = f->ts;
out->len = f->len;
out->seqno = f->seqno;
out->stream_num = f->stream_num;
return out;
}