2014-04-19 20:54:18 -07:00
|
|
|
#include <obs-module.h>
|
|
|
|
|
|
|
|
struct rtmp_custom {
|
|
|
|
char *server, *key;
|
|
|
|
};
|
|
|
|
|
2014-06-25 00:13:00 -07:00
|
|
|
static const char *rtmp_custom_name(void)
|
2014-04-19 20:54:18 -07:00
|
|
|
{
|
2014-07-09 22:12:57 -07:00
|
|
|
return obs_module_text("CustomStreamingServer");
|
2014-04-19 20:54:18 -07:00
|
|
|
}
|
|
|
|
|
2014-09-25 17:44:05 -07:00
|
|
|
static void rtmp_custom_update(void *data, obs_data_t *settings)
|
2014-04-19 20:54:18 -07:00
|
|
|
{
|
|
|
|
struct rtmp_custom *service = data;
|
|
|
|
|
|
|
|
bfree(service->server);
|
|
|
|
bfree(service->key);
|
|
|
|
|
2014-08-05 11:09:29 -07:00
|
|
|
service->server = bstrdup(obs_data_get_string(settings, "server"));
|
|
|
|
service->key = bstrdup(obs_data_get_string(settings, "key"));
|
2014-04-19 20:54:18 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void rtmp_custom_destroy(void *data)
|
|
|
|
{
|
|
|
|
struct rtmp_custom *service = data;
|
|
|
|
|
|
|
|
bfree(service->server);
|
|
|
|
bfree(service->key);
|
|
|
|
bfree(service);
|
|
|
|
}
|
|
|
|
|
2014-09-25 17:44:05 -07:00
|
|
|
static void *rtmp_custom_create(obs_data_t *settings, obs_service_t *service)
|
2014-04-19 20:54:18 -07:00
|
|
|
{
|
|
|
|
struct rtmp_custom *data = bzalloc(sizeof(struct rtmp_custom));
|
|
|
|
rtmp_custom_update(data, settings);
|
|
|
|
|
|
|
|
UNUSED_PARAMETER(service);
|
|
|
|
return data;
|
|
|
|
}
|
|
|
|
|
2014-09-29 08:36:13 -07:00
|
|
|
static obs_properties_t *rtmp_custom_properties(void *unused)
|
2014-04-19 20:54:18 -07:00
|
|
|
{
|
2014-09-29 08:36:13 -07:00
|
|
|
UNUSED_PARAMETER(unused);
|
|
|
|
|
2014-09-25 17:44:05 -07:00
|
|
|
obs_properties_t *ppts = obs_properties_create();
|
2014-04-19 20:54:18 -07:00
|
|
|
|
|
|
|
obs_properties_add_text(ppts, "server", "URL", OBS_TEXT_DEFAULT);
|
2014-07-09 22:12:57 -07:00
|
|
|
|
|
|
|
obs_properties_add_text(ppts, "key", obs_module_text("StreamKey"),
|
|
|
|
OBS_TEXT_PASSWORD);
|
2014-04-19 20:54:18 -07:00
|
|
|
return ppts;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const char *rtmp_custom_url(void *data)
|
|
|
|
{
|
|
|
|
struct rtmp_custom *service = data;
|
|
|
|
return service->server;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const char *rtmp_custom_key(void *data)
|
|
|
|
{
|
|
|
|
struct rtmp_custom *service = data;
|
|
|
|
return service->key;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct obs_service_info rtmp_custom_service = {
|
2014-08-04 21:27:52 -07:00
|
|
|
.id = "rtmp_custom",
|
|
|
|
.get_name = rtmp_custom_name,
|
|
|
|
.create = rtmp_custom_create,
|
|
|
|
.destroy = rtmp_custom_destroy,
|
|
|
|
.update = rtmp_custom_update,
|
|
|
|
.get_properties = rtmp_custom_properties,
|
|
|
|
.get_url = rtmp_custom_url,
|
|
|
|
.get_key = rtmp_custom_key
|
2014-04-19 20:54:18 -07:00
|
|
|
};
|