summaryrefslogtreecommitdiff
path: root/modules/v4l2
diff options
context:
space:
mode:
authorAlfred E. Heggestad <aeh@db.org>2015-06-20 10:01:35 +0200
committerAlfred E. Heggestad <aeh@db.org>2015-06-20 10:01:35 +0200
commiteb6b9567bbcd400773e7801f60dd34b92edace31 (patch)
treeeb3f419966f7bc25e506f823b90680cd52425125 /modules/v4l2
parent92f52bf6180f03d0d148cd4db15e07dfb97a5d53 (diff)
vidsrc: use const pointer to base-class
Diffstat (limited to 'modules/v4l2')
-rw-r--r--modules/v4l2/v4l2.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/modules/v4l2/v4l2.c b/modules/v4l2/v4l2.c
index c02cbb4..856e07d 100644
--- a/modules/v4l2/v4l2.c
+++ b/modules/v4l2/v4l2.c
@@ -42,7 +42,7 @@ struct buffer {
};
struct vidsrc_st {
- struct vidsrc *vs; /* inheritance */
+ const struct vidsrc *vs; /* inheritance */
int fd;
pthread_t thread;
@@ -402,8 +402,6 @@ static void destructor(void *arg)
if (st->fd >= 0)
v4l2_close(st->fd);
-
- mem_deref(st->vs);
}
@@ -423,7 +421,7 @@ static void *read_thread(void *arg)
}
-static int alloc(struct vidsrc_st **stp, struct vidsrc *vs,
+static int alloc(struct vidsrc_st **stp, const struct vidsrc *vs,
struct media_ctx **ctx, struct vidsrc_prm *prm,
const struct vidsz *size, const char *fmt,
const char *dev, vidsrc_frame_h *frameh,
@@ -447,7 +445,7 @@ static int alloc(struct vidsrc_st **stp, struct vidsrc *vs,
if (!st)
return ENOMEM;
- st->vs = mem_ref(vs);
+ st->vs = vs;
st->fd = -1;
st->sz = *size;
st->frameh = frameh;