summaryrefslogtreecommitdiff
path: root/www/iridium/files/sndio_output.cc
diff options
context:
space:
mode:
authorRene Ladan <rene@FreeBSD.org>2021-01-01 00:57:23 +0000
committerRene Ladan <rene@FreeBSD.org>2021-01-01 00:57:23 +0000
commite095f78463023f59c04bdd21ffc95fada557410f (patch)
treeec5de6499c9c252b774be9acb5c807082d084bd2 /www/iridium/files/sndio_output.cc
parentNew port, misc/timezonemap (diff)
Remove most expired ports that depend on Python 2.7:
Exceptions are: - mail/mailman, our listservers still use it - www/chromium, solely because of popular demand, upstream is (slowly) working on porting it to Python 3 - ports that have actual patches for Python 3 against them (Cinnamon and a few unrelated other ports) - llvm70 and qt5-webengine because they seem to have a lot of dependencies which need further analysis - sysutils/uefi-edk2-bhyve because bhyve seems to use them - python2 and python27 themselves I'm sure there will be complaints, but the nice thing about a version control system is that we can revert and adjust things. 2020-12-31 audio/ardour: Uses Python 2.7 version of scons, and Python 2.7 which is EOLed upstream 2020-12-31 audio/mixxx21: Uses Python 2.7 version of scons, and Python 2.7 which is EOLed upstream 2020-12-31 audio/xmms2: Uses Python 2.7 which is EOLed upstream 2020-12-31 chinese/sunpinyin: Uses Python 2.7 which is EOLed upstream 2020-12-31 databases/arangodb32: Uses Python 2.7 which is EOLed upstream 2020-12-31 databases/arangodb33: Uses Python 2.7 which is EOLed upstream 2020-12-31 devel/bzr: Uses Python 2.7 which is EOLed upstream 2020-12-31 devel/chromium-gn: Uses deprecated version of python, use devel/gn instead 2020-12-31 devel/electron4: Uses Python 2.7 which is EOLed upstream 2020-12-31 devel/electron5: Uses Python 2.7 which is EOLed upstream 2020-12-31 devel/electron6: Uses Python 2.7 which is EOLed upstream 2020-12-31 devel/electron7: Uses Python 2.7 which is EOLed upstream 2020-12-31 devel/gnatpython: Uses Python 2.7 which is EOLed upstream 2020-12-31 devel/godot2: Uses Python 2.7 version of scons, and Python 2.7 which is EOLed upstream 2020-12-31 devel/godot2-tools: Uses Python 2.7 version of scons, and Python 2.7 which is EOLed upstream 2020-12-31 devel/libhid: Uses Python 2.7 which is EOLed upstream 2020-12-31 devel/libosmocore: Uses Python 2.7 which is EOLed upstream 2020-12-31 devel/llvm60: Uses Python 2.7 which is EOLed upstream 2020-12-31 devel/mongo-cxx-driver: Uses Python 2.7 version of scons, and Python 2.7 which is EOLed upstream 2020-06-30 devel/p5-Log-Any-Adapter-Callback: Use devel/p5-Log-Any (Log::Any::Adapter::Capture) instead 2020-12-31 devel/py-backports.functools_lru_cache: Uses Python 2.7 which is EOLed upstream 2020-12-31 devel/py-backports.os: Python 2 is EOL upstream 2020-12-31 devel/py-backports.shutil_get_terminal_size: Python 2 is EOL upstream 2020-12-31 devel/py-backports_abc: Uses Python 2.7 which is EOLed upstream 2020-12-31 devel/py-cheetah: Uses Python 2.7 which is EOLed upstream 2020-12-31 devel/py-dis3: Python 2 only, backport of Python 3 2020-12-31 devel/py-enum34: Will be removed along with python27 2020-12-31 devel/py-functools32: Python 2 only, backport of Python 3 2020-12-31 devel/py-futures: Uses Python 2.7 which is EOLed upstream 2020-12-31 devel/py-more-itertools5: Uses Python 2.7 which is EOLed upstream 2020-12-31 devel/py-pathlib: Uses Python 2.7 which is EOLed upstream 2020-12-31 devel/py-selectors2: Python 2 is EOL upstream 2020-12-31 devel/py-should_dsl: Uses Python 2.7 which is EOLed upstream 2020-12-31 devel/py-singledispatch: Uses Python 2.7 which is EOLed upstream 2020-12-31 devel/py-subprocess32: Python 2 only, following EOL of lang/python27 2020-12-31 devel/py-total-ordering: Uses Python 2.7 which is EOLed upstream 2020-12-31 devel/py-typing: Python 2 only, backport of Python 3 2020-12-31 devel/py-weakrefmethod: Python 2 only, backport of Python 3 2020-12-31 devel/rbtools: Uses Python 2.7 which is EOLed upstream 2020-12-31 devel/subversion-lts: Uses Python 2.7 which is EOLed upstream 2020-12-31 devel/viewvc: Uses Python 2.7 which is EOLed upstream 2020-12-31 dns/py-dns: Uses Python 2.7 which is EOLed upstream 2020-12-31 editors/atom: Uses Python 2.7 which is EOLed upstream 2020-12-31 emulators/fceux: Uses Python 2.7 version of scons, and Python 2.7 which is EOLed upstream 2020-12-31 emulators/gem5: Uses Python 2.7 version of scons, and Python 2.7 which is EOLed upstream 2020-12-31 emulators/nonpareil: Uses Python 2.7 version of scons, and Python 2.7 which is EOLed upstream 2020-12-31 games/0ad: Uses deprecated version of python 2020-12-31 games/dangerdeep: Uses Python 2.7 version of scons, and Python 2.7 which is EOLed upstream 2020-12-31 games/freera: Uses Python 2.7 version of scons, and Python 2.7 which is EOLed upstream 2020-12-31 games/glob2: Uses Python 2.7 version of scons, and Python 2.7 which is EOLed upstream 2020-12-31 games/marsnomercy: Uses Python 2.7 version of scons, and Python 2.7 which is EOLed upstream 2020-12-31 games/netpanzer: Uses Python 2.7 version of scons, and Python 2.7 which is EOLed upstream 2020-12-31 games/pingus: Uses Python 2.7 version of scons, and Python 2.7 which is EOLed upstream 2020-12-31 games/renpy: Uses deprecated version of python 2020-12-31 graphics/goxel: Uses Python 2.7 version of scons, and Python 2.7 which is EOLed upstream 2020-12-31 graphics/py-pillow6: Uses Python 2.7 which is EOLed upstream 2020-12-31 graphics/sk1libs: Uses Python 2.7 which is EOLed upstream 2020-12-31 graphics/uniconvertor: Uses deprecated version of python 2020-12-31 lang/julia10: Uses Python 2.7 which is EOLed upstream 2020-12-31 lang/pypy: Uses Python 2.7 which is EOLed upstream 2020-12-31 lang/pypy3: Uses Python 2.7 which is EOLed upstream 2020-12-31 lang/spidermonkey185: Uses Python 2.7 which is EOLed upstream 2020-12-31 lang/spidermonkey24: Uses Python 2.7 which is EOLed upstream 2020-12-31 lang/spidermonkey52: Uses Python 2.7 which is EOLed upstream 2020-12-31 lang/spidermonkey60: Requires python2 to build 2020-12-31 lang/tolua++: Uses Python 2.7 version of scons, and Python 2.7 which is EOLed upstream 2020-12-31 mail/getmail: Uses deprecated version of python 2020-12-31 math/gringo: Uses Python 2.7 which is EOLed upstream 2020-12-31 multimedia/ffmpeg2theora: Uses Python 2.7 version of scons, and Python 2.7 which is EOLed upstream 2020-12-31 multimedia/mimms: Uses Python 2.7 which is EOLed upstream 2020-12-31 net/py-ipaddress: Uses Python 2.7 which is EOLed upstream 2020-12-31 net-p2p/linuxdcpp: Uses Python 2.7 version of scons, and Python 2.7 which is EOLed upstream 2020-12-31 security/broccoli: Depends lang/python27 which is EOLed upstream 2020-12-31 security/orthrus: Uses Python 2.7 version of scons, and Python 2.7 which is EOLed upstream 2020-12-31 security/py-backports.ssl_match_hostname: Uses Python 2.7 which is EOLed upstream 2020-12-31 security/sandsifter: Uses deprecated version of python, see https://github.com/rigred/sandsifter/issues/10 2020-12-31 sysutils/cinnamon-control-center: Uses Python 2.7 which is EOLed upstream 2020-12-31 sysutils/ori: Uses Python 2.7 version of scons, and Python 2.7 which is EOLed upstream 2020-12-31 sysutils/osquery: Uses Python 2.7 which is EOLed upstream 2020-12-31 sysutils/py-shutilwhich: Python 2 only, backport of Python 3 2020-12-31 sysutils/uefi-edk2-bhyve-csm: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/cliqz: Uses deprecated version of python 2020-12-31 www/iridium: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/moinmoin: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/node10: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/node12: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-OhlohWidgetsMacro: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-TracGoogleAnalytics: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-accountmanager: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-advancedticketworkflow: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-autocomplete: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-ccselector: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-customfieldadmin: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-datefield: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-defaultcc: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-devel: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-discussion: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-downloads: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-email2trac: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-email2trac-postfix: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-estimator: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-fivestarvote: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-fullblog: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-fullblognotification: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-graphviz: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-iniadmin: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-keywords: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-keywordsecretticket: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-ldap: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-ldapauthstore: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-math: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-mercurial: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-navadd: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-permredirect: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-privatetickets: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-pydotorgtheme: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-scrumburndown: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-spam-filter: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-subtickets: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-tags: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-themeengine: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-ticketimport: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-tickettemplate: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-timingandestimation: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-tocmacro: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-tweakui: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-vote: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-wikigoodies: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-wikinotification: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-wikitemplates: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-wikitopdf: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-wysiwyg: Uses Python 2.7 which is EOLed upstream 2020-12-31 www/trac-xmlrpc: Uses Python 2.7 which is EOLed upstream
Diffstat (limited to '')
-rw-r--r--www/iridium/files/sndio_output.cc183
1 files changed, 0 insertions, 183 deletions
diff --git a/www/iridium/files/sndio_output.cc b/www/iridium/files/sndio_output.cc
deleted file mode 100644
index a6719f9aac8d..000000000000
--- a/www/iridium/files/sndio_output.cc
+++ /dev/null
@@ -1,183 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/logging.h"
-#include "base/time/time.h"
-#include "base/time/default_tick_clock.h"
-#include "media/audio/audio_manager_base.h"
-#include "media/base/audio_timestamp_helper.h"
-#include "media/audio/sndio/sndio_output.h"
-
-namespace media {
-
-static const SampleFormat kSampleFormat = kSampleFormatS16;
-
-void SndioAudioOutputStream::OnMoveCallback(void *arg, int delta) {
- SndioAudioOutputStream* self = static_cast<SndioAudioOutputStream*>(arg);
-
- self->hw_delay -= delta;
-}
-
-void SndioAudioOutputStream::OnVolCallback(void *arg, unsigned int vol) {
- SndioAudioOutputStream* self = static_cast<SndioAudioOutputStream*>(arg);
-
- self->vol = vol;
-}
-
-void *SndioAudioOutputStream::ThreadEntry(void *arg) {
- SndioAudioOutputStream* self = static_cast<SndioAudioOutputStream*>(arg);
-
- self->ThreadLoop();
- return NULL;
-}
-
-SndioAudioOutputStream::SndioAudioOutputStream(const AudioParameters& params,
- AudioManagerBase* manager)
- : manager(manager),
- params(params),
- audio_bus(AudioBus::Create(params)),
- state(kClosed),
- mutex(PTHREAD_MUTEX_INITIALIZER) {
-}
-
-SndioAudioOutputStream::~SndioAudioOutputStream() {
- if (state != kClosed)
- Close();
-}
-
-bool SndioAudioOutputStream::Open() {
- struct sio_par par;
- int sig;
-
- if (params.format() != AudioParameters::AUDIO_PCM_LINEAR &&
- params.format() != AudioParameters::AUDIO_PCM_LOW_LATENCY) {
- LOG(WARNING) << "Unsupported audio format.";
- return false;
- }
- sio_initpar(&par);
- par.rate = params.sample_rate();
- par.pchan = params.channels();
- par.bits = SampleFormatToBitsPerChannel(kSampleFormat);
- par.bps = par.bits / 8;
- par.sig = sig = par.bits != 8 ? 1 : 0;
- par.le = SIO_LE_NATIVE;
- par.appbufsz = params.frames_per_buffer();
-
- hdl = sio_open(SIO_DEVANY, SIO_PLAY, 0);
- if (hdl == NULL) {
- LOG(ERROR) << "Couldn't open audio device.";
- return false;
- }
- if (!sio_setpar(hdl, &par) || !sio_getpar(hdl, &par)) {
- LOG(ERROR) << "Couldn't set audio parameters.";
- goto bad_close;
- }
- if (par.rate != (unsigned int)params.sample_rate() ||
- par.pchan != (unsigned int)params.channels() ||
- par.bits != (unsigned int)SampleFormatToBitsPerChannel(kSampleFormat) ||
- par.sig != (unsigned int)sig ||
- (par.bps > 1 && par.le != SIO_LE_NATIVE) ||
- (par.bits != par.bps * 8)) {
- LOG(ERROR) << "Unsupported audio parameters.";
- goto bad_close;
- }
- state = kStopped;
- volpending = 0;
- vol = 0;
- buffer = new char[audio_bus->frames() * params.GetBytesPerFrame(kSampleFormat)];
- sio_onmove(hdl, &OnMoveCallback, this);
- sio_onvol(hdl, &OnVolCallback, this);
- return true;
- bad_close:
- sio_close(hdl);
- return false;
-}
-
-void SndioAudioOutputStream::Close() {
- if (state == kClosed)
- return;
- if (state == kRunning)
- Stop();
- state = kClosed;
- delete [] buffer;
- sio_close(hdl);
- manager->ReleaseOutputStream(this); // Calls the destructor
-}
-
-void SndioAudioOutputStream::Start(AudioSourceCallback* callback) {
- state = kRunning;
- hw_delay = 0;
- source = callback;
- sio_start(hdl);
- if (pthread_create(&thread, NULL, &ThreadEntry, this) != 0) {
- LOG(ERROR) << "Failed to create real-time thread.";
- sio_stop(hdl);
- state = kStopped;
- }
-}
-
-void SndioAudioOutputStream::Stop() {
- if (state == kStopped)
- return;
- state = kStopWait;
- pthread_join(thread, NULL);
- sio_stop(hdl);
- state = kStopped;
-}
-
-void SndioAudioOutputStream::SetVolume(double v) {
- pthread_mutex_lock(&mutex);
- vol = v * SIO_MAXVOL;
- volpending = 1;
- pthread_mutex_unlock(&mutex);
-}
-
-void SndioAudioOutputStream::GetVolume(double* v) {
- pthread_mutex_lock(&mutex);
- *v = vol * (1. / SIO_MAXVOL);
- pthread_mutex_unlock(&mutex);
-}
-
-// This stream is always used with sub second buffer sizes, where it's
-// sufficient to simply always flush upon Start().
-void SndioAudioOutputStream::Flush() {}
-
-void SndioAudioOutputStream::ThreadLoop(void) {
- int avail, count, result;
-
- while (state == kRunning) {
- // Update volume if needed
- pthread_mutex_lock(&mutex);
- if (volpending) {
- volpending = 0;
- sio_setvol(hdl, vol);
- }
- pthread_mutex_unlock(&mutex);
-
- // Get data to play
- const base::TimeDelta delay = AudioTimestampHelper::FramesToTime(hw_delay,
- params.sample_rate());
- count = source->OnMoreData(delay, base::TimeTicks::Now(), 0, audio_bus.get());
- audio_bus->ToInterleaved(count, SampleFormatToBytesPerChannel(kSampleFormat), buffer);
- if (count == 0) {
- // We have to submit something to the device
- count = audio_bus->frames();
- memset(buffer, 0, count * params.GetBytesPerFrame(kSampleFormat));
- LOG(WARNING) << "No data to play, running empty cycle.";
- }
-
- // Submit data to the device
- avail = count * params.GetBytesPerFrame(kSampleFormat);
- result = sio_write(hdl, buffer, avail);
- if (result == 0) {
- LOG(WARNING) << "Audio device disconnected.";
- break;
- }
-
- // Update hardware pointer
- hw_delay += count;
- }
-}
-
-} // namespace media