Lines Matching refs:this

35     const int framelen = (SDL_AUDIO_BITSIZE(this->spec.format) / 8) * this->spec.channels;  in FeedAudioDevice()
55 SDL_AudioCallback callback = this->callbackspec.callback; in HandleAudioProcess()
56 const int stream_len = this->callbackspec.size; in HandleAudioProcess()
59 if (!SDL_AtomicGet(&this->enabled) || SDL_AtomicGet(&this->paused)) { in HandleAudioProcess()
60 if (this->stream) { in HandleAudioProcess()
61 SDL_AudioStreamClear(this->stream); in HandleAudioProcess()
66 if (this->stream == NULL) { /* no conversion necessary. */ in HandleAudioProcess()
67 SDL_assert(this->spec.size == stream_len); in HandleAudioProcess()
68 callback(this->callbackspec.userdata, this->work_buffer, stream_len); in HandleAudioProcess()
71 while (SDL_AudioStreamAvailable(this->stream) < ((int) this->spec.size)) { in HandleAudioProcess()
72 callback(this->callbackspec.userdata, this->work_buffer, stream_len); in HandleAudioProcess()
73 if (SDL_AudioStreamPut(this->stream, this->work_buffer, stream_len) == -1) { in HandleAudioProcess()
74 SDL_AudioStreamClear(this->stream); in HandleAudioProcess()
75 SDL_AtomicSet(&this->enabled, 0); in HandleAudioProcess()
80 got = SDL_AudioStreamGet(this->stream, this->work_buffer, this->spec.size); in HandleAudioProcess()
81 SDL_assert((got < 0) || (got == this->spec.size)); in HandleAudioProcess()
82 if (got != this->spec.size) { in HandleAudioProcess()
83 SDL_memset(this->work_buffer, this->spec.silence, this->spec.size); in HandleAudioProcess()
87 FeedAudioDevice(this, this->work_buffer, this->spec.size); in HandleAudioProcess()
93 SDL_AudioCallback callback = this->callbackspec.callback; in HandleCaptureProcess()
94 const int stream_len = this->callbackspec.size; in HandleCaptureProcess()
97 if (!SDL_AtomicGet(&this->enabled) || SDL_AtomicGet(&this->paused)) { in HandleCaptureProcess()
98 SDL_AudioStreamClear(this->stream); in HandleCaptureProcess()
121 }, this->work_buffer, (this->spec.size / sizeof (float)) / this->spec.channels); in HandleCaptureProcess()
125 if (this->stream == NULL) { /* no conversion necessary. */ in HandleCaptureProcess()
126 SDL_assert(this->spec.size == stream_len); in HandleCaptureProcess()
127 callback(this->callbackspec.userdata, this->work_buffer, stream_len); in HandleCaptureProcess()
129 if (SDL_AudioStreamPut(this->stream, this->work_buffer, this->spec.size) == -1) { in HandleCaptureProcess()
130 SDL_AtomicSet(&this->enabled, 0); in HandleCaptureProcess()
133 while (SDL_AudioStreamAvailable(this->stream) >= stream_len) { in HandleCaptureProcess()
134 const int got = SDL_AudioStreamGet(this->stream, this->work_buffer, stream_len); in HandleCaptureProcess()
137 SDL_memset(this->work_buffer, this->callbackspec.silence, stream_len); in HandleCaptureProcess()
139 … callback(this->callbackspec.userdata, this->work_buffer, stream_len); /* Send it to the app. */ in HandleCaptureProcess()
185 }, this->iscapture); in EMSCRIPTENAUDIO_CloseDevice()
188 SDL_free(this->hidden); in EMSCRIPTENAUDIO_CloseDevice()
226 test_format = SDL_FirstAudioFormat(this->spec.format); in EMSCRIPTENAUDIO_OpenDevice()
230 this->spec.format = test_format; in EMSCRIPTENAUDIO_OpenDevice()
245 this->hidden = (struct SDL_PrivateAudioData *) in EMSCRIPTENAUDIO_OpenDevice()
246 SDL_malloc((sizeof *this->hidden)); in EMSCRIPTENAUDIO_OpenDevice()
247 if (this->hidden == NULL) { in EMSCRIPTENAUDIO_OpenDevice()
250 SDL_zerop(this->hidden); in EMSCRIPTENAUDIO_OpenDevice()
252 this->hidden = (struct SDL_PrivateAudioData *)0x1; in EMSCRIPTENAUDIO_OpenDevice()
255 this->spec.freq = EM_ASM_INT_V({ in EMSCRIPTENAUDIO_OpenDevice()
260 SDL_CalculateAudioSpec(&this->spec); in EMSCRIPTENAUDIO_OpenDevice()
319 }, this->spec.channels, this->spec.samples, HandleCaptureProcess, this); in EMSCRIPTENAUDIO_OpenDevice()
331 }, this->spec.channels, this->spec.samples, HandleAudioProcess, this); in EMSCRIPTENAUDIO_OpenDevice()