1
0
Fork 0
mirror of https://github.com/albfan/miraclecast.git synced 2025-03-09 23:38:56 +00:00

miracle-wfdctl: change session type from uint64_t to unsigned int

This commit is contained in:
Derek Dai 2017-02-27 11:37:21 +08:00
parent 05a0951525
commit 99497fbb55
No known key found for this signature in database
GPG key ID: E109CC97553EF009
5 changed files with 19 additions and 19 deletions

View file

@ -190,8 +190,8 @@ void wfd_session_free(struct wfd_session *s);
uint64_t wfd_session_get_id(struct wfd_session *s); uint64_t wfd_session_get_id(struct wfd_session *s);
struct wfd_sink * wfd_out_session_get_sink(struct wfd_session *s); struct wfd_sink * wfd_out_session_get_sink(struct wfd_session *s);
void wfd_session_free_p(struct wfd_session **s); void wfd_session_free_p(struct wfd_session **s);
uint64_t * wfd_session_to_htable(struct wfd_session *s); unsigned int * wfd_session_to_htable(struct wfd_session *s);
struct wfd_session * wfd_session_from_htable(uint64_t *e); struct wfd_session * wfd_session_from_htable(unsigned int *e);
/* wfd sink */ /* wfd sink */
#define _wfd_sink_free_ _shl_cleanup_(wfd_sink_freep) #define _wfd_sink_free_ _shl_cleanup_(wfd_sink_freep)
@ -249,7 +249,7 @@ struct ctl_wfd
size_t n_sinks; size_t n_sinks;
struct shl_htable sessions; struct shl_htable sessions;
size_t n_sessions; size_t n_sessions;
uint64_t id_pool; unsigned int id_pool;
sd_event_source *signal_sources[4]; sd_event_source *signal_sources[4];
}; };
@ -260,12 +260,12 @@ int ctl_wfd_find_sink_by_label(struct ctl_wfd *wfd,
struct wfd_sink **out); struct wfd_sink **out);
int ctl_wfd_add_session(struct ctl_wfd *wfd, struct wfd_session *s); int ctl_wfd_add_session(struct ctl_wfd *wfd, struct wfd_session *s);
int ctl_wfd_find_session_by_id(struct ctl_wfd *wfd, int ctl_wfd_find_session_by_id(struct ctl_wfd *wfd,
uint64_t id, unsigned int id,
struct wfd_session **out); struct wfd_session **out);
int ctl_wfd_remove_session_by_id(struct ctl_wfd *wfd, int ctl_wfd_remove_session_by_id(struct ctl_wfd *wfd,
uint64_t id, unsigned int id,
struct wfd_session **out); struct wfd_session **out);
uint64_t ctl_wfd_alloc_session_id(struct ctl_wfd *wfd); unsigned int ctl_wfd_alloc_session_id(struct ctl_wfd *wfd);
static inline struct sd_event * ctl_wfd_get_loop() static inline struct sd_event * ctl_wfd_get_loop()
{ {
return ctl_wfd_get()->loop; return ctl_wfd_get()->loop;

View file

@ -536,7 +536,7 @@ static int wfd_out_session_launch_gst(struct wfd_session *s, pid_t *out)
return p; return p;
} }
else if(0 < p) { else if(0 < p) {
log_info("gstreamer (%d) is launched for session %" PRId64, log_info("gstreamer (%d) is launched for session %u",
p, p,
s->id); s->id);
@ -743,7 +743,7 @@ static int wfd_out_session_handle_setup_request(struct wfd_session *s,
return r; return r;
} }
r = asprintf(&sess, "%" PRIu64 ";timeout=30", s->id); r = asprintf(&sess, "%X;timeout=30", s->id);
if(0 > r) { if(0 > r) {
return r; return r;
} }

View file

@ -235,12 +235,12 @@ enum wfd_session_dir wfd_session_get_dir(struct wfd_session *s)
return s->dir; return s->dir;
} }
uint64_t * wfd_session_to_htable(struct wfd_session *s) unsigned int * wfd_session_to_htable(struct wfd_session *s)
{ {
return &s->id; return &s->id;
} }
struct wfd_session * wfd_session_from_htable(uint64_t *e) struct wfd_session * wfd_session_from_htable(unsigned int *e)
{ {
return shl_htable_entry(e, struct wfd_session, id); return shl_htable_entry(e, struct wfd_session, id);
} }

View file

@ -98,7 +98,7 @@ struct wfd_session
enum rtsp_message_id last_request; enum rtsp_message_id last_request;
const struct rtsp_dispatch_entry *rtsp_disp_tbl; const struct rtsp_dispatch_entry *rtsp_disp_tbl;
uint64_t id; unsigned int id;
struct rtsp *rtsp; struct rtsp *rtsp;
uint16_t rtp_ports[2]; uint16_t rtp_ports[2];
struct wfd_video_formats *vformats; struct wfd_video_formats *vformats;

View file

@ -165,7 +165,7 @@ end:
return r; return r;
} }
uint64_t ctl_wfd_alloc_session_id(struct ctl_wfd *wfd) unsigned int ctl_wfd_alloc_session_id(struct ctl_wfd *wfd)
{ {
return ++wfd->id_pool; return ++wfd->id_pool;
} }
@ -178,7 +178,7 @@ int ctl_wfd_add_session(struct ctl_wfd *wfd, struct wfd_session *s)
assert(s && wfd_session_get_id(s)); assert(s && wfd_session_get_id(s));
assert(!ctl_wfd_find_session_by_id(wfd, wfd_session_get_id(s), NULL)); assert(!ctl_wfd_find_session_by_id(wfd, wfd_session_get_id(s), NULL));
r = shl_htable_insert_u64(&wfd->sessions, wfd_session_to_htable(s)); r = shl_htable_insert_uint(&wfd->sessions, wfd_session_to_htable(s));
if(0 > r) { if(0 > r) {
return r; return r;
} }
@ -191,11 +191,11 @@ int ctl_wfd_add_session(struct ctl_wfd *wfd, struct wfd_session *s)
} }
int ctl_wfd_find_session_by_id(struct ctl_wfd *wfd, int ctl_wfd_find_session_by_id(struct ctl_wfd *wfd,
uint64_t id, unsigned int id,
struct wfd_session **out) struct wfd_session **out)
{ {
uint64_t *entry; unsigned int *entry;
int r = shl_htable_lookup_u64(&wfd->sessions, id, &entry); int r = shl_htable_lookup_uint(&wfd->sessions, id, &entry);
if(r && out) { if(r && out) {
*out = wfd_session_from_htable(entry); *out = wfd_session_from_htable(entry);
} }
@ -204,12 +204,12 @@ int ctl_wfd_find_session_by_id(struct ctl_wfd *wfd,
} }
int ctl_wfd_remove_session_by_id(struct ctl_wfd *wfd, int ctl_wfd_remove_session_by_id(struct ctl_wfd *wfd,
uint64_t id, unsigned int id,
struct wfd_session **out) struct wfd_session **out)
{ {
uint64_t *entry; unsigned int *entry;
struct wfd_session *s; struct wfd_session *s;
int r = shl_htable_remove_u64(&wfd->sessions, id, &entry); int r = shl_htable_remove_uint(&wfd->sessions, id, &entry);
if(!r) { if(!r) {
return 0; return 0;
} }