summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzuul <zuul@gerrit.asterisk.org>2016-09-14 17:29:33 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2016-09-14 17:29:33 -0500
commitf0baa12538b1ab0b6ea58d6ddd4efa860acadd57 (patch)
tree2e6a750852f8345cee74eefe153e24deedfacc24
parent139d86c8ab883f3460e9b163ef11cd674eefc733 (diff)
parent1cac856e175efb57585448f0266b5eedd21c7d40 (diff)
Merge "rtp: Preserve timestamps on video frames." into 13
-rw-r--r--main/codec_builtin.c6
-rw-r--r--res/res_rtp_asterisk.c2
2 files changed, 8 insertions, 0 deletions
diff --git a/main/codec_builtin.c b/main/codec_builtin.c
index 1d329bc3b..973423d55 100644
--- a/main/codec_builtin.c
+++ b/main/codec_builtin.c
@@ -728,36 +728,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 = {
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index d05774fde..627f800a4 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -4764,6 +4764,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;