diff options
author | Alfred E. Heggestad <aeh@db.org> | 2015-06-27 10:13:09 +0200 |
---|---|---|
committer | Alfred E. Heggestad <aeh@db.org> | 2015-06-27 10:13:09 +0200 |
commit | 4172027f214d50348e3fc029e068e8bb4a140deb (patch) | |
tree | 14a9ef65adda898cfefd059d3fdcacbca7d87daf /modules/gst_video | |
parent | f8873153be5480ca6b79741e7cbdf667080e562d (diff) |
vidcodec: move packet-handler to encode_update
Diffstat (limited to 'modules/gst_video')
-rw-r--r-- | modules/gst_video/encode.c | 13 | ||||
-rw-r--r-- | modules/gst_video/gst_video.h | 6 |
2 files changed, 9 insertions, 10 deletions
diff --git a/modules/gst_video/encode.c b/modules/gst_video/encode.c index 50b9e48..948b98a 100644 --- a/modules/gst_video/encode.c +++ b/modules/gst_video/encode.c @@ -430,7 +430,8 @@ static void param_handler(const struct pl *name, const struct pl *val, int gst_video_encode_update(struct videnc_state **vesp, const struct vidcodec *vc, - struct videnc_param *prm, const char *fmtp) + struct videnc_param *prm, const char *fmtp, + videnc_packet_h *pkth, void *arg) { struct videnc_state *ves; int err = 0; @@ -467,6 +468,8 @@ int gst_video_encode_update(struct videnc_state **vesp, ves->bitrate = prm->bitrate; ves->pktsize = prm->pktsize; ves->fps = prm->fps; + ves->pkth = pkth; + ves->pkth_arg = arg; info("gst_video: video encoder %s: %d fps, %d bit/s, pktsize=%u\n", vc->name, prm->fps, prm->bitrate, prm->pktsize); @@ -476,15 +479,14 @@ int gst_video_encode_update(struct videnc_state **vesp, int gst_video_encode(struct videnc_state *st, bool update, - const struct vidframe *frame, - videnc_packet_h *pkth, void *arg) + const struct vidframe *frame) { uint8_t *data; size_t size; int height; int err; - if (!st || !frame || !pkth || frame->fmt != VID_FMT_YUV420P) + if (!st || !frame || frame->fmt != VID_FMT_YUV420P) return EINVAL; if (!st->gst_inited || !vidsz_cmp(&st->size, &frame->size)) { @@ -497,9 +499,6 @@ int gst_video_encode(struct videnc_state *st, bool update, return err; } - st->pkth = pkth; - st->pkth_arg = arg; - /* To detect if requested size was changed. */ st->size = frame->size; } diff --git a/modules/gst_video/gst_video.h b/modules/gst_video/gst_video.h index b77e979..16817e1 100644 --- a/modules/gst_video/gst_video.h +++ b/modules/gst_video/gst_video.h @@ -11,10 +11,10 @@ struct videnc_state; int gst_video_encode_update(struct videnc_state **vesp, const struct vidcodec *vc, - struct videnc_param *prm, const char *fmtp); + struct videnc_param *prm, const char *fmtp, + videnc_packet_h *pkth, void *arg); int gst_video_encode(struct videnc_state *st, bool update, - const struct vidframe *frame, - videnc_packet_h *pkth, void *arg); + const struct vidframe *frame); /* SDP */ |