2
0
mirror of synced 2025-02-23 23:08:14 +00:00

15 Commits

Author SHA1 Message Date
Burcu Dogan
bf1596d2ef audio/al: destroy the internal context while finalizing Context
The necessity to destroy an ALC context is not to leave a leaking
context as Context instances are being collected. If the user doesn't
Destroy, do it when finalizing. If a context is destroyed by the user,
a finalizer is no more needed.

Change-Id: If6330361f7983ec8ede0e93b7f6e3a440de9fd6c
Reviewed-on: https://go-review.googlesource.com/8497
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-04-07 15:24:13 +00:00
Burcu Dogan
6544820032 audio/al: don't define MakeContextCurrent on the pointer
It's a common requirement to call MakeContextCurrent with a nil value
before destroying a context. Nil value as a reciever is not as user-
friendly as a standalone MakeContextCurrent.

Change-Id: I537ec0330657ef134f97a3c3b0d32793012eee86
Reviewed-on: https://go-review.googlesource.com/8500
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-04-06 22:23:13 +00:00
Burcu Dogan
c2bf90dc60 audio/al: add bindings for alcDestroyContext
Fixes #10330.

Change-Id: Ib5c379593ac4afef11b465773f6373dd5775ce98
Reviewed-on: https://go-review.googlesource.com/8492
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-04-06 16:20:40 +00:00
Burcu Dogan
6ed9b243b1 mobile/audio: use AL_TRUE and ALC_TRUE
Change-Id: I8c1a3e72f06a02c18bff3a348e86e78040007867
Reviewed-on: https://go-review.googlesource.com/7770
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-03-18 20:10:10 +00:00
Burcu Dogan
33ee14d530 mobile/audio: add instructions how to install OpenAL on Linux desktop
Change-Id: I47b42db1443040bcd9c77cd1d19a0e0f8c5119ec
Reviewed-on: https://go-review.googlesource.com/7090
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-03-07 01:01:31 +00:00
David Crawshaw
c30f429855 audio/al: replace strcat with strlcat
Comment from golang.org/cl/6642. As bionic (surprisingly) has strlcat,
using it instead of strncat. If you're not familiar with the l-variants,
see http://www.sudo.ws/todd/papers/strlcpy.html

Change-Id: I69958ee99917903f9d10dda0ec99111c4793db71
Reviewed-on: https://go-review.googlesource.com/7011
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-03-06 17:18:06 +00:00
Burcu Dogan
c94142eb97 mobile/audio: add android support
Due to licensing limitations, OpenAL should be dynamically
loaded. Android apps that needs to import the audio package
needs to be packed with libopenal.so as an extenal lib
dependency.

Instructions to build OpenAL for Android is available at
http://repo.or.cz/w/openal-soft.git/blob/HEAD:/XCompile-Android.txt

The packed libopenal.so is exported to
/data/data/<package_name>/lib/libopenal.so at installation.
The audio package dlopens libopenal.so from this location and
dlsym to dispatch the OpenAL functions.

Change-Id: I7aa36bb8dd0ae8e101ae4aa5366c3d426b2569a9
Reviewed-on: https://go-review.googlesource.com/6642
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-03-04 18:58:40 +00:00
Burcu Dogan
a49d80e2cf audio/al: make MakeCurrentContext a method of Context
There is no good reason for MakeCurrentContext to be a standalone
function since we don't allow nil contextes to be the current.

Change-Id: I4483c30a2ed78262b67c96e73739188a22f685b9
Reviewed-on: https://go-review.googlesource.com/6640
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-03-03 18:09:34 +00:00
Burcu Dogan
b7c27d1a66 mobile/audio: reorg the package to allow multiple implementations of bindings
Change-Id: I68dcc392b0ae7c539c12c6306d9b312d02603b5b
Reviewed-on: https://go-review.googlesource.com/6570
Reviewed-by: Nigel Tao <nigeltao@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-03-03 17:53:35 +00:00
Nigel Tao
fc5f7c74c8 audio: use int constants (C style enums) instead of string.
Change-Id: Ifb6db04c4bbf6c66e5a63dcaeee704ab02e711b0
Reviewed-on: https://go-review.googlesource.com/6423
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-03-03 00:02:05 +00:00
Nigel Tao
333098d850 audio: build on linux, not just darwin.
Change-Id: Ie10c29012bf6769591a1ad1c1e9ee322d780608e
Reviewed-on: https://go-review.googlesource.com/6392
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-03-02 00:52:08 +00:00
Burcu Dogan
7b45e52f8c mobile/audio: avoid locks during IO and fix seek precision
Change-Id: Ida8d07f87fe118094bc36c6be5c576fd0999abdf
Reviewed-on: https://go-review.googlesource.com/6080
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2015-02-27 04:52:35 +00:00
Hyang-Ah Hana Kim
25b15a705f audio: skip build for non-darwin.
Change-Id: If382b517a21b90412ced3bfa543575055df8de3a
Reviewed-on: https://go-review.googlesource.com/5510
Reviewed-by: Burcu Dogan <jbd@google.com>
2015-02-20 23:43:34 +00:00
Burcu Dogan
7e40b31538 mobile/audio: add a basic audio player
Fixes #9551.

Change-Id: I83311afc2d2fd67a883c70d83c6a498d9e033f2c
Reviewed-on: https://go-review.googlesource.com/3262
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-02-12 17:24:23 +00:00
Burcu Dogan
c67709898b mobile/audio: adding OpenAL bindings
The bindings are not working on Android currently. We may require
the users to build their own OpenAL library that is targetting
Android or may distribute a shared object.

Change-Id: Ibcfa3482aa53e9b3ec9bfddf5dd1622ad07b7b7e
Reviewed-on: https://go-review.googlesource.com/3115
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-02-04 14:48:47 +00:00