Lines Matching refs:this

63     if (ioctl(this->hidden->audio_fd, AUDIO_GETINFO, &info) < 0) {  in NETBSDAUDIO_Status()
68 prinfo = this->iscapture ? &info.record : &info.play; in NETBSDAUDIO_Status()
85 this->iscapture ? "record" : "play", in NETBSDAUDIO_Status()
119 this->spec.format, in NETBSDAUDIO_Status()
120 this->spec.size); in NETBSDAUDIO_Status()
129 struct SDL_PrivateAudioData *h = this->hidden; in NETBSDAUDIO_PlayDevice()
136 SDL_OpenedAudioDeviceDisconnected(this); in NETBSDAUDIO_PlayDevice()
149 return (this->hidden->mixbuf); in NETBSDAUDIO_GetDeviceBuf()
159 br = read(this->hidden->audio_fd, buffer, buflen); in NETBSDAUDIO_CaptureFromDevice()
179 if (ioctl(this->hidden->audio_fd, AUDIO_GETINFO, &info) < 0) { in NETBSDAUDIO_FlushCapture()
183 remain = (size_t) (info.record.samples * (SDL_AUDIO_BITSIZE(this->spec.format) / 8)); in NETBSDAUDIO_FlushCapture()
186 const int br = read(this->hidden->audio_fd, buf, len); in NETBSDAUDIO_FlushCapture()
197 if (this->hidden->audio_fd >= 0) { in NETBSDAUDIO_CloseDevice()
198 close(this->hidden->audio_fd); in NETBSDAUDIO_CloseDevice()
200 SDL_free(this->hidden->mixbuf); in NETBSDAUDIO_CloseDevice()
201 SDL_free(this->hidden); in NETBSDAUDIO_CloseDevice()
221 this->hidden = (struct SDL_PrivateAudioData *) in NETBSDAUDIO_OpenDevice()
222 SDL_malloc((sizeof *this->hidden)); in NETBSDAUDIO_OpenDevice()
223 if (this->hidden == NULL) { in NETBSDAUDIO_OpenDevice()
226 SDL_zerop(this->hidden); in NETBSDAUDIO_OpenDevice()
229 this->hidden->audio_fd = open(devname, iscapture ? O_RDONLY : O_WRONLY); in NETBSDAUDIO_OpenDevice()
230 if (this->hidden->audio_fd < 0) { in NETBSDAUDIO_OpenDevice()
238 for (format = SDL_FirstAudioFormat(this->spec.format); format;) { in NETBSDAUDIO_OpenDevice()
280 return SDL_SetError("No supported encoding for 0x%x", this->spec.format); in NETBSDAUDIO_OpenDevice()
283 this->spec.format = format; in NETBSDAUDIO_OpenDevice()
286 SDL_CalculateAudioSpec(&this->spec); in NETBSDAUDIO_OpenDevice()
289 info.blocksize = this->spec.size; in NETBSDAUDIO_OpenDevice()
292 prinfo->sample_rate = this->spec.freq; in NETBSDAUDIO_OpenDevice()
293 prinfo->channels = this->spec.channels; in NETBSDAUDIO_OpenDevice()
294 (void) ioctl(this->hidden->audio_fd, AUDIO_SETINFO, &info); in NETBSDAUDIO_OpenDevice()
296 (void) ioctl(this->hidden->audio_fd, AUDIO_GETINFO, &info); in NETBSDAUDIO_OpenDevice()
297 this->spec.freq = prinfo->sample_rate; in NETBSDAUDIO_OpenDevice()
298 this->spec.channels = prinfo->channels; in NETBSDAUDIO_OpenDevice()
302 this->hidden->mixlen = this->spec.size; in NETBSDAUDIO_OpenDevice()
303 this->hidden->mixbuf = (Uint8 *) SDL_malloc(this->hidden->mixlen); in NETBSDAUDIO_OpenDevice()
304 if (this->hidden->mixbuf == NULL) { in NETBSDAUDIO_OpenDevice()
307 SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); in NETBSDAUDIO_OpenDevice()
310 NETBSDAUDIO_Status(this); in NETBSDAUDIO_OpenDevice()