mirror of
https://github.com/albfan/miraclecast.git
synced 2025-03-09 23:38:56 +00:00
miracle-srcctl: fix some warming
This commit is contained in:
parent
853152cb9c
commit
1919de3158
4 changed files with 13 additions and 23 deletions
|
@ -70,6 +70,8 @@ static int src_trigger_play_rep_fn(struct rtsp *bus,
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
cli_debug("INCOMING (M5): %s\n", rtsp_message_get_raw(m));
|
cli_debug("INCOMING (M5): %s\n", rtsp_message_get_raw(m));
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void src_handle_setup(struct ctl_src *s,
|
static void src_handle_setup(struct ctl_src *s,
|
||||||
|
@ -236,7 +238,7 @@ static bool parse_video_formats(struct rtsp_message *m,
|
||||||
|
|
||||||
formats->hres = -1;
|
formats->hres = -1;
|
||||||
formats->vres = -1;
|
formats->vres = -1;
|
||||||
sscanf(param + 55, "%hx %hx", &formats->hres, &formats->vres);
|
sscanf(param + 55, "%x %x", &formats->hres, &formats->vres);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
@ -322,7 +324,6 @@ static int src_trigger_setup_rep_fn(struct rtsp *bus,
|
||||||
{
|
{
|
||||||
struct ctl_src *s = data;
|
struct ctl_src *s = data;
|
||||||
_rtsp_message_unref_ struct rtsp_message *req = NULL;
|
_rtsp_message_unref_ struct rtsp_message *req = NULL;
|
||||||
int r;
|
|
||||||
|
|
||||||
cli_debug("INCOMING (M5): %s\n", rtsp_message_get_raw(m));
|
cli_debug("INCOMING (M5): %s\n", rtsp_message_get_raw(m));
|
||||||
|
|
||||||
|
@ -335,7 +336,7 @@ static int src_trigger_setup_rep_fn(struct rtsp *bus,
|
||||||
ctl_src_close(s);
|
ctl_src_close(s);
|
||||||
ctl_fn_src_disconnected(s);
|
ctl_fn_src_disconnected(s);
|
||||||
|
|
||||||
return r;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int src_set_parameter_rep_fn(struct rtsp *bus,
|
static int src_set_parameter_rep_fn(struct rtsp *bus,
|
||||||
|
@ -439,16 +440,16 @@ static int src_get_parameter_rep_fn(struct rtsp *bus,
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
struct ctl_src *s = data;
|
struct ctl_src *s = data;
|
||||||
int r;
|
|
||||||
const char *param;
|
|
||||||
int n_params;
|
|
||||||
|
|
||||||
cli_debug("INCOMING (M3): %s\n", rtsp_message_get_raw(m));
|
cli_debug("INCOMING (M3): %s\n", rtsp_message_get_raw(m));
|
||||||
|
|
||||||
if (!rtsp_message_is_reply(m, RTSP_CODE_OK, NULL)) {
|
if (!rtsp_message_is_reply(m, RTSP_CODE_OK, NULL)) {
|
||||||
cli_printf("[" CLI_RED "ERROR" CLI_DEFAULT "] GET_PARAMETER failed\n");
|
cli_printf("[" CLI_RED "ERROR" CLI_DEFAULT "] GET_PARAMETER failed\n");
|
||||||
r = -1;
|
|
||||||
goto error;
|
ctl_src_close(s);
|
||||||
|
ctl_fn_src_disconnected(s);
|
||||||
|
|
||||||
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
free(s->sink.rtp_ports.profile);
|
free(s->sink.rtp_ports.profile);
|
||||||
|
@ -458,15 +459,7 @@ static int src_get_parameter_rep_fn(struct rtsp *bus,
|
||||||
//s->sink.has_audio_codecs = parse_audio_codecs(m, &s->sink.audio_codecs);
|
//s->sink.has_audio_codecs = parse_audio_codecs(m, &s->sink.audio_codecs);
|
||||||
s->sink.has_rtp_ports = parse_client_rtp_ports(m, &s->sink.rtp_ports);
|
s->sink.has_rtp_ports = parse_client_rtp_ports(m, &s->sink.rtp_ports);
|
||||||
|
|
||||||
r = src_send_set_parameter(s);
|
return src_send_set_parameter(s);
|
||||||
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
error:
|
|
||||||
ctl_src_close(s);
|
|
||||||
ctl_fn_src_disconnected(s);
|
|
||||||
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int src_options_rep_fn(struct rtsp *bus,
|
static int src_options_rep_fn(struct rtsp *bus,
|
||||||
|
@ -607,7 +600,6 @@ static void src_connected(struct ctl_src *s)
|
||||||
int r, val;
|
int r, val;
|
||||||
struct sockaddr_storage addr;
|
struct sockaddr_storage addr;
|
||||||
socklen_t len;
|
socklen_t len;
|
||||||
char buf[64];
|
|
||||||
|
|
||||||
cli_printf("got incomming connection request\n");
|
cli_printf("got incomming connection request\n");
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,6 @@ static sd_event_source *scan_timeout;
|
||||||
static sd_event_source *src_timeout;
|
static sd_event_source *src_timeout;
|
||||||
static unsigned int src_timeout_time;
|
static unsigned int src_timeout_time;
|
||||||
static bool src_connected;
|
static bool src_connected;
|
||||||
static pid_t src_pid;
|
|
||||||
|
|
||||||
//static char *selected_ link;
|
//static char *selected_ link;
|
||||||
static struct ctl_link *running_link;
|
static struct ctl_link *running_link;
|
||||||
|
|
|
@ -191,7 +191,7 @@ int vfd_get_vesa_resolution(uint32_t mask, int *hres, int *vres)
|
||||||
if (!mask)
|
if (!mask)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
for (N_ELEMENTS(resolutions_vesa) - 1; i >= 0; --i) {
|
for (i = N_ELEMENTS(resolutions_vesa) - 1; i >= 0; --i) {
|
||||||
if ((1 << resolutions_vesa[i].index) & mask) {
|
if ((1 << resolutions_vesa[i].index) & mask) {
|
||||||
*vres = resolutions_vesa[i].vres;
|
*vres = resolutions_vesa[i].vres;
|
||||||
*hres = resolutions_vesa[i].hres;
|
*hres = resolutions_vesa[i].hres;
|
||||||
|
@ -208,7 +208,7 @@ int vfd_get_hh_resolution(uint32_t mask, int *hres, int *vres)
|
||||||
if (!mask)
|
if (!mask)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
for (N_ELEMENTS(resolutions_hh); i >= 0; --i) {
|
for (i = N_ELEMENTS(resolutions_hh); i >= 0; --i) {
|
||||||
if ((1 << resolutions_hh[i].index) & mask) {
|
if ((1 << resolutions_hh[i].index) & mask) {
|
||||||
*vres = resolutions_hh[i].vres;
|
*vres = resolutions_hh[i].vres;
|
||||||
*hres = resolutions_hh[i].hres;
|
*hres = resolutions_hh[i].hres;
|
||||||
|
|
|
@ -828,7 +828,6 @@ static int manager_dbus_enumerate(sd_bus *bus,
|
||||||
struct peer *p;
|
struct peer *p;
|
||||||
size_t i, peer_cnt;
|
size_t i, peer_cnt;
|
||||||
char **nodes, *node;
|
char **nodes, *node;
|
||||||
int r;
|
|
||||||
|
|
||||||
if(strcmp("/org/freedesktop/miracle/wifi", path)) {
|
if(strcmp("/org/freedesktop/miracle/wifi", path)) {
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -887,7 +886,7 @@ error:
|
||||||
while (i--)
|
while (i--)
|
||||||
free(nodes[i]);
|
free(nodes[i]);
|
||||||
free(nodes);
|
free(nodes);
|
||||||
return r;
|
return log_ENOMEM();
|
||||||
}
|
}
|
||||||
|
|
||||||
int manager_dbus_connect(struct manager *m)
|
int manager_dbus_connect(struct manager *m)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue