Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds alsa audio input to analog cards. Fixes #3405
factors the audio device handling code out of NuppelVideoRecorder into a AudioInput class with OSS and new ALSA implementation. based on patches by: Alan Calvert, Anand K. Mistry and Daniel Kristjansson git-svn-id: http://svn.mythtv.org/svn/trunk@21448 7dbf422c-18fa-0310-86e9-fd20926502f2
- Loading branch information
Showing
10 changed files
with
932 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* Copyright (C) 2007 Anand K. Mistry | ||
* Copyright (C) 2008 Alan Calvert | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version 2 | ||
* of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
* 02110-1301, USA. | ||
*/ | ||
|
||
#include "mythcontext.h" | ||
#include "mythconfig.h" | ||
#include "audioinput.h" | ||
#include "audioinputoss.h" | ||
#include "audioinputalsa.h" | ||
|
||
#define LOC QString("AudioIn: ") | ||
#define LOC_ERR QString("AudioIn Error: ") | ||
|
||
AudioInput::AudioInput(const QString &device) | ||
{ | ||
m_audio_device = QByteArray(device.toAscii()); | ||
m_audio_channels = 0; | ||
m_audio_sample_bits = 0; | ||
m_audio_sample_rate = 0; | ||
} | ||
|
||
AudioInput *AudioInput::CreateDevice(const QByteArray &device) | ||
{ | ||
AudioInput *audio = NULL; | ||
if (CONFIG_AUDIO_OSS && device.startsWith("/")) | ||
{ | ||
audio = new AudioInputOSS(device); | ||
} | ||
else if (CONFIG_AUDIO_ALSA && device.startsWith("ALSA:")) | ||
{ | ||
audio = new AudioInputALSA(device); | ||
} | ||
else if (device == "NULL") | ||
{ | ||
VERBOSE(VB_GENERAL, LOC + "creating NULL audio device"); | ||
} | ||
else | ||
{ | ||
VERBOSE(VB_IMPORTANT, LOC_ERR + "unknown or unsupported audio input " | ||
"device '" + device + "'"); | ||
} | ||
|
||
return audio; | ||
} | ||
/* vim: set expandtab tabstop=4 shiftwidth=4: */ |
Oops, something went wrong.