mirror of
https://github.com/albfan/miraclecast.git
synced 2025-03-09 23:38:56 +00:00
miracle-wfdctl: fix argument passing for ximagesrc
This commit is contained in:
parent
d41a88cc8b
commit
cdc4e32ff8
1 changed files with 37 additions and 22 deletions
|
@ -59,6 +59,7 @@ struct wfd_out_session
|
||||||
char *audio_dev;
|
char *audio_dev;
|
||||||
|
|
||||||
GstElement *pipeline;
|
GstElement *pipeline;
|
||||||
|
GstBus *bus;
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct rtsp_dispatch_entry out_session_rtsp_disp_tbl[];
|
static const struct rtsp_dispatch_entry out_session_rtsp_disp_tbl[];
|
||||||
|
@ -319,6 +320,12 @@ void wfd_out_session_destroy(struct wfd_session *s)
|
||||||
os->authority = NULL;
|
os->authority = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(os->bus) {
|
||||||
|
gst_bus_remove_signal_watch(os->bus);
|
||||||
|
g_object_unref(os->bus);
|
||||||
|
os->bus = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if(os->pipeline) {
|
if(os->pipeline) {
|
||||||
gst_element_set_state(os->pipeline, GST_STATE_NULL);
|
gst_element_set_state(os->pipeline, GST_STATE_NULL);
|
||||||
g_object_unref(os->pipeline);
|
g_object_unref(os->pipeline);
|
||||||
|
@ -554,9 +561,12 @@ inline static char * quote_str(const char *s, char *d, size_t len)
|
||||||
static int wfd_out_session_create_pipeline(struct wfd_session *s)
|
static int wfd_out_session_create_pipeline(struct wfd_session *s)
|
||||||
{
|
{
|
||||||
char rrtp_port[16], rrtcp_port[16], lrtcp_port[16];
|
char rrtp_port[16], rrtcp_port[16], lrtcp_port[16];
|
||||||
char audio_dev[256], vsrc_params[256] = "";
|
char audio_dev[256];
|
||||||
|
char vsrc_param1[16] = "", vsrc_param2[16] = "";
|
||||||
|
char vsrc_param3[16] = "", vsrc_param4[16] = "";
|
||||||
struct wfd_out_session *os = wfd_out_session(s);
|
struct wfd_out_session *os = wfd_out_session(s);
|
||||||
GstElement *pipeline;
|
GstElement *pipeline;
|
||||||
|
GstBus *bus;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
const char **tmp;
|
const char **tmp;
|
||||||
int r;
|
int r;
|
||||||
|
@ -565,8 +575,11 @@ static int wfd_out_session_create_pipeline(struct wfd_session *s)
|
||||||
"name=vsrc",
|
"name=vsrc",
|
||||||
"use-damage=false",
|
"use-damage=false",
|
||||||
"show-pointer=false",
|
"show-pointer=false",
|
||||||
vsrc_params,
|
vsrc_param1,
|
||||||
"!", "video/x-raw",
|
vsrc_param2,
|
||||||
|
vsrc_param3,
|
||||||
|
vsrc_param4,
|
||||||
|
"!", "video/x-raw,",
|
||||||
"framerate=60/1",
|
"framerate=60/1",
|
||||||
"!", "vaapipostproc",
|
"!", "vaapipostproc",
|
||||||
"!", "video/x-raw,",
|
"!", "video/x-raw,",
|
||||||
|
@ -646,16 +659,14 @@ static int wfd_out_session_create_pipeline(struct wfd_session *s)
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!os->display_param_name) {
|
if(!os->display_param_name) {
|
||||||
snprintf(vsrc_params, sizeof(vsrc_params),
|
snprintf(vsrc_param1, sizeof(vsrc_param1), "startx=%hu", os->x);
|
||||||
"strtx=%hu starty=%hu endx=%hu endy=%hu",
|
snprintf(vsrc_param2, sizeof(vsrc_param2), "starty=%hu", os->y);
|
||||||
os->x,
|
snprintf(vsrc_param3, sizeof(vsrc_param3), "endx=%d", os->width - 1);
|
||||||
os->y,
|
snprintf(vsrc_param4, sizeof(vsrc_param4), "endy=%d", os->height - 1);
|
||||||
os->width,
|
|
||||||
os->height);
|
|
||||||
}
|
}
|
||||||
else if(!strcmp("xid", os->display_param_name) ||
|
else if(!strcmp("xid", os->display_param_name) ||
|
||||||
!strcmp("xname", os->display_param_name)) {
|
!strcmp("xname", os->display_param_name)) {
|
||||||
snprintf(vsrc_params, sizeof(vsrc_params),
|
snprintf(vsrc_param1, sizeof(vsrc_param1),
|
||||||
"%s=\"%s\"",
|
"%s=\"%s\"",
|
||||||
os->display_param_name,
|
os->display_param_name,
|
||||||
os->display_param_value,
|
os->display_param_value,
|
||||||
|
@ -678,7 +689,11 @@ static int wfd_out_session_create_pipeline(struct wfd_session *s)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bus = gst_element_get_bus(pipeline);
|
||||||
|
gst_bus_add_signal_watch(bus);
|
||||||
|
|
||||||
os->pipeline = pipeline;
|
os->pipeline = pipeline;
|
||||||
|
os->bus = bus;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1039,12 +1054,12 @@ static const struct rtsp_dispatch_entry out_session_rtsp_disp_tbl[] = {
|
||||||
},
|
},
|
||||||
[RTSP_M7_PLAY] = {
|
[RTSP_M7_PLAY] = {
|
||||||
.handle_request = wfd_out_session_handle_play_request,
|
.handle_request = wfd_out_session_handle_play_request,
|
||||||
.rule = wfd_arg_list(
|
/*.rule = wfd_arg_list(*/
|
||||||
wfd_arg_dict(
|
/*wfd_arg_dict(*/
|
||||||
wfd_arg_u(WFD_SESSION_ARG_NEW_STATE),
|
/*wfd_arg_u(WFD_SESSION_ARG_NEW_STATE),*/
|
||||||
wfd_arg_u(WFD_SESSION_STATE_PLAYING)
|
/*wfd_arg_u(WFD_SESSION_STATE_PLAYING)*/
|
||||||
),
|
/*),*/
|
||||||
)
|
/*)*/
|
||||||
},
|
},
|
||||||
[RTSP_M8_TEARDOWN] = {
|
[RTSP_M8_TEARDOWN] = {
|
||||||
.handle_request = wfd_out_session_handle_teardown_request,
|
.handle_request = wfd_out_session_handle_teardown_request,
|
||||||
|
@ -1057,12 +1072,12 @@ static const struct rtsp_dispatch_entry out_session_rtsp_disp_tbl[] = {
|
||||||
},
|
},
|
||||||
[RTSP_M9_PAUSE] = {
|
[RTSP_M9_PAUSE] = {
|
||||||
.handle_request = wfd_out_session_handle_pause_request,
|
.handle_request = wfd_out_session_handle_pause_request,
|
||||||
.rule = wfd_arg_list(
|
/*.rule = wfd_arg_list(*/
|
||||||
wfd_arg_dict(
|
/*wfd_arg_dict(*/
|
||||||
wfd_arg_u(WFD_SESSION_ARG_NEW_STATE),
|
/*wfd_arg_u(WFD_SESSION_ARG_NEW_STATE),*/
|
||||||
wfd_arg_u(WFD_SESSION_STATE_PAUSED)
|
/*wfd_arg_u(WFD_SESSION_STATE_PAUSED)*/
|
||||||
),
|
/*),*/
|
||||||
)
|
/*)*/
|
||||||
},
|
},
|
||||||
[RTSP_M10_SET_ROUTE] = {
|
[RTSP_M10_SET_ROUTE] = {
|
||||||
.handle_request = wfd_out_session_request_not_implement
|
.handle_request = wfd_out_session_request_not_implement
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue