mirror of
https://git.sr.ht/~thestr4ng3r/chiaki
synced 2025-08-19 21:13:12 -07:00
Disable Keyboard by default
This commit is contained in:
parent
aea23effe9
commit
a2ebf7e408
7 changed files with 9 additions and 3 deletions
|
@ -204,7 +204,7 @@ JNIEXPORT void JNICALL JNI_FCN(sessionCreate)(JNIEnv *env, jobject obj, jobject
|
||||||
jobject connect_video_profile_obj = E->GetObjectField(env, connect_info_obj, E->GetFieldID(env, connect_info_class, "videoProfile", "L"BASE_PACKAGE"/ConnectVideoProfile;"));
|
jobject connect_video_profile_obj = E->GetObjectField(env, connect_info_obj, E->GetFieldID(env, connect_info_class, "videoProfile", "L"BASE_PACKAGE"/ConnectVideoProfile;"));
|
||||||
jclass connect_video_profile_class = E->GetObjectClass(env, connect_video_profile_obj);
|
jclass connect_video_profile_class = E->GetObjectClass(env, connect_video_profile_obj);
|
||||||
|
|
||||||
ChiakiConnectInfo connect_info;
|
ChiakiConnectInfo connect_info = { 0 };
|
||||||
const char *str_borrow = E->GetStringUTFChars(env, host_string, NULL);
|
const char *str_borrow = E->GetStringUTFChars(env, host_string, NULL);
|
||||||
connect_info.host = host_str = strdup(str_borrow);
|
connect_info.host = host_str = strdup(str_borrow);
|
||||||
E->ReleaseStringUTFChars(env, host_string, str_borrow);
|
E->ReleaseStringUTFChars(env, host_string, str_borrow);
|
||||||
|
|
|
@ -44,6 +44,7 @@ struct StreamSessionConnectInfo
|
||||||
ChiakiConnectVideoProfile video_profile;
|
ChiakiConnectVideoProfile video_profile;
|
||||||
unsigned int audio_buffer_size;
|
unsigned int audio_buffer_size;
|
||||||
bool fullscreen;
|
bool fullscreen;
|
||||||
|
bool enable_keyboard;
|
||||||
|
|
||||||
StreamSessionConnectInfo(Settings *settings, QString host, QByteArray regist_key, QByteArray morning, bool fullscreen);
|
StreamSessionConnectInfo(Settings *settings, QString host, QByteArray regist_key, QByteArray morning, bool fullscreen);
|
||||||
};
|
};
|
||||||
|
|
|
@ -27,6 +27,7 @@ StreamSessionConnectInfo::StreamSessionConnectInfo(Settings *settings, QString h
|
||||||
this->morning = morning;
|
this->morning = morning;
|
||||||
audio_buffer_size = settings->GetAudioBufferSize();
|
audio_buffer_size = settings->GetAudioBufferSize();
|
||||||
this->fullscreen = fullscreen;
|
this->fullscreen = fullscreen;
|
||||||
|
this->enable_keyboard = false; // TODO: from settings
|
||||||
}
|
}
|
||||||
|
|
||||||
static void AudioSettingsCb(uint32_t channels, uint32_t rate, void *user);
|
static void AudioSettingsCb(uint32_t channels, uint32_t rate, void *user);
|
||||||
|
|
|
@ -76,6 +76,7 @@ typedef struct chiaki_connect_info_t
|
||||||
char regist_key[CHIAKI_SESSION_AUTH_SIZE]; // must be completely filled (pad with \0)
|
char regist_key[CHIAKI_SESSION_AUTH_SIZE]; // must be completely filled (pad with \0)
|
||||||
uint8_t morning[0x10];
|
uint8_t morning[0x10];
|
||||||
ChiakiConnectVideoProfile video_profile;
|
ChiakiConnectVideoProfile video_profile;
|
||||||
|
bool enable_keyboard;
|
||||||
} ChiakiConnectInfo;
|
} ChiakiConnectInfo;
|
||||||
|
|
||||||
|
|
||||||
|
@ -157,6 +158,7 @@ typedef struct chiaki_session_t
|
||||||
uint8_t morning[CHIAKI_RPCRYPT_KEY_SIZE];
|
uint8_t morning[CHIAKI_RPCRYPT_KEY_SIZE];
|
||||||
uint8_t did[CHIAKI_RP_DID_SIZE];
|
uint8_t did[CHIAKI_RP_DID_SIZE];
|
||||||
ChiakiConnectVideoProfile video_profile;
|
ChiakiConnectVideoProfile video_profile;
|
||||||
|
bool enable_keyboard;
|
||||||
} connect_info;
|
} connect_info;
|
||||||
|
|
||||||
ChiakiTarget target;
|
ChiakiTarget target;
|
||||||
|
|
|
@ -488,7 +488,8 @@ static void ctrl_message_received(ChiakiCtrl *ctrl, uint16_t msg_type, uint8_t *
|
||||||
|
|
||||||
static void ctrl_enable_optional_features(ChiakiCtrl *ctrl)
|
static void ctrl_enable_optional_features(ChiakiCtrl *ctrl)
|
||||||
{
|
{
|
||||||
// TODO: Make this optional.
|
if(!ctrl->session->connect_info.enable_keyboard)
|
||||||
|
return;
|
||||||
// TODO: Last byte of pre_enable request is random (?)
|
// TODO: Last byte of pre_enable request is random (?)
|
||||||
// TODO: Signature ?!
|
// TODO: Signature ?!
|
||||||
uint8_t enable = 1;
|
uint8_t enable = 1;
|
||||||
|
|
|
@ -215,6 +215,7 @@ CHIAKI_EXPORT ChiakiErrorCode chiaki_session_init(ChiakiSession *session, Chiaki
|
||||||
memcpy(session->connect_info.did + sizeof(session->connect_info.did) - sizeof(did_suffix), did_suffix, sizeof(did_suffix));
|
memcpy(session->connect_info.did + sizeof(session->connect_info.did) - sizeof(did_suffix), did_suffix, sizeof(did_suffix));
|
||||||
|
|
||||||
session->connect_info.video_profile = connect_info->video_profile;
|
session->connect_info.video_profile = connect_info->video_profile;
|
||||||
|
session->connect_info.enable_keyboard = connect_info->enable_keyboard;
|
||||||
|
|
||||||
return CHIAKI_ERR_SUCCESS;
|
return CHIAKI_ERR_SUCCESS;
|
||||||
error_stop_pipe:
|
error_stop_pipe:
|
||||||
|
|
|
@ -136,7 +136,7 @@ int Host::InitSession(IO * user)
|
||||||
// Build chiaki ps4 stream session
|
// Build chiaki ps4 stream session
|
||||||
chiaki_opus_decoder_init(&(this->opus_decoder), this->log);
|
chiaki_opus_decoder_init(&(this->opus_decoder), this->log);
|
||||||
ChiakiAudioSink audio_sink;
|
ChiakiAudioSink audio_sink;
|
||||||
ChiakiConnectInfo chiaki_connect_info;
|
ChiakiConnectInfo chiaki_connect_info = { 0 };
|
||||||
|
|
||||||
chiaki_connect_info.host = this->host_addr.c_str();
|
chiaki_connect_info.host = this->host_addr.c_str();
|
||||||
chiaki_connect_info.video_profile = this->video_profile;
|
chiaki_connect_info.video_profile = this->video_profile;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue