summaryrefslogtreecommitdiff
path: root/modules/vp8
diff options
context:
space:
mode:
authorAlfred E. Heggestad <alfred.heggestad@gmail.com>2016-11-05 17:57:06 +0100
committerAlfred E. Heggestad <alfred.heggestad@gmail.com>2016-11-05 17:57:06 +0100
commitbb07940c90781d1b3e9f6607926aeec009d42f2d (patch)
tree292ff43af3eee4dee37835c1fed6102e919ffbe9 /modules/vp8
parent0a03c6f08cacb416f216c77550a6480d0b3f0898 (diff)
vp8: check macros VPX_CODEC_USE_OUTPUT_PARTITION and VPX_FRAME_IS_FRAGMENT
Diffstat (limited to 'modules/vp8')
-rw-r--r--modules/vp8/encode.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/vp8/encode.c b/modules/vp8/encode.c
index befbb05..99560de 100644
--- a/modules/vp8/encode.c
+++ b/modules/vp8/encode.c
@@ -92,6 +92,7 @@ static int open_encoder(struct videnc_state *ves, const struct vidsz *size)
{
vpx_codec_enc_cfg_t cfg;
vpx_codec_err_t res;
+ vpx_codec_flags_t flags = 0;
res = vpx_codec_enc_config_default(&vpx_codec_vp8_cx_algo, &cfg, 0);
if (res)
@@ -117,8 +118,12 @@ static int open_encoder(struct videnc_state *ves, const struct vidsz *size)
ves->ctxup = false;
}
+#ifdef VPX_CODEC_USE_OUTPUT_PARTITION
+ flags |= VPX_CODEC_USE_OUTPUT_PARTITION;
+#endif
+
res = vpx_codec_enc_init(&ves->ctx, &vpx_codec_vp8_cx_algo, &cfg,
- VPX_CODEC_USE_OUTPUT_PARTITION);
+ flags);
if (res) {
warning("vp8: enc init: %s\n", vpx_codec_err_to_string(res));
return EPROTO;
@@ -240,11 +245,13 @@ int vp8_encode(struct videnc_state *ves, bool update,
if (pkt->data.frame.flags & VPX_FRAME_IS_KEY)
keyframe = true;
+#ifdef VPX_FRAME_IS_FRAGMENT
if (pkt->data.frame.flags & VPX_FRAME_IS_FRAGMENT)
marker = false;
if (pkt->data.frame.partition_id >= 0)
partid = pkt->data.frame.partition_id;
+#endif
err = packetize(marker,
pkt->data.frame.buf,