Skip to content

Commit 7b86496

Browse files
committed
oto: integrate driver implementations for consoles
1 parent fba9161 commit 7b86496

File tree

3 files changed

+28
-53
lines changed

3 files changed

+28
-53
lines changed

driver_nintendosdk.go renamed to driver_console.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
//go:build nintendosdk
15+
//go:build nintendosdk || playstation5
1616

1717
package oto
1818

@@ -24,7 +24,7 @@ package oto
2424
// void oto_OpenAudio(int sample_rate, int channel_num, oto_OnReadCallbackType on_read_callback, int buffer_size_in_bytes);
2525
//
2626
// void oto_OnReadCallback(float* buf, size_t length);
27-
// static void oto_OpenProxy(int sample_rate, int channel_num, int buffer_size_in_bytes) {
27+
// static void oto_OpenAudioProxy(int sample_rate, int channel_num, int buffer_size_in_bytes) {
2828
// oto_OpenAudio(sample_rate, channel_num, oto_OnReadCallback, buffer_size_in_bytes);
2929
// }
3030
import "C"
@@ -54,7 +54,7 @@ func newContext(sampleRate int, channelCount int, format mux.Format, bufferSizeI
5454
mux: mux.New(sampleRate, channelCount, format),
5555
}
5656
theContext = c
57-
C.oto_OpenProxy(C.int(sampleRate), C.int(channelCount), C.int(bufferSizeInBytes))
57+
C.oto_OpenAudioProxy(C.int(sampleRate), C.int(channelCount), C.int(bufferSizeInBytes))
5858

5959
return c, ready, nil
6060
}

driver_playstation5.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright 2025 The Oto Authors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
//go:build playstation5
16+
17+
// The actual implementaiton will be provided by -overlay.
18+
19+
#include <cstddef>
20+
21+
typedef void (*oto_OnReadCallbackType)(float *buf, size_t length);
22+
23+
extern "C" void oto_OpenAudio(int sample_rate, int channel_num,
24+
oto_OnReadCallbackType on_read_callback,
25+
int buffer_size_in_bytes) {}

driver_playstation5.go

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)