mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-17 23:38:23 +00:00
Merge "rtp: Preserve timestamps on video frames."
This commit is contained in:
@@ -758,36 +758,42 @@ static struct ast_codec h261 = {
|
||||
.name = "h261",
|
||||
.description = "H.261 video",
|
||||
.type = AST_MEDIA_TYPE_VIDEO,
|
||||
.sample_rate = 1000,
|
||||
};
|
||||
|
||||
static struct ast_codec h263 = {
|
||||
.name = "h263",
|
||||
.description = "H.263 video",
|
||||
.type = AST_MEDIA_TYPE_VIDEO,
|
||||
.sample_rate = 1000,
|
||||
};
|
||||
|
||||
static struct ast_codec h263p = {
|
||||
.name = "h263p",
|
||||
.description = "H.263+ video",
|
||||
.type = AST_MEDIA_TYPE_VIDEO,
|
||||
.sample_rate = 1000,
|
||||
};
|
||||
|
||||
static struct ast_codec h264 = {
|
||||
.name = "h264",
|
||||
.description = "H.264 video",
|
||||
.type = AST_MEDIA_TYPE_VIDEO,
|
||||
.sample_rate = 1000,
|
||||
};
|
||||
|
||||
static struct ast_codec mpeg4 = {
|
||||
.name = "mpeg4",
|
||||
.description = "MPEG4 video",
|
||||
.type = AST_MEDIA_TYPE_VIDEO,
|
||||
.sample_rate = 1000,
|
||||
};
|
||||
|
||||
static struct ast_codec vp8 = {
|
||||
.name = "vp8",
|
||||
.description = "VP8 video",
|
||||
.type = AST_MEDIA_TYPE_VIDEO,
|
||||
.sample_rate = 1000,
|
||||
};
|
||||
|
||||
static struct ast_codec t140red = {
|
||||
|
||||
@@ -4763,6 +4763,8 @@ static struct ast_frame *ast_rtp_read(struct ast_rtp_instance *instance, int rtc
|
||||
/* Video -- samples is # of samples vs. 90000 */
|
||||
if (!rtp->lastividtimestamp)
|
||||
rtp->lastividtimestamp = timestamp;
|
||||
ast_set_flag(&rtp->f, AST_FRFLAG_HAS_TIMING_INFO);
|
||||
rtp->f.ts = timestamp / (rtp_get_rate(rtp->f.subclass.format) / 1000);
|
||||
rtp->f.samples = timestamp - rtp->lastividtimestamp;
|
||||
rtp->lastividtimestamp = timestamp;
|
||||
rtp->f.delivery.tv_sec = 0;
|
||||
|
||||
Reference in New Issue
Block a user