From 7a3f16da1c3847f068b873c1ad8c0bee3c9ac3aa Mon Sep 17 00:00:00 2001 From: "Alfred E. Heggestad" Date: Wed, 17 Jun 2015 09:19:54 +0200 Subject: upgrade opensles module --- modules/opensles/opensles.c | 9 ++++++++- modules/opensles/opensles.h | 4 ++-- modules/opensles/player.c | 8 +++----- modules/opensles/recorder.c | 8 +++----- 4 files changed, 16 insertions(+), 13 deletions(-) (limited to 'modules/opensles') diff --git a/modules/opensles/opensles.c b/modules/opensles/opensles.c index 665288c..055f051 100644 --- a/modules/opensles/opensles.c +++ b/modules/opensles/opensles.c @@ -1,7 +1,7 @@ /** * @file opensles.c OpenSLES audio driver * - * Copyright (C) 2010 Creytiv.com + * Copyright (C) 2010 - 2015 Creytiv.com */ #include #include @@ -10,6 +10,13 @@ #include "opensles.h" +/** + * @defgroup opensles opensles + * + * Audio driver module for Android OpenSLES + */ + + SLObjectItf engineObject = NULL; SLEngineItf engineEngine; diff --git a/modules/opensles/opensles.h b/modules/opensles/opensles.h index 2970413..a3641e7 100644 --- a/modules/opensles/opensles.h +++ b/modules/opensles/opensles.h @@ -9,10 +9,10 @@ extern SLObjectItf engineObject; extern SLEngineItf engineEngine; -int opensles_player_alloc(struct auplay_st **stp, struct auplay *ap, +int opensles_player_alloc(struct auplay_st **stp, const struct auplay *ap, struct auplay_prm *prm, const char *device, auplay_write_h *wh, void *arg); -int opensles_recorder_alloc(struct ausrc_st **stp, struct ausrc *as, +int opensles_recorder_alloc(struct ausrc_st **stp, const struct ausrc *as, struct media_ctx **ctx, struct ausrc_prm *prm, const char *device, ausrc_read_h *rh, ausrc_error_h *errh, void *arg); diff --git a/modules/opensles/player.c b/modules/opensles/player.c index 797ae48..755ae4f 100644 --- a/modules/opensles/player.c +++ b/modules/opensles/player.c @@ -15,7 +15,7 @@ struct auplay_st { - struct auplay *ap; /* inheritance */ + const struct auplay *ap; /* inheritance */ auplay_write_h *wh; void *arg; int16_t *sampv[N_PLAY_QUEUE_BUFFERS]; @@ -43,8 +43,6 @@ static void auplay_destructor(void *arg) for (int i=0; isampv[i]); } - - mem_deref(st->ap); } @@ -141,7 +139,7 @@ static int createPlayer(struct auplay_st *st, struct auplay_prm *prm) } -int opensles_player_alloc(struct auplay_st **stp, struct auplay *ap, +int opensles_player_alloc(struct auplay_st **stp, const struct auplay *ap, struct auplay_prm *prm, const char *device, auplay_write_h *wh, void *arg) { @@ -156,7 +154,7 @@ int opensles_player_alloc(struct auplay_st **stp, struct auplay *ap, if (!st) return ENOMEM; - st->ap = mem_ref(ap); + st->ap = ap; st->wh = wh; st->arg = arg; diff --git a/modules/opensles/recorder.c b/modules/opensles/recorder.c index 48af5c0..5d4c622 100644 --- a/modules/opensles/recorder.c +++ b/modules/opensles/recorder.c @@ -16,7 +16,7 @@ struct ausrc_st { - struct ausrc *as; /* inheritance */ + const struct ausrc *as; /* inheritance */ int16_t *sampv[N_REC_QUEUE_BUFFERS]; size_t sampc; @@ -47,8 +47,6 @@ static void ausrc_destructor(void *arg) for (int i=0; isampv[i]); } - - mem_deref(st->as); } @@ -150,7 +148,7 @@ static int startRecording(struct ausrc_st *st) } -int opensles_recorder_alloc(struct ausrc_st **stp, struct ausrc *as, +int opensles_recorder_alloc(struct ausrc_st **stp, const struct ausrc *as, struct media_ctx **ctx, struct ausrc_prm *prm, const char *device, ausrc_read_h *rh, ausrc_error_h *errh, void *arg) @@ -168,7 +166,7 @@ int opensles_recorder_alloc(struct ausrc_st **stp, struct ausrc *as, if (!st) return ENOMEM; - st->as = mem_ref(as); + st->as = as; st->rh = rh; st->arg = arg; -- cgit v1.2.3