summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlfred E. Heggestad <alfred.heggestad@gmail.com>2017-07-29 15:13:00 +0200
committerGitHub <noreply@github.com>2017-07-29 15:13:00 +0200
commit6c56980cbeecaaeac0367ad9aa48eaa84fd8314b (patch)
tree062e0fa2e0ecf1a3072386972a87886fa38fe3ec /test
parent5d297b1594765b681466b13257af0a59bf765ff8 (diff)
Video timestamp (#286)
* add timestamp to video encoder/decoder * update vp8 vp9 * random offset * revert decoder timestamp * cleanup * gst_video1: add timestamp * change timestamp to RTP-timestamp * update modules * timestamp things * save rtp timestamp * packet_handler: align params same as RTP header * align parameters same way like RTP-header * avcodec: calc ts for old FFmpeg versions * cleanup * fix gst avcodec: use correct AVPacket * minor cleanup
Diffstat (limited to 'test')
-rw-r--r--test/mock/mock_vidcodec.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/mock/mock_vidcodec.c b/test/mock/mock_vidcodec.c
index 745e43f..9609e65 100644
--- a/test/mock/mock_vidcodec.c
+++ b/test/mock/mock_vidcodec.c
@@ -21,6 +21,8 @@ struct hdr {
};
struct videnc_state {
+ int64_t pts;
+ unsigned fps;
videnc_packet_h *pkth;
void *arg;
};
@@ -73,6 +75,7 @@ static int mock_encode_update(struct videnc_state **vesp,
*vesp = ves;
}
+ ves->fps = prm->fps;
ves->pkth = pkth;
ves->arg = arg;
@@ -85,6 +88,7 @@ static int mock_encode(struct videnc_state *ves, bool update,
{
struct mbuf *hdr;
uint8_t payload[2] = {0,0};
+ uint32_t rtp_ts;
int err;
(void)update;
@@ -99,7 +103,9 @@ static int mock_encode(struct videnc_state *ves, bool update,
if (err)
goto out;
- err = ves->pkth(true, hdr->buf, hdr->end,
+ rtp_ts = video_calc_rtp_timestamp(++ves->pts, ves->fps);
+
+ err = ves->pkth(true, rtp_ts, hdr->buf, hdr->end,
payload, sizeof(payload), ves->arg);
if (err)
goto out;