diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2013-07-19 11:11:31 -0700 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2013-07-19 11:11:31 -0700 |
commit | 50db19c88c97a99770ce53fefcc14a74ca7e87ab (patch) | |
tree | 0fffdd0785fb92e315b2a72e470ee1d95ff7dc62 /xrdpvr | |
parent | fad70062d6b158f253b95968bc4f01361210f79e (diff) | |
download | xrdp-proprietary-50db19c88c97a99770ce53fefcc14a74ca7e87ab.tar.gz xrdp-proprietary-50db19c88c97a99770ce53fefcc14a74ca7e87ab.zip |
xrdpvr: added volume message
Diffstat (limited to 'xrdpvr')
-rw-r--r-- | xrdpvr/xrdpvr.c | 35 | ||||
-rw-r--r-- | xrdpvr/xrdpvr.h | 1 | ||||
-rw-r--r-- | xrdpvr/xrdpvr_internal.h | 1 |
3 files changed, 37 insertions, 0 deletions
diff --git a/xrdpvr/xrdpvr.c b/xrdpvr/xrdpvr.c index 89daccf8..d6a4fdb7 100644 --- a/xrdpvr/xrdpvr.c +++ b/xrdpvr/xrdpvr.c @@ -750,3 +750,38 @@ xrdpvr_write_to_client(void *channel, STREAM *s) usleep(1000 * 3); } } + +/** + * write set volume to a xrdpvr client + * + * @param channel opaque handle returned by WTSVirtualChannelOpenEx + * @param volume volume 0x0000 to 0xffff + * + * @return 0 on success, -1 on failure + ******************************************************************************/ +int +send_volume(void *channel, int volume) +{ + STREAM *s; + char *cptr; + int rv; + int len; + + stream_new(s, MAX_BUFSIZE); + + stream_ins_u32_le(s, 0); /* number of bytes to follow */ + stream_ins_u32_le(s, CMD_SET_VOLUME); + stream_ins_u32_le(s, volume); + + /* insert number of bytes in stream */ + len = stream_length(s) - 4; + cptr = s->p; + s->p = s->data; + stream_ins_u32_le(s, len); + s->p = cptr; + + /* write data to virtual channel */ + rv = xrdpvr_write_to_client(channel, s); + stream_free(s); + return rv; +} diff --git a/xrdpvr/xrdpvr.h b/xrdpvr/xrdpvr.h index f278a703..ba5dc6b9 100644 --- a/xrdpvr/xrdpvr.h +++ b/xrdpvr/xrdpvr.h @@ -44,6 +44,7 @@ int xrdpvr_seek_media(int64_t pos, int backward); int xrdpvr_get_frame(void **av_pkt_ret, int *is_video_frame, int *delay_in_us); int send_audio_pkt(void *channel, int stream_id, void *pkt_p); int send_video_pkt(void *channel, int stream_id, void *pkt_p); +int send_volume(void *channel, int volume); #ifdef __cplusplus } diff --git a/xrdpvr/xrdpvr_internal.h b/xrdpvr/xrdpvr_internal.h index 90753a06..ca01941c 100644 --- a/xrdpvr/xrdpvr_internal.h +++ b/xrdpvr/xrdpvr_internal.h @@ -61,6 +61,7 @@ #define CMD_WRITE_META_DATA 7 #define CMD_DEINIT_XRDPVR 8 #define CMD_SET_GEOMETRY 9 +#define CMD_SET_VOLUME 10 /* max number of bytes we can send in one pkt */ #define MAX_PDU_SIZE 1600 |