mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-06-07 15:25:21 -04:00
UI: Create output before calling start stream event
Allows modifying the output OBS_FRONTEND_EVENT_STREAMING_STARTING.
This commit is contained in:
@@ -279,6 +279,7 @@ struct SimpleOutput : BasicOutputHandler {
|
||||
void UpdateRecording();
|
||||
bool ConfigureRecording(bool useReplayBuffer);
|
||||
|
||||
virtual bool SetupStreaming(obs_service_t *service) override;
|
||||
virtual bool StartStreaming(obs_service_t *service) override;
|
||||
virtual bool StartRecording() override;
|
||||
virtual bool StartReplayBuffer() override;
|
||||
@@ -726,7 +727,7 @@ const char *FindAudioEncoderFromCodec(const char *type)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool SimpleOutput::StartStreaming(obs_service_t *service)
|
||||
bool SimpleOutput::SetupStreaming(obs_service_t *service)
|
||||
{
|
||||
if (!Active())
|
||||
SetupOutputs();
|
||||
@@ -820,9 +821,11 @@ bool SimpleOutput::StartStreaming(obs_service_t *service)
|
||||
obs_output_set_video_encoder(streamOutput, h264Streaming);
|
||||
obs_output_set_audio_encoder(streamOutput, aacStreaming, 0);
|
||||
obs_output_set_service(streamOutput, service);
|
||||
return true;
|
||||
}
|
||||
|
||||
/* --------------------- */
|
||||
|
||||
bool SimpleOutput::StartStreaming(obs_service_t *service)
|
||||
{
|
||||
bool reconnect = config_get_bool(main->Config(), "Output", "Reconnect");
|
||||
int retryDelay =
|
||||
config_get_uint(main->Config(), "Output", "RetryDelay");
|
||||
@@ -871,6 +874,7 @@ bool SimpleOutput::StartStreaming(obs_service_t *service)
|
||||
else
|
||||
lastError = string();
|
||||
|
||||
const char *type = obs_service_get_output_type(service);
|
||||
blog(LOG_WARNING, "Stream output type '%s' failed to start!%s%s", type,
|
||||
hasLastError ? " Last Error: " : "", hasLastError ? error : "");
|
||||
return false;
|
||||
@@ -1064,6 +1068,7 @@ struct AdvancedOutput : BasicOutputHandler {
|
||||
void SetupOutputs() override;
|
||||
int GetAudioBitrate(size_t i) const;
|
||||
|
||||
virtual bool SetupStreaming(obs_service_t *service) override;
|
||||
virtual bool StartStreaming(obs_service_t *service) override;
|
||||
virtual bool StartRecording() override;
|
||||
virtual bool StartReplayBuffer() override;
|
||||
@@ -1498,7 +1503,7 @@ int AdvancedOutput::GetAudioBitrate(size_t i) const
|
||||
return FindClosestAvailableAACBitrate(bitrate);
|
||||
}
|
||||
|
||||
bool AdvancedOutput::StartStreaming(obs_service_t *service)
|
||||
bool AdvancedOutput::SetupStreaming(obs_service_t *service)
|
||||
{
|
||||
int streamTrack =
|
||||
config_get_int(main->Config(), "AdvOut", "TrackIndex") - 1;
|
||||
@@ -1600,9 +1605,11 @@ bool AdvancedOutput::StartStreaming(obs_service_t *service)
|
||||
|
||||
obs_output_set_video_encoder(streamOutput, h264Streaming);
|
||||
obs_output_set_audio_encoder(streamOutput, streamAudioEnc, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
/* --------------------- */
|
||||
|
||||
bool AdvancedOutput::StartStreaming(obs_service_t *service)
|
||||
{
|
||||
obs_output_set_service(streamOutput, service);
|
||||
|
||||
bool reconnect = config_get_bool(main->Config(), "Output", "Reconnect");
|
||||
@@ -1651,6 +1658,7 @@ bool AdvancedOutput::StartStreaming(obs_service_t *service)
|
||||
else
|
||||
lastError = string();
|
||||
|
||||
const char *type = obs_service_get_output_type(service);
|
||||
blog(LOG_WARNING, "Stream output type '%s' failed to start!%s%s", type,
|
||||
hasLastError ? " Last Error: " : "", hasLastError ? error : "");
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user