summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/avcodec/decode.c10
-rw-r--r--modules/avcodec/encode.c2
-rw-r--r--modules/daala/daala.c3
-rw-r--r--modules/daala/decode.c2
-rw-r--r--modules/daala/encode.c17
-rw-r--r--modules/mpa/decode.c11
-rw-r--r--modules/v4l2_codec/v4l2_codec.c12
-rw-r--r--modules/zrtp/module.mk2
8 files changed, 44 insertions, 15 deletions
diff --git a/modules/avcodec/decode.c b/modules/avcodec/decode.c
index affb855..c686a63 100644
--- a/modules/avcodec/decode.c
+++ b/modules/avcodec/decode.c
@@ -7,14 +7,18 @@
#include <rem.h>
#include <baresip.h>
#include <libavcodec/avcodec.h>
+#include <libavutil/avutil.h>
#include <libavutil/mem.h>
+#if LIBAVCODEC_VERSION_INT >= ((53<<16)+(5<<8)+0)
#include <libavutil/pixdesc.h>
+#endif
#include "h26x.h"
#include "avcodec.h"
#if LIBAVUTIL_VERSION_MAJOR < 52
#define AV_PIX_FMT_YUV420P PIX_FMT_YUV420P
+#define AV_PIX_FMT_YUVJ420P PIX_FMT_YUVJ420P
#define AV_PIX_FMT_NV12 PIX_FMT_NV12
#endif
@@ -175,9 +179,11 @@ static int ffdecode(struct viddec_state *st, struct vidframe *frame,
if (got_picture) {
+#if LIBAVCODEC_VERSION_INT >= ((53<<16)+(5<<8)+0)
switch (st->pict->format) {
case AV_PIX_FMT_YUV420P:
+ case AV_PIX_FMT_YUVJ420P:
frame->fmt = VID_FMT_YUV420P;
break;
@@ -188,7 +194,9 @@ static int ffdecode(struct viddec_state *st, struct vidframe *frame,
av_get_pix_fmt_name(st->pict->format));
goto out;
}
-
+#else
+ frame->fmt = VID_FMT_YUV420P;
+#endif
for (i=0; i<4; i++) {
frame->data[i] = st->pict->data[i];
diff --git a/modules/avcodec/encode.c b/modules/avcodec/encode.c
index 0ca635c..620b561 100644
--- a/modules/avcodec/encode.c
+++ b/modules/avcodec/encode.c
@@ -202,9 +202,11 @@ static int open_encoder(struct videnc_state *st,
}
#endif
+#if LIBAVCODEC_VERSION_INT >= ((53<<16)+(5<<8)+0)
st->pict->format = pix_fmt;
st->pict->width = size->w;
st->pict->height = size->h;
+#endif
out:
if (err) {
diff --git a/modules/daala/daala.c b/modules/daala/daala.c
index 130ca59..b5790fa 100644
--- a/modules/daala/daala.c
+++ b/modules/daala/daala.c
@@ -20,6 +20,9 @@
* - Define and implement fragmentation of large packets
* - Define an IETF RTP Payload type
*
+ * External libraries:
+ *
+ * daala version 0.0-1564-g79787c7 (or later)
*
* References:
*
diff --git a/modules/daala/decode.c b/modules/daala/decode.c
index e2217c8..cacd8b5 100644
--- a/modules/daala/decode.c
+++ b/modules/daala/decode.c
@@ -143,7 +143,7 @@ int daala_decode(struct viddec_state *vds, struct vidframe *frame,
}
}
else {
- od_img img;
+ daala_image img;
if (!vds->got_headers) {
warning("daala: decode: still waiting for headers\n");
diff --git a/modules/daala/encode.c b/modules/daala/encode.c
index 7770bd6..d8abe4d 100644
--- a/modules/daala/encode.c
+++ b/modules/daala/encode.c
@@ -130,10 +130,12 @@ static int open_encoder(struct videnc_state *ves, const struct vidsz *size)
daala_comment dc;
daala_packet dp;
int err = 0;
- int complexity = 0;
- int video_q = 10;
+ int complexity = 7;
+ int video_q = 30;
+ int bitrate = ves->bitrate;
- info("daala: open encoder (%d x %d)\n", size->w, size->h);
+ info("daala: open encoder (%d x %d, %d bps)\n",
+ size->w, size->h, bitrate);
if (ves->enc) {
debug("daala: re-opening encoder\n");
@@ -175,6 +177,9 @@ static int open_encoder(struct videnc_state *ves, const struct vidsz *size)
daala_encode_ctl(ves->enc, OD_SET_COMPLEXITY,
&complexity, sizeof(complexity));
+ daala_encode_ctl(ves->enc, OD_SET_BITRATE,
+ &bitrate, sizeof(bitrate));
+
for (;;) {
int r;
@@ -215,7 +220,8 @@ int daala_encode(struct videnc_state *ves, bool update,
const struct vidframe *frame)
{
int r, err = 0;
- od_img img;
+ daala_image img;
+ unsigned i;
(void)update; /* XXX: how to force a KEY-frame? */
if (!ves || !frame || frame->fmt != VID_FMT_YUV420P)
@@ -250,6 +256,9 @@ int daala_encode(struct videnc_state *ves, bool update,
img.planes[2].xstride = 1;
img.planes[2].ystride = frame->linesize[2];
+ for (i=0; i<3; i++)
+ img.planes[i].bitdepth = 8;
+
img.nplanes = 3;
img.width = frame->size.w;
diff --git a/modules/mpa/decode.c b/modules/mpa/decode.c
index b71a335..7dfaccb 100644
--- a/modules/mpa/decode.c
+++ b/modules/mpa/decode.c
@@ -125,9 +125,9 @@ int mpa_decode_frm(struct audec_state *ads, int16_t *sampv, size_t *sampc,
if (!ads || !sampv || !sampc || !buf || len<=4)
return EINVAL;
- if (*(uint32_t*)buf != 0) {
+ if (*(uint32_t*)(void *)buf != 0) {
error("MPA dec header is not zero %08X, not supported yet\n",
- *(uint32_t*)buf);
+ *(uint32_t*)(void *)buf);
return EPROTO;
}
@@ -151,7 +151,8 @@ int mpa_decode_frm(struct audec_state *ads, int16_t *sampv, size_t *sampc,
speex_resampler_destroy(ads->resampler);
if (samplerate != MPA_IORATE) {
ads->resampler = speex_resampler_init(channels,
- (uint32_t)samplerate, MPA_IORATE, 3, &result);
+ (uint32_t)samplerate, MPA_IORATE,
+ 3, &result);
if (result!=RESAMPLER_ERR_SUCCESS
|| ads->resampler==NULL) {
error("MPA dec upsampler failed %d\n",result);
@@ -170,9 +171,9 @@ int mpa_decode_frm(struct audec_state *ads, int16_t *sampv, size_t *sampc,
}
if (ads->resampler) {
- intermediate_len = n / 2 / ads->channels;
+ intermediate_len = (uint32_t)(n / 2 / ads->channels);
/* intermediate_len counts samples per channel */
- out_len = *sampc / 2;
+ out_len = (uint32_t)(*sampc / 2);
result=speex_resampler_process_interleaved_int(
ads->resampler, ads->intermediate_buffer,
diff --git a/modules/v4l2_codec/v4l2_codec.c b/modules/v4l2_codec/v4l2_codec.c
index 08ec746..c32955b 100644
--- a/modules/v4l2_codec/v4l2_codec.c
+++ b/modules/v4l2_codec/v4l2_codec.c
@@ -119,12 +119,16 @@ static int print_caps(int fd, unsigned width, unsigned height)
info(" Formats:\n");
while (0 == xioctl(fd, VIDIOC_ENUM_FMT, &fmtdesc)) {
- bool selected = fmtdesc.pixelformat == V4L2_PIX_FMT_H264;
+ bool selected = false;
strncpy(fourcc, (char *)&fmtdesc.pixelformat, 4);
- if (fmtdesc.pixelformat == V4L2_PIX_FMT_H264)
- support_h264 = true;
+#ifdef V4L2_PIX_FMT_H264
+ if (fmtdesc.pixelformat == V4L2_PIX_FMT_H264) {
+ support_h264 = true;
+ selected = true;
+ }
+#endif
c = fmtdesc.flags & V4L2_FMT_FLAG_COMPRESSED ? 'C' : ' ';
@@ -145,7 +149,9 @@ static int print_caps(int fd, unsigned width, unsigned height)
fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
fmt.fmt.pix.width = width;
fmt.fmt.pix.height = height;
+#ifdef V4L2_PIX_FMT_H264
fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_H264;
+#endif
fmt.fmt.pix.field = V4L2_FIELD_NONE;
if (-1 == xioctl(fd, VIDIOC_S_FMT, &fmt)) {
diff --git a/modules/zrtp/module.mk b/modules/zrtp/module.mk
index 6590571..5670b98 100644
--- a/modules/zrtp/module.mk
+++ b/modules/zrtp/module.mk
@@ -7,7 +7,7 @@
MOD := zrtp
$(MOD)_SRCS += zrtp.c
$(MOD)_LFLAGS += -lzrtp -lbn
-$(MOD)_CFLAGS += -I/usr/local/include/libzrtp
+$(MOD)_CFLAGS += -isystem /usr/local/include/libzrtp
$(MOD)_CFLAGS += -Wno-strict-prototypes
include mk/mod.mk