#include "rdesktop.h"
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <sys/audioio.h>
Go to the source code of this file.
◆ MAX_QUEUE
◆ wave_out_close()
Definition at line 76 of file rdpsnd_sun.c.
77{
78
80 {
84 }
85
86#if defined I_FLUSH && defined FLUSHW
87
89#endif
90#if defined AUDIO_FLUSH
92#endif
94}
void rdpsnd_send_completion(RDPCLIENT *This, uint16 tick, uint8 packet_index)
static unsigned int queue_lo
static unsigned int queue_hi
static struct audio_packet packet_queue[MAX_QUEUE]
◆ wave_out_format_supported()
◆ wave_out_open()
Definition at line 51 of file rdpsnd_sun.c.
52{
53 char *dsp_dev =
getenv(
"AUDIODEV");
54
56 {
57 dsp_dev =
xstrdup(
"/dev/audio");
58 }
59
61 {
64 }
65
66
68
71
73}
char * xstrdup(const char *s)
_CRTIMP void __cdecl perror(_In_opt_z_ const char *_ErrMsg)
_Check_return_ char *__cdecl getenv(_In_z_ const char *_VarName)
◆ wave_out_play()
Definition at line 222 of file rdpsnd_sun.c.
223{
232 static uint32 samplecnt = 0;
234
235 while (1)
236 {
238 {
239
240 samplecnt = 0;
242 sentcompletion =
True;
244 }
245
247 {
249 return;
250 }
251
254
255
257 {
258 for (
i = 0;
i <
out->end -
out->p;
i += 2)
259 {
263 }
265 }
266
267 if (sentcompletion)
268 {
269 sentcompletion =
False;
271 }
272
274
276 {
279 {
283 return;
284 }
285 }
286
289 {
291 {
293 return;
294 }
295
296
297 if (
info.play.samples >= samplecnt + ((numsamples * 7) / 10))
298 {
299 samplecnt += numsamples;
304 sentcompletion =
True;
305 }
306 else
307 {
309 return;
310 }
311 }
312 }
313}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static short g_samplewidth
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Referenced by wave_out_write().
◆ wave_out_set_format()
Definition at line 110 of file rdpsnd_sun.c.
111{
113
116 AUDIO_INITINFO(&
info);
117
118
120 {
121 info.play.encoding = AUDIO_ENCODING_LINEAR8;
122 }
124 {
125 info.play.encoding = AUDIO_ENCODING_LINEAR;
126
127#ifdef B_ENDIAN
129#else
131#endif
132 }
133
135
137 {
138 info.play.channels = 1;
139 }
141 {
142 info.play.channels = 2;
144 }
145
148 info.play.samples = 0;
152
154 {
158 }
159
161}
◆ wave_out_volume()
Definition at line 164 of file rdpsnd_sun.c.
165{
169
170 AUDIO_INITINFO(&
info);
171
173
174 if (
volume / AUDIO_MID_BALANCE != 0)
175 {
176 balance =
177 AUDIO_MID_BALANCE - (
left / (
volume / AUDIO_MID_BALANCE)) +
179 }
180 else
181 {
182 balance = AUDIO_MID_BALANCE;
183 }
184
185 info.play.gain =
volume / (65536 / AUDIO_MAX_GAIN);
186 info.play.balance = balance;
187
189 {
191 return;
192 }
193}
◆ wave_out_write()
Definition at line 196 of file rdpsnd_sun.c.
197{
200
202 {
203 error(
"No space to queue audio packet\n");
204 return;
205 }
206
208
213
214
216
219}
◆ dsp_
◆ dsp_bu
◆ g_reopened
◆ g_samplewidth
◆ g_swapaudio
◆ packet_queue
◆ queue_hi
◆ queue_lo