UI: Allow services to use different outputs

Allows a service to specify the output it needs in order to function as
configured.

NOTE: This functionality should be considered temporary as a seamless
means of implementing support for different output types within the same
service.  Ideally, different services should be used for this
functionality.
This commit is contained in:
jp9000 committed 2017-07-14 12:43:04 -07:00
1 parent 4d1672719f
commit 3491487c71
3 files changed
+106 -59

No files matched your search

+15 -6
View File
@@ -157,6 +157,8 @@ static inline void string_depad_key(string &key)
}
}
const char *FindAudioEncoderFromCodec(const char *type);
void AutoConfigTestPage::TestBandwidthThread()
{
bool connected = false;
@@ -189,9 +191,6 @@ void AutoConfigTestPage::TestBandwidthThread()
"test_aac", nullptr, 0, nullptr);
OBSService service = obs_service_create(serverType,
"test_service", nullptr, nullptr);
OBSOutput output = obs_output_create("rtmp_output",
"test_stream", nullptr, nullptr);
obs_output_release(output);
obs_encoder_release(vencoder);
obs_encoder_release(aencoder);
obs_service_release(service);
@@ -251,19 +250,29 @@ void AutoConfigTestPage::TestBandwidthThread()
servers.resize(1);
/* -----------------------------------*/
/* apply settings */
/* apply service settings */
obs_service_update(service, service_settings);
obs_service_apply_encoder_settings(service,
vencoder_settings, aencoder_settings);
obs_encoder_update(vencoder, vencoder_settings);
obs_encoder_update(aencoder, aencoder_settings);
/* -----------------------------------*/
/* create output */
const char *output_type = obs_service_get_output_type(service);
if (!output_type)
output_type = "rtmp_output";
OBSOutput output = obs_output_create(output_type,
"test_stream", nullptr, nullptr);
obs_output_release(output);
obs_output_update(output, output_settings);
/* -----------------------------------*/
/* connect encoders/services/outputs */
obs_encoder_update(vencoder, vencoder_settings);
obs_encoder_update(aencoder, aencoder_settings);
obs_encoder_set_video(vencoder, obs_get_video());
obs_encoder_set_audio(aencoder, obs_get_audio());