Merge pull request #1879 from aquesnel/check_formatting
Add checking the code formatting with astyle during CI builds (#1879)
This commit is contained in:
commit
ce10d3a1a8
29
.github/workflows/build.yml
vendored
29
.github/workflows/build.yml
vendored
@ -146,3 +146,32 @@ jobs:
|
|||||||
- run: ./bootstrap
|
- run: ./bootstrap
|
||||||
- run: scripts/install_cppcheck.sh $CPPCHECK_REPO $CPPCHECK_VER
|
- run: scripts/install_cppcheck.sh $CPPCHECK_REPO $CPPCHECK_VER
|
||||||
- run: scripts/run_cppcheck.sh -v $CPPCHECK_VER
|
- run: scripts/run_cppcheck.sh -v $CPPCHECK_VER
|
||||||
|
|
||||||
|
code_formatting_check:
|
||||||
|
name: code formatting check
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
CC: gcc
|
||||||
|
# This is required to use a version of astyle other than that
|
||||||
|
# supplied with the operating system
|
||||||
|
ASTYLE_VER: 3.1
|
||||||
|
ASTYLE_REPO: https://svn.code.sf.net/p/astyle/code/tags
|
||||||
|
steps:
|
||||||
|
# This is currently the only way to get a version into
|
||||||
|
# the cache tag name - see https://github.com/actions/cache/issues/543
|
||||||
|
- run: |
|
||||||
|
echo "OS_VERSION=`lsb_release -sr`" >> $GITHUB_ENV
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Cache astyle
|
||||||
|
uses: actions/cache@v2
|
||||||
|
env:
|
||||||
|
cache-name: cache-astyle
|
||||||
|
with:
|
||||||
|
path: ~/astyle.local
|
||||||
|
key: ${{ runner.os }}-${{ env.OS_VERSION }}-build-${{ env.cache-name }}-${{ env.ASTYLE_VER }}
|
||||||
|
- run: sudo scripts/install_astyle_dependencies_with_apt.sh
|
||||||
|
- run: scripts/install_astyle.sh $ASTYLE_REPO $ASTYLE_VER
|
||||||
|
- name: Format code with astyle
|
||||||
|
run: scripts/run_astyle.sh
|
||||||
|
- name: Check code formatting
|
||||||
|
run: git diff --exit-code
|
||||||
|
@ -45,6 +45,14 @@
|
|||||||
# For each directory in the command line, process all subdirectories recursively.
|
# For each directory in the command line, process all subdirectories recursively.
|
||||||
--recursive
|
--recursive
|
||||||
|
|
||||||
|
# Exclude git submodule directories and generated files.
|
||||||
|
--exclude=libpainter
|
||||||
|
--exclude=librfxcodec
|
||||||
|
--exclude=xrdp_configure_options.h
|
||||||
|
|
||||||
|
# ignore errors from generated files that do not exist
|
||||||
|
--ignore-exclude-errors
|
||||||
|
|
||||||
# Preserve the original file's date and time modified.
|
# Preserve the original file's date and time modified.
|
||||||
--preserve-date
|
--preserve-date
|
||||||
|
|
||||||
@ -53,4 +61,3 @@
|
|||||||
--formatted
|
--formatted
|
||||||
|
|
||||||
--lineend=linux
|
--lineend=linux
|
||||||
|
|
||||||
|
@ -537,7 +537,7 @@ g_bytes_to_hexdump(const char *src, int len)
|
|||||||
+ HEX_DUMP_NEWLINE_SIZE);
|
+ HEX_DUMP_NEWLINE_SIZE);
|
||||||
|
|
||||||
dump_number_lines = (len / HEX_DUMP_SOURCE_BYTES_PER_LINE) + 1; /* +1 to round up */
|
dump_number_lines = (len / HEX_DUMP_SOURCE_BYTES_PER_LINE) + 1; /* +1 to round up */
|
||||||
dump_length = (dump_number_lines *dump_line_length /* hex dump lines */
|
dump_length = (dump_number_lines * dump_line_length /* hex dump lines */
|
||||||
+ 1); /* terminating NULL */
|
+ 1); /* terminating NULL */
|
||||||
dump_buffer = (char *)g_malloc(dump_length, 1);
|
dump_buffer = (char *)g_malloc(dump_length, 1);
|
||||||
if (dump_buffer == NULL)
|
if (dump_buffer == NULL)
|
||||||
|
@ -22,7 +22,8 @@
|
|||||||
* xfree86(base)->evdev keycode mapping
|
* xfree86(base)->evdev keycode mapping
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int xfree86_to_evdev[137-8+1] = {
|
int xfree86_to_evdev[137 - 8 + 1] =
|
||||||
|
{
|
||||||
/* MDSW */ 203,
|
/* MDSW */ 203,
|
||||||
/* ESC */ 9,
|
/* ESC */ 9,
|
||||||
/* AE01 */ 10,
|
/* AE01 */ 10,
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
#include <X11/XKBlib.h>
|
#include <X11/XKBlib.h>
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
|
|
||||||
extern int xfree86_to_evdev[137-8+1];
|
extern int xfree86_to_evdev[137 - 8 + 1];
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
@ -52,7 +52,8 @@ int main(int argc, char **argv)
|
|||||||
char text[256];
|
char text[256];
|
||||||
char *displayname = NULL;
|
char *displayname = NULL;
|
||||||
char *outfname;
|
char *outfname;
|
||||||
const char *sections[8] = {
|
const char *sections[8] =
|
||||||
|
{
|
||||||
"noshift", "shift", "altgr", "shiftaltgr",
|
"noshift", "shift", "altgr", "shiftaltgr",
|
||||||
"capslock", "capslockaltgr", "shiftcapslock", "shiftcapslockaltgr"
|
"capslock", "capslockaltgr", "shiftcapslock", "shiftcapslockaltgr"
|
||||||
};
|
};
|
||||||
@ -139,9 +140,13 @@ int main(int argc, char **argv)
|
|||||||
for (i = 8; i < 137; i++) /* Keycodes */
|
for (i = 8; i < 137; i++) /* Keycodes */
|
||||||
{
|
{
|
||||||
if (is_evdev)
|
if (is_evdev)
|
||||||
e.keycode = xfree86_to_evdev[i-8];
|
{
|
||||||
|
e.keycode = xfree86_to_evdev[i - 8];
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
e.keycode = i;
|
e.keycode = i;
|
||||||
|
}
|
||||||
nbytes = XLookupString(&e, text, 255, &ks, NULL);
|
nbytes = XLookupString(&e, text, 255, &ks, NULL);
|
||||||
text[nbytes] = 0;
|
text[nbytes] = 0;
|
||||||
char_count = mbstowcs(wtext, text, 255);
|
char_count = mbstowcs(wtext, text, 255);
|
||||||
|
108
scripts/install_astyle.sh
Executable file
108
scripts/install_astyle.sh
Executable file
@ -0,0 +1,108 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Script to install a version of astyle in ~/astyle.local/
|
||||||
|
#
|
||||||
|
# Used by CI builds
|
||||||
|
#
|
||||||
|
# Currently only supports git repos as sources
|
||||||
|
#
|
||||||
|
# Usage: /path/to/install_astyle.sh <astyle-git-repo> <version-tag>
|
||||||
|
|
||||||
|
INSTALL_ROOT=~/astyle.local
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# U S A G E
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
usage()
|
||||||
|
{
|
||||||
|
echo "** Usage: $0 <svn-tags-url> <tag-name>"
|
||||||
|
echo " e.g. $0 https://svn.code.sf.net/p/astyle/code/tags 3.1"
|
||||||
|
} >&2
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# C A L L _ M A K E
|
||||||
|
#
|
||||||
|
# Calls make with the specified parameters, but only displays the error
|
||||||
|
# log if it fails
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
call_make()
|
||||||
|
{
|
||||||
|
# Disable set -e, if active
|
||||||
|
set_entry_opts=`set +o`
|
||||||
|
set +e
|
||||||
|
|
||||||
|
status=1
|
||||||
|
log=`mktemp /tmp/astyle-log.XXXXXXXXXX`
|
||||||
|
if [ -n "$log" ]; then
|
||||||
|
make "$@" >$log 2>&1
|
||||||
|
status=$?
|
||||||
|
if [ $status -ne 0 ]; then
|
||||||
|
cat $log >&2
|
||||||
|
fi
|
||||||
|
rm $log
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Re-enable `set -e` if active before
|
||||||
|
$set_entry_opts
|
||||||
|
|
||||||
|
return $status
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# M A I N
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
if [ $# -ne 2 ]; then
|
||||||
|
usage
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
REPO_URL="$1"
|
||||||
|
ASTYLE_VER="$2"
|
||||||
|
|
||||||
|
# Already installed?
|
||||||
|
exe=$INSTALL_ROOT/$ASTYLE_VER/usr/bin/astyle
|
||||||
|
if [ -x "$exe" ]; then
|
||||||
|
echo "astyle version $ASTYLE_VER is already installed at $exe" >&2
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
workdir=`mktemp -d /tmp/astyle.XXXXXXXXXX`
|
||||||
|
if [ -z "$workdir" ]; then
|
||||||
|
echo "** Unable to create temporary working directory" 2>&1
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Use a sub-process for the next bit to restrict the scope of 'set -e'
|
||||||
|
(
|
||||||
|
set -e ; # Exit sub-process on first error
|
||||||
|
|
||||||
|
# Put everything in this directory
|
||||||
|
FILESDIR=$INSTALL_ROOT/$ASTYLE_VER
|
||||||
|
|
||||||
|
svn checkout ${REPO_URL}/${ASTYLE_VER}/AStyle $workdir
|
||||||
|
|
||||||
|
cd $workdir
|
||||||
|
|
||||||
|
make_args="DESTDIR=$FILESDIR"
|
||||||
|
|
||||||
|
echo "Creating Makefiles..."
|
||||||
|
cmake .
|
||||||
|
|
||||||
|
echo "Making astyle..."
|
||||||
|
call_make $make_args
|
||||||
|
|
||||||
|
echo "Installing astyle..."
|
||||||
|
mkdir -p $FILESDIR
|
||||||
|
call_make install $make_args
|
||||||
|
# make install DESTDIR=~/astyle.local/3.1
|
||||||
|
)
|
||||||
|
status=$?
|
||||||
|
|
||||||
|
if [ $status -eq 0 ]; then
|
||||||
|
rm -rf $workdir
|
||||||
|
else
|
||||||
|
"** Script failed. Work dir is $workdir" >&2
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit $status
|
6
scripts/install_astyle_dependencies_with_apt.sh
Executable file
6
scripts/install_astyle_dependencies_with_apt.sh
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -eufx
|
||||||
|
|
||||||
|
PACKAGES="subversion cmake"
|
||||||
|
|
||||||
|
apt-get -yq --no-install-suggests --no-install-recommends install $PACKAGES
|
74
scripts/run_astyle.sh
Executable file
74
scripts/run_astyle.sh
Executable file
@ -0,0 +1,74 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Script to run astyle on the code
|
||||||
|
#
|
||||||
|
# Usage: /path/to/run_astyle.sh
|
||||||
|
#
|
||||||
|
# Note: the script must be run from the root directory of the xrdp repository
|
||||||
|
|
||||||
|
INSTALL_ROOT=~/astyle.local
|
||||||
|
ASTYLE_FROM_XRDP=$INSTALL_ROOT/3.1/usr/bin/astyle
|
||||||
|
MIN_ASTYLE_VER="3.1"
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# U S A G E
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
usage()
|
||||||
|
{
|
||||||
|
echo "** Usage: $0"
|
||||||
|
echo " e.g. $0"
|
||||||
|
} >&2
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# M A I N
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
if [ $# -ne 0 ]; then
|
||||||
|
usage
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# check if the built-in astyle meets the minimum requrements
|
||||||
|
ASTYLE_FROM_OS_VER_OUTPUT=`astyle --version | grep "Artistic Style Version" | cut -d' ' -f4`
|
||||||
|
|
||||||
|
ASTYLE=""
|
||||||
|
ERROR_MESSAGE=""
|
||||||
|
if [ ! -z "$ASTYLE_FROM_OS_VER_OUTPUT" ]; then
|
||||||
|
# astyle is installed, so check if it's version meets the minimum requirements
|
||||||
|
LOWEST_VERSION=`echo -e "$MIN_ASTYLE_VER\n$ASTYLE_FROM_OS_VER_OUTPUT" | sort -V | head -n1`
|
||||||
|
if [ "$MIN_ASTYLE_VER" = "$LOWEST_VERSION" ]; then
|
||||||
|
ASTYLE=astyle
|
||||||
|
else
|
||||||
|
ERROR_MESSAGE="The version of astyle installed does not meet the minimum version requirement: >= $MIN_ASTYLE_VER "
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
ERROR_MESSAGE="astyle is not installed on the system path"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$ASTYLE" ]; then
|
||||||
|
# astyle from the os is invlid, fallback to the xrdp version if it is installed
|
||||||
|
if [ -x "$ASTYLE_FROM_XRDP" ]; then
|
||||||
|
ASTYLE="$ASTYLE_FROM_XRDP"
|
||||||
|
ERROR_MESSAGE=""
|
||||||
|
else
|
||||||
|
ERROR_MESSAGE="${ERROR_MESSAGE}\nastyle $MIN_ASTYLE_VER is not installed at the expected path: $ASTYLE_FROM_XRDP"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -z "$ERROR_MESSAGE" ]; then
|
||||||
|
echo "$ERROR_MESSAGE"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f "astyle_config.as" ]; then
|
||||||
|
echo "$0 must be run from the root xrdp repository directory which "
|
||||||
|
echo "contains the 'astyle_config.as' file."
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
ASTYLE_FLAGS="--options=astyle_config.as ./\*.c ./\*.h"
|
||||||
|
|
||||||
|
# Display the astyle version and command for debugging
|
||||||
|
"$ASTYLE" --version && {
|
||||||
|
echo Command: $ASTYLE $ASTYLE_FLAGS
|
||||||
|
"$ASTYLE" $ASTYLE_FLAGS
|
||||||
|
}
|
@ -35,9 +35,9 @@ int
|
|||||||
g_is_term(void);
|
g_is_term(void);
|
||||||
|
|
||||||
int send_channel_data(int chan_id, const char *data, int size);
|
int send_channel_data(int chan_id, const char *data, int size);
|
||||||
int send_rail_drawing_orders(char* data, int size);
|
int send_rail_drawing_orders(char *data, int size);
|
||||||
int main_cleanup(void);
|
int main_cleanup(void);
|
||||||
int add_timeout(int msoffset, void (*callback)(void* data), void* data);
|
int add_timeout(int msoffset, void (*callback)(void *data), void *data);
|
||||||
|
|
||||||
#ifndef GSET_UINT8
|
#ifndef GSET_UINT8
|
||||||
#define GSET_UINT8(_ptr, _offset, _data) \
|
#define GSET_UINT8(_ptr, _offset, _data) \
|
||||||
|
@ -27,10 +27,10 @@
|
|||||||
int devredir_init(void);
|
int devredir_init(void);
|
||||||
int devredir_deinit(void);
|
int devredir_deinit(void);
|
||||||
|
|
||||||
int devredir_data_in(struct stream* s, int chan_id, int chan_flags,
|
int devredir_data_in(struct stream *s, int chan_id, int chan_flags,
|
||||||
int length, int total_length);
|
int length, int total_length);
|
||||||
|
|
||||||
int devredir_get_wait_objs(tbus* objs, int* count, int* timeout);
|
int devredir_get_wait_objs(tbus *objs, int *count, int *timeout);
|
||||||
int devredir_check_wait_objs(void);
|
int devredir_check_wait_objs(void);
|
||||||
|
|
||||||
/* misc stuff */
|
/* misc stuff */
|
||||||
|
@ -16,20 +16,20 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* FIFO implementation to store a pointer to a user struct */
|
/* FIFO implementation to store a pointer to a user struct */
|
||||||
|
|
||||||
typedef struct fifo
|
typedef struct fifo
|
||||||
{
|
{
|
||||||
long* user_data;
|
long *user_data;
|
||||||
int rd_ptr;
|
int rd_ptr;
|
||||||
int wr_ptr;
|
int wr_ptr;
|
||||||
int entries;
|
int entries;
|
||||||
} FIFO;
|
} FIFO;
|
||||||
|
|
||||||
int fifo_init(FIFO* fp, int num_entries);
|
int fifo_init(FIFO *fp, int num_entries);
|
||||||
int fifo_deinit(FIFO* fp);
|
int fifo_deinit(FIFO *fp);
|
||||||
int fifo_is_empty(FIFO* fp);
|
int fifo_is_empty(FIFO *fp);
|
||||||
int fifo_insert(FIFO* fp, void* data);
|
int fifo_insert(FIFO *fp, void *data);
|
||||||
void* fifo_remove(FIFO* fp);
|
void *fifo_remove(FIFO *fp);
|
||||||
void* fifo_peek(FIFO* fp);
|
void *fifo_peek(FIFO *fp);
|
||||||
|
|
||||||
|
@ -105,18 +105,18 @@ struct irp
|
|||||||
void *user_data;
|
void *user_data;
|
||||||
};
|
};
|
||||||
|
|
||||||
IRP * devredir_irp_new(void);
|
IRP *devredir_irp_new(void);
|
||||||
/* As above, but allocates sufficent space for the specified
|
/* As above, but allocates sufficent space for the specified
|
||||||
* pathname, and copies it in to the pathname field */
|
* pathname, and copies it in to the pathname field */
|
||||||
IRP * devredir_irp_with_pathname_new(const char *pathname);
|
IRP *devredir_irp_with_pathname_new(const char *pathname);
|
||||||
/* As above, but specifies a pathname length with pathname
|
/* As above, but specifies a pathname length with pathname
|
||||||
* initially set to "". Use if you need to modify the pathname
|
* initially set to "". Use if you need to modify the pathname
|
||||||
* significantly */
|
* significantly */
|
||||||
IRP * devredir_irp_with_pathnamelen_new(unsigned int pathnamelen);
|
IRP *devredir_irp_with_pathnamelen_new(unsigned int pathnamelen);
|
||||||
int devredir_irp_delete(IRP *irp);
|
int devredir_irp_delete(IRP *irp);
|
||||||
IRP * devredir_irp_find(tui32 completion_id);
|
IRP *devredir_irp_find(tui32 completion_id);
|
||||||
IRP * devredir_irp_find_by_fileid(tui32 FileId);
|
IRP *devredir_irp_find_by_fileid(tui32 FileId);
|
||||||
IRP * devredir_irp_get_last(void);
|
IRP *devredir_irp_get_last(void);
|
||||||
void devredir_irp_dump(void);
|
void devredir_irp_dump(void);
|
||||||
|
|
||||||
#endif /* end ifndef __IRP_H */
|
#endif /* end ifndef __IRP_H */
|
||||||
|
@ -28,10 +28,10 @@ rail_init(void);
|
|||||||
int
|
int
|
||||||
rail_deinit(void);
|
rail_deinit(void);
|
||||||
int
|
int
|
||||||
rail_data_in(struct stream* s, int chan_id, int chan_flags,
|
rail_data_in(struct stream *s, int chan_id, int chan_flags,
|
||||||
int length, int total_length);
|
int length, int total_length);
|
||||||
int
|
int
|
||||||
rail_xevent(void* xevent);
|
rail_xevent(void *xevent);
|
||||||
int rail_request_title(int window_id);
|
int rail_request_title(int window_id);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -122,16 +122,16 @@ int scard_send_list_readers(void *user_data,
|
|||||||
int scard_send_get_status_change(void *user_data,
|
int scard_send_get_status_change(void *user_data,
|
||||||
char *context, int context_bytes,
|
char *context, int context_bytes,
|
||||||
int wide, tui32 timeout,
|
int wide, tui32 timeout,
|
||||||
tui32 num_readers, READER_STATE* rsa);
|
tui32 num_readers, READER_STATE *rsa);
|
||||||
|
|
||||||
int scard_send_connect(void *user_data,
|
int scard_send_connect(void *user_data,
|
||||||
char *context, int context_bytes, int wide,
|
char *context, int context_bytes, int wide,
|
||||||
READER_STATE* rs);
|
READER_STATE *rs);
|
||||||
|
|
||||||
int scard_send_reconnect(void *user_data,
|
int scard_send_reconnect(void *user_data,
|
||||||
char *context, int context_bytes,
|
char *context, int context_bytes,
|
||||||
char *card, int card_bytes,
|
char *card, int card_bytes,
|
||||||
READER_STATE* rs);
|
READER_STATE *rs);
|
||||||
|
|
||||||
int scard_send_begin_transaction(void *user_data,
|
int scard_send_begin_transaction(void *user_data,
|
||||||
char *context, int context_bytes,
|
char *context, int context_bytes,
|
||||||
@ -166,7 +166,7 @@ int scard_send_cancel(void *user_data,
|
|||||||
char *context, int context_bytes);
|
char *context, int context_bytes);
|
||||||
|
|
||||||
int scard_send_get_attrib(void *user_data, char *card, int card_bytes,
|
int scard_send_get_attrib(void *user_data, char *card, int card_bytes,
|
||||||
READER_STATE* rs);
|
READER_STATE *rs);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Notes:
|
* Notes:
|
||||||
|
@ -52,10 +52,10 @@
|
|||||||
|
|
||||||
int sound_init(void);
|
int sound_init(void);
|
||||||
int sound_deinit(void);
|
int sound_deinit(void);
|
||||||
int sound_get_wait_objs(tbus* objs, int* count, int* timeout);
|
int sound_get_wait_objs(tbus *objs, int *count, int *timeout);
|
||||||
int sound_check_wait_objs(void);
|
int sound_check_wait_objs(void);
|
||||||
|
|
||||||
int sound_data_in(struct stream* s, int chan_id, int chan_flags,
|
int sound_data_in(struct stream *s, int chan_id, int chan_flags,
|
||||||
int length, int total_length);
|
int length, int total_length);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -33,7 +33,7 @@ xcommon_get_local_time(void);
|
|||||||
int
|
int
|
||||||
xcommon_init(void);
|
xcommon_init(void);
|
||||||
int
|
int
|
||||||
xcommon_get_wait_objs(tbus* objs, int* count, int* timeout);
|
xcommon_get_wait_objs(tbus *objs, int *count, int *timeout);
|
||||||
int
|
int
|
||||||
xcommon_check_wait_objs(void);
|
xcommon_check_wait_objs(void);
|
||||||
void
|
void
|
||||||
|
@ -77,13 +77,15 @@
|
|||||||
#define SESMAN_CFG_SESS_POLICY_UBDI_S "UBDI"
|
#define SESMAN_CFG_SESS_POLICY_UBDI_S "UBDI"
|
||||||
#define SESMAN_CFG_SESS_POLICY_UBDC_S "UBDC"
|
#define SESMAN_CFG_SESS_POLICY_UBDC_S "UBDC"
|
||||||
|
|
||||||
enum SESMAN_CFG_SESS_POLICY_BITS {
|
enum SESMAN_CFG_SESS_POLICY_BITS
|
||||||
|
{
|
||||||
SESMAN_CFG_SESS_POLICY_D = 0x01,
|
SESMAN_CFG_SESS_POLICY_D = 0x01,
|
||||||
SESMAN_CFG_SESS_POLICY_I = 0x02,
|
SESMAN_CFG_SESS_POLICY_I = 0x02,
|
||||||
SESMAN_CFG_SESS_POLICY_C = 0x04
|
SESMAN_CFG_SESS_POLICY_C = 0x04
|
||||||
};
|
};
|
||||||
|
|
||||||
enum SESMAN_CFG_SESS_POLICY {
|
enum SESMAN_CFG_SESS_POLICY
|
||||||
|
{
|
||||||
SESMAN_CFG_SESS_POLICY_DFLT = 0,
|
SESMAN_CFG_SESS_POLICY_DFLT = 0,
|
||||||
SESMAN_CFG_SESS_POLICY_UBD = SESMAN_CFG_SESS_POLICY_D,
|
SESMAN_CFG_SESS_POLICY_UBD = SESMAN_CFG_SESS_POLICY_D,
|
||||||
SESMAN_CFG_SESS_POLICY_UBI = SESMAN_CFG_SESS_POLICY_I,
|
SESMAN_CFG_SESS_POLICY_UBI = SESMAN_CFG_SESS_POLICY_I,
|
||||||
@ -226,22 +228,22 @@ struct config_sesman
|
|||||||
* @var auth_file_path
|
* @var auth_file_path
|
||||||
* @brief Auth file path
|
* @brief Auth file path
|
||||||
*/
|
*/
|
||||||
char* auth_file_path;
|
char *auth_file_path;
|
||||||
/**
|
/**
|
||||||
* @var vnc_params
|
* @var vnc_params
|
||||||
* @brief Xvnc additional parameter list
|
* @brief Xvnc additional parameter list
|
||||||
*/
|
*/
|
||||||
struct list* vnc_params;
|
struct list *vnc_params;
|
||||||
/**
|
/**
|
||||||
* @var rdp_params
|
* @var rdp_params
|
||||||
* @brief X11rdp additional parameter list
|
* @brief X11rdp additional parameter list
|
||||||
*/
|
*/
|
||||||
struct list* rdp_params;
|
struct list *rdp_params;
|
||||||
/**
|
/**
|
||||||
* @var xorg_params
|
* @var xorg_params
|
||||||
* @brief Xorg additional parameter list
|
* @brief Xorg additional parameter list
|
||||||
*/
|
*/
|
||||||
struct list* xorg_params;
|
struct list *xorg_params;
|
||||||
/**
|
/**
|
||||||
* @var log
|
* @var log
|
||||||
* @brief Log configuration struct
|
* @brief Log configuration struct
|
||||||
@ -262,12 +264,12 @@ struct config_sesman
|
|||||||
* @var env_names
|
* @var env_names
|
||||||
* @brief environment variable name list
|
* @brief environment variable name list
|
||||||
*/
|
*/
|
||||||
struct list* env_names;
|
struct list *env_names;
|
||||||
/**
|
/**
|
||||||
* @var env_values
|
* @var env_values
|
||||||
* @brief environment variable value list
|
* @brief environment variable value list
|
||||||
*/
|
*/
|
||||||
struct list* env_values;
|
struct list *env_values;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -279,7 +281,7 @@ struct config_sesman
|
|||||||
* @post pass return value to config_free() to prevent memory leaks
|
* @post pass return value to config_free() to prevent memory leaks
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
struct config_sesman*
|
struct config_sesman *
|
||||||
config_read(const char *sesman_ini);
|
config_read(const char *sesman_ini);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
* @return a struct SCP_CONNECTION* object on success, NULL otherwise
|
* @return a struct SCP_CONNECTION* object on success, NULL otherwise
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
struct SCP_CONNECTION*
|
struct SCP_CONNECTION *
|
||||||
scp_connection_create(int sck);
|
scp_connection_create(int sck);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -47,6 +47,6 @@ scp_connection_create(int sck);
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
scp_connection_destroy(struct SCP_CONNECTION* c);
|
scp_connection_destroy(struct SCP_CONNECTION *c);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -37,59 +37,59 @@
|
|||||||
* @return a struct SCP_SESSION* object on success, NULL otherwise
|
* @return a struct SCP_SESSION* object on success, NULL otherwise
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
struct SCP_SESSION*
|
struct SCP_SESSION *
|
||||||
scp_session_create(void);
|
scp_session_create(void);
|
||||||
|
|
||||||
int
|
int
|
||||||
scp_session_set_type(struct SCP_SESSION* s, tui8 type);
|
scp_session_set_type(struct SCP_SESSION *s, tui8 type);
|
||||||
|
|
||||||
int
|
int
|
||||||
scp_session_set_version(struct SCP_SESSION* s, tui32 version);
|
scp_session_set_version(struct SCP_SESSION *s, tui32 version);
|
||||||
|
|
||||||
int
|
int
|
||||||
scp_session_set_height(struct SCP_SESSION* s, tui16 h);
|
scp_session_set_height(struct SCP_SESSION *s, tui16 h);
|
||||||
|
|
||||||
int
|
int
|
||||||
scp_session_set_width(struct SCP_SESSION* s, tui16 w);
|
scp_session_set_width(struct SCP_SESSION *s, tui16 w);
|
||||||
|
|
||||||
int
|
int
|
||||||
scp_session_set_bpp(struct SCP_SESSION* s, tui8 bpp);
|
scp_session_set_bpp(struct SCP_SESSION *s, tui8 bpp);
|
||||||
|
|
||||||
int
|
int
|
||||||
scp_session_set_rsr(struct SCP_SESSION* s, tui8 rsr);
|
scp_session_set_rsr(struct SCP_SESSION *s, tui8 rsr);
|
||||||
|
|
||||||
int
|
int
|
||||||
scp_session_set_locale(struct SCP_SESSION* s, const char *str);
|
scp_session_set_locale(struct SCP_SESSION *s, const char *str);
|
||||||
|
|
||||||
int
|
int
|
||||||
scp_session_set_username(struct SCP_SESSION* s, const char *str);
|
scp_session_set_username(struct SCP_SESSION *s, const char *str);
|
||||||
|
|
||||||
int
|
int
|
||||||
scp_session_set_password(struct SCP_SESSION* s, const char *str);
|
scp_session_set_password(struct SCP_SESSION *s, const char *str);
|
||||||
|
|
||||||
int
|
int
|
||||||
scp_session_set_domain(struct SCP_SESSION* s, const char *str);
|
scp_session_set_domain(struct SCP_SESSION *s, const char *str);
|
||||||
|
|
||||||
int
|
int
|
||||||
scp_session_set_program(struct SCP_SESSION* s, const char *str);
|
scp_session_set_program(struct SCP_SESSION *s, const char *str);
|
||||||
|
|
||||||
int
|
int
|
||||||
scp_session_set_directory(struct SCP_SESSION* s, const char *str);
|
scp_session_set_directory(struct SCP_SESSION *s, const char *str);
|
||||||
|
|
||||||
int
|
int
|
||||||
scp_session_set_client_ip(struct SCP_SESSION* s, const char *str);
|
scp_session_set_client_ip(struct SCP_SESSION *s, const char *str);
|
||||||
|
|
||||||
int
|
int
|
||||||
scp_session_set_hostname(struct SCP_SESSION* s, const char *str);
|
scp_session_set_hostname(struct SCP_SESSION *s, const char *str);
|
||||||
|
|
||||||
int
|
int
|
||||||
scp_session_set_addr(struct SCP_SESSION* s, int type, const void* addr);
|
scp_session_set_addr(struct SCP_SESSION *s, int type, const void *addr);
|
||||||
|
|
||||||
int
|
int
|
||||||
scp_session_set_display(struct SCP_SESSION* s, SCP_DISPLAY display);
|
scp_session_set_display(struct SCP_SESSION *s, SCP_DISPLAY display);
|
||||||
|
|
||||||
int
|
int
|
||||||
scp_session_set_errstr(struct SCP_SESSION* s, const char *str);
|
scp_session_set_errstr(struct SCP_SESSION *s, const char *str);
|
||||||
|
|
||||||
int
|
int
|
||||||
scp_session_set_guid(struct SCP_SESSION *s, const tui8 *guid);
|
scp_session_set_guid(struct SCP_SESSION *s, const tui8 *guid);
|
||||||
@ -101,6 +101,6 @@ scp_session_set_guid(struct SCP_SESSION *s, const tui8 *guid);
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
scp_session_destroy(struct SCP_SESSION* s);
|
scp_session_destroy(struct SCP_SESSION *s);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
scp_tcp_force_recv(int sck, char* data, int len);
|
scp_tcp_force_recv(int sck, char *data, int len);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -51,7 +51,7 @@ scp_tcp_force_recv(int sck, char* data, int len);
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
scp_tcp_force_send(int sck, char* data, int len);
|
scp_tcp_force_send(int sck, char *data, int len);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -63,6 +63,6 @@ scp_tcp_force_send(int sck, char* data, int len);
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
scp_tcp_bind(int sck, char* addr, char* port);
|
scp_tcp_bind(int sck, char *addr, char *port);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -66,8 +66,8 @@
|
|||||||
struct SCP_CONNECTION
|
struct SCP_CONNECTION
|
||||||
{
|
{
|
||||||
int in_sck;
|
int in_sck;
|
||||||
struct stream* in_s;
|
struct stream *in_s;
|
||||||
struct stream* out_s;
|
struct stream *out_s;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SCP_SESSION
|
struct SCP_SESSION
|
||||||
@ -79,19 +79,19 @@ struct SCP_SESSION
|
|||||||
tui8 bpp;
|
tui8 bpp;
|
||||||
tui8 rsr;
|
tui8 rsr;
|
||||||
char locale[18];
|
char locale[18];
|
||||||
char* username;
|
char *username;
|
||||||
char* password;
|
char *password;
|
||||||
char* hostname;
|
char *hostname;
|
||||||
tui8 addr_type;
|
tui8 addr_type;
|
||||||
tui32 ipv4addr;
|
tui32 ipv4addr;
|
||||||
tui8 ipv6addr[16];
|
tui8 ipv6addr[16];
|
||||||
SCP_DISPLAY display;
|
SCP_DISPLAY display;
|
||||||
char* errstr;
|
char *errstr;
|
||||||
struct SCP_MNG_DATA* mng;
|
struct SCP_MNG_DATA *mng;
|
||||||
char* domain;
|
char *domain;
|
||||||
char* program;
|
char *program;
|
||||||
char* directory;
|
char *directory;
|
||||||
char* client_ip;
|
char *client_ip;
|
||||||
tui8 guid[16];
|
tui8 guid[16];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
enum SCP_CLIENT_STATES_E
|
enum SCP_CLIENT_STATES_E
|
||||||
scp_v0c_connect(struct SCP_CONNECTION* c, struct SCP_SESSION* s);
|
scp_v0c_connect(struct SCP_CONNECTION *c, struct SCP_SESSION *s);
|
||||||
|
|
||||||
/* server API */
|
/* server API */
|
||||||
/**
|
/**
|
||||||
@ -52,7 +52,7 @@ scp_v0c_connect(struct SCP_CONNECTION* c, struct SCP_SESSION* s);
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
enum SCP_SERVER_STATES_E
|
enum SCP_SERVER_STATES_E
|
||||||
scp_v0s_accept(struct SCP_CONNECTION* c, struct SCP_SESSION** s, int skipVchk);
|
scp_v0s_accept(struct SCP_CONNECTION *c, struct SCP_SESSION **s, int skipVchk);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -61,7 +61,7 @@ scp_v0s_accept(struct SCP_CONNECTION* c, struct SCP_SESSION** s, int skipVchk);
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
enum SCP_SERVER_STATES_E
|
enum SCP_SERVER_STATES_E
|
||||||
scp_v0s_allow_connection(struct SCP_CONNECTION* c, SCP_DISPLAY d, const tui8 *guid);
|
scp_v0s_allow_connection(struct SCP_CONNECTION *c, SCP_DISPLAY d, const tui8 *guid);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -70,7 +70,7 @@ scp_v0s_allow_connection(struct SCP_CONNECTION* c, SCP_DISPLAY d, const tui8 *gu
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
enum SCP_SERVER_STATES_E
|
enum SCP_SERVER_STATES_E
|
||||||
scp_v0s_deny_connection(struct SCP_CONNECTION* c);
|
scp_v0s_deny_connection(struct SCP_CONNECTION *c);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief send reply to an authentication request
|
* @brief send reply to an authentication request
|
||||||
@ -79,6 +79,6 @@ scp_v0s_deny_connection(struct SCP_CONNECTION* c);
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
enum SCP_SERVER_STATES_E
|
enum SCP_SERVER_STATES_E
|
||||||
scp_v0s_replyauthentication(struct SCP_CONNECTION* c, unsigned short int value);
|
scp_v0s_replyauthentication(struct SCP_CONNECTION *c, unsigned short int value);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -32,32 +32,32 @@
|
|||||||
/* client API */
|
/* client API */
|
||||||
/* 001 */
|
/* 001 */
|
||||||
enum SCP_CLIENT_STATES_E
|
enum SCP_CLIENT_STATES_E
|
||||||
scp_v1c_connect(struct SCP_CONNECTION* c, struct SCP_SESSION* s);
|
scp_v1c_connect(struct SCP_CONNECTION *c, struct SCP_SESSION *s);
|
||||||
|
|
||||||
/* 004 */
|
/* 004 */
|
||||||
enum SCP_CLIENT_STATES_E
|
enum SCP_CLIENT_STATES_E
|
||||||
scp_v1c_resend_credentials(struct SCP_CONNECTION* c, struct SCP_SESSION* s);
|
scp_v1c_resend_credentials(struct SCP_CONNECTION *c, struct SCP_SESSION *s);
|
||||||
|
|
||||||
/* 021 */
|
/* 021 */
|
||||||
enum SCP_CLIENT_STATES_E
|
enum SCP_CLIENT_STATES_E
|
||||||
scp_v1c_pwd_change(struct SCP_CONNECTION* c, char* newpass);
|
scp_v1c_pwd_change(struct SCP_CONNECTION *c, char *newpass);
|
||||||
|
|
||||||
/* 022 */
|
/* 022 */
|
||||||
enum SCP_CLIENT_STATES_E
|
enum SCP_CLIENT_STATES_E
|
||||||
scp_v1c_pwd_change_cancel(struct SCP_CONNECTION* c);
|
scp_v1c_pwd_change_cancel(struct SCP_CONNECTION *c);
|
||||||
|
|
||||||
/* 041 */
|
/* 041 */
|
||||||
enum SCP_CLIENT_STATES_E
|
enum SCP_CLIENT_STATES_E
|
||||||
scp_v1c_get_session_list(struct SCP_CONNECTION* c, int* scount,
|
scp_v1c_get_session_list(struct SCP_CONNECTION *c, int *scount,
|
||||||
struct SCP_DISCONNECTED_SESSION** s);
|
struct SCP_DISCONNECTED_SESSION **s);
|
||||||
|
|
||||||
/* 043 */
|
/* 043 */
|
||||||
enum SCP_CLIENT_STATES_E
|
enum SCP_CLIENT_STATES_E
|
||||||
scp_v1c_select_session(struct SCP_CONNECTION* c, struct SCP_SESSION* s,
|
scp_v1c_select_session(struct SCP_CONNECTION *c, struct SCP_SESSION *s,
|
||||||
SCP_SID sid);
|
SCP_SID sid);
|
||||||
|
|
||||||
/* 044 */
|
/* 044 */
|
||||||
enum SCP_CLIENT_STATES_E
|
enum SCP_CLIENT_STATES_E
|
||||||
scp_v1c_select_session_cancel(struct SCP_CONNECTION* c);
|
scp_v1c_select_session_cancel(struct SCP_CONNECTION *c);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
/* client API */
|
/* client API */
|
||||||
/* 001 */
|
/* 001 */
|
||||||
enum SCP_CLIENT_STATES_E
|
enum SCP_CLIENT_STATES_E
|
||||||
scp_v1c_mng_connect(struct SCP_CONNECTION* c, struct SCP_SESSION* s);
|
scp_v1c_mng_connect(struct SCP_CONNECTION *c, struct SCP_SESSION *s);
|
||||||
|
|
||||||
/* 004 * /
|
/* 004 * /
|
||||||
enum SCP_CLIENT_STATES_E
|
enum SCP_CLIENT_STATES_E
|
||||||
@ -49,7 +49,7 @@ scp_v1c_pwd_change_cancel(struct SCP_CONNECTION* c);
|
|||||||
|
|
||||||
/* 041 */
|
/* 041 */
|
||||||
enum SCP_CLIENT_STATES_E
|
enum SCP_CLIENT_STATES_E
|
||||||
scp_v1c_mng_get_session_list(struct SCP_CONNECTION* c, int* scount,
|
scp_v1c_mng_get_session_list(struct SCP_CONNECTION *c, int *scount,
|
||||||
struct SCP_DISCONNECTED_SESSION** s);
|
struct SCP_DISCONNECTED_SESSION **s);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
* that should be free()d
|
* that should be free()d
|
||||||
*/
|
*/
|
||||||
enum SCP_SERVER_STATES_E
|
enum SCP_SERVER_STATES_E
|
||||||
scp_v1s_accept(struct SCP_CONNECTION* c, struct SCP_SESSION** s, int skipVchk);
|
scp_v1s_accept(struct SCP_CONNECTION *c, struct SCP_SESSION **s, int skipVchk);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -53,35 +53,35 @@ scp_v1s_accept(struct SCP_CONNECTION* c, struct SCP_SESSION** s, int skipVchk);
|
|||||||
*/
|
*/
|
||||||
/* 002 */
|
/* 002 */
|
||||||
enum SCP_SERVER_STATES_E
|
enum SCP_SERVER_STATES_E
|
||||||
scp_v1s_deny_connection(struct SCP_CONNECTION* c, const char *reason);
|
scp_v1s_deny_connection(struct SCP_CONNECTION *c, const char *reason);
|
||||||
|
|
||||||
enum SCP_SERVER_STATES_E
|
enum SCP_SERVER_STATES_E
|
||||||
scp_v1s_request_password(struct SCP_CONNECTION* c, struct SCP_SESSION* s,
|
scp_v1s_request_password(struct SCP_CONNECTION *c, struct SCP_SESSION *s,
|
||||||
const char *reason);
|
const char *reason);
|
||||||
|
|
||||||
/* 020 */
|
/* 020 */
|
||||||
enum SCP_SERVER_STATES_E
|
enum SCP_SERVER_STATES_E
|
||||||
scp_v1s_request_pwd_change(struct SCP_CONNECTION* c, char* reason, char* npw);
|
scp_v1s_request_pwd_change(struct SCP_CONNECTION *c, char *reason, char *npw);
|
||||||
|
|
||||||
/* 023 */
|
/* 023 */
|
||||||
enum SCP_SERVER_STATES_E
|
enum SCP_SERVER_STATES_E
|
||||||
scp_v1s_pwd_change_error(struct SCP_CONNECTION* c, char* error, int retry, char* npw);
|
scp_v1s_pwd_change_error(struct SCP_CONNECTION *c, char *error, int retry, char *npw);
|
||||||
|
|
||||||
/* 030 */
|
/* 030 */
|
||||||
enum SCP_SERVER_STATES_E
|
enum SCP_SERVER_STATES_E
|
||||||
scp_v1s_connect_new_session(struct SCP_CONNECTION* c, SCP_DISPLAY d);
|
scp_v1s_connect_new_session(struct SCP_CONNECTION *c, SCP_DISPLAY d);
|
||||||
|
|
||||||
/* 032 */
|
/* 032 */
|
||||||
enum SCP_SERVER_STATES_E
|
enum SCP_SERVER_STATES_E
|
||||||
scp_v1s_connection_error(struct SCP_CONNECTION* c, const char *error);
|
scp_v1s_connection_error(struct SCP_CONNECTION *c, const char *error);
|
||||||
|
|
||||||
/* 040 */
|
/* 040 */
|
||||||
enum SCP_SERVER_STATES_E
|
enum SCP_SERVER_STATES_E
|
||||||
scp_v1s_list_sessions(struct SCP_CONNECTION* c, int sescnt,
|
scp_v1s_list_sessions(struct SCP_CONNECTION *c, int sescnt,
|
||||||
struct SCP_DISCONNECTED_SESSION* ds, SCP_SID* sid);
|
struct SCP_DISCONNECTED_SESSION *ds, SCP_SID *sid);
|
||||||
|
|
||||||
/* 046 was: 031 struct SCP_DISCONNECTED_SESSION* ds, */
|
/* 046 was: 031 struct SCP_DISCONNECTED_SESSION* ds, */
|
||||||
enum SCP_SERVER_STATES_E
|
enum SCP_SERVER_STATES_E
|
||||||
scp_v1s_reconnect_session(struct SCP_CONNECTION* c, SCP_DISPLAY d);
|
scp_v1s_reconnect_session(struct SCP_CONNECTION *c, SCP_DISPLAY d);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
* that should be free()d
|
* that should be free()d
|
||||||
*/
|
*/
|
||||||
enum SCP_SERVER_STATES_E
|
enum SCP_SERVER_STATES_E
|
||||||
scp_v1s_mng_accept(struct SCP_CONNECTION* c, struct SCP_SESSION** s);
|
scp_v1s_mng_accept(struct SCP_CONNECTION *c, struct SCP_SESSION **s);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -50,7 +50,7 @@ scp_v1s_mng_accept(struct SCP_CONNECTION* c, struct SCP_SESSION** s);
|
|||||||
*/
|
*/
|
||||||
/* 002 */
|
/* 002 */
|
||||||
enum SCP_SERVER_STATES_E
|
enum SCP_SERVER_STATES_E
|
||||||
scp_v1s_mng_allow_connection(struct SCP_CONNECTION* c, struct SCP_SESSION* s);
|
scp_v1s_mng_allow_connection(struct SCP_CONNECTION *c, struct SCP_SESSION *s);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -61,7 +61,7 @@ scp_v1s_mng_allow_connection(struct SCP_CONNECTION* c, struct SCP_SESSION* s);
|
|||||||
*/
|
*/
|
||||||
/* 003 */
|
/* 003 */
|
||||||
enum SCP_SERVER_STATES_E
|
enum SCP_SERVER_STATES_E
|
||||||
scp_v1s_mng_deny_connection(struct SCP_CONNECTION* c, const char *reason);
|
scp_v1s_mng_deny_connection(struct SCP_CONNECTION *c, const char *reason);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -71,8 +71,8 @@ scp_v1s_mng_deny_connection(struct SCP_CONNECTION* c, const char *reason);
|
|||||||
*/
|
*/
|
||||||
/* 006 */
|
/* 006 */
|
||||||
enum SCP_SERVER_STATES_E
|
enum SCP_SERVER_STATES_E
|
||||||
scp_v1s_mng_list_sessions(struct SCP_CONNECTION* c, struct SCP_SESSION* s,
|
scp_v1s_mng_list_sessions(struct SCP_CONNECTION *c, struct SCP_SESSION *s,
|
||||||
int sescnt, struct SCP_DISCONNECTED_SESSION* ds);
|
int sescnt, struct SCP_DISCONNECTED_SESSION *ds);
|
||||||
// SCP_SID* sid);
|
// SCP_SID* sid);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -42,6 +42,6 @@
|
|||||||
* It this memory needs to be g_free()d
|
* It this memory needs to be g_free()d
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
enum SCP_SERVER_STATES_E scp_vXs_accept(struct SCP_CONNECTION* c, struct SCP_SESSION** s);
|
enum SCP_SERVER_STATES_E scp_vXs_accept(struct SCP_CONNECTION *c, struct SCP_SESSION **s);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
* @param socket the connection socket
|
* @param socket the connection socket
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void*
|
void *
|
||||||
scp_process_start(void* sck);
|
scp_process_start(void *sck);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -38,6 +38,6 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
scp_v0_process(struct SCP_CONNECTION* c, struct SCP_SESSION* s);
|
scp_v0_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -36,6 +36,6 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
scp_v1_process(struct SCP_CONNECTION* c, struct SCP_SESSION* s);
|
scp_v1_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -36,6 +36,6 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
scp_v1_mng_process(struct SCP_CONNECTION* c, struct SCP_SESSION* s);
|
scp_v1_mng_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -81,8 +81,8 @@ struct session_item
|
|||||||
|
|
||||||
struct session_chain
|
struct session_chain
|
||||||
{
|
{
|
||||||
struct session_chain* next;
|
struct session_chain *next;
|
||||||
struct session_item* item;
|
struct session_item *item;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -91,11 +91,11 @@ struct session_chain
|
|||||||
* @return session data or 0
|
* @return session data or 0
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
struct session_item*
|
struct session_item *
|
||||||
session_get_bydata(const char *name, int width, int height, int bpp, int type,
|
session_get_bydata(const char *name, int width, int height, int bpp, int type,
|
||||||
const char *client_ip);
|
const char *client_ip);
|
||||||
#ifndef session_find_item
|
#ifndef session_find_item
|
||||||
#define session_find_item(a, b, c, d, e, f) session_get_bydata(a, b, c, d, e, f);
|
#define session_find_item(a, b, c, d, e, f) session_get_bydata(a, b, c, d, e, f);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -137,7 +137,7 @@ session_sigkill_all(void);
|
|||||||
* @return a pointer to the session descriptor on success, NULL otherwise
|
* @return a pointer to the session descriptor on success, NULL otherwise
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
struct session_item*
|
struct session_item *
|
||||||
session_get_bypid(int pid);
|
session_get_bypid(int pid);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -147,7 +147,7 @@ session_get_bypid(int pid);
|
|||||||
* @return a pointer to the session descriptor on success, NULL otherwise
|
* @return a pointer to the session descriptor on success, NULL otherwise
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
struct SCP_DISCONNECTED_SESSION*
|
struct SCP_DISCONNECTED_SESSION *
|
||||||
session_get_byuser(const char *user, int *cnt, unsigned char flags);
|
session_get_byuser(const char *user, int *cnt, unsigned char flags);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -59,7 +59,7 @@ sig_sesman_session_end(int sig);
|
|||||||
* @brief signal handling thread
|
* @brief signal handling thread
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void*
|
void *
|
||||||
sig_handler_thread(void* arg);
|
sig_handler_thread(void *arg);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
tcp_force_recv(int sck, char* data, int len);
|
tcp_force_recv(int sck, char *data, int len);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -49,7 +49,7 @@ tcp_force_recv(int sck, char* data, int len);
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
tcp_force_send(int sck, char* data, int len);
|
tcp_force_send(int sck, char *data, int len);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -61,6 +61,6 @@ tcp_force_send(int sck, char* data, int len);
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
tcp_bind(int sck, char* addr, char* port);
|
tcp_bind(int sck, char *addr, char *port);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -17,19 +17,20 @@
|
|||||||
|
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui
|
||||||
class MainWindow;
|
{
|
||||||
|
class MainWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
class MainWindow : public QMainWindow
|
class MainWindow : public QMainWindow
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit MainWindow(QWidget *parent = 0);
|
explicit MainWindow(QWidget *parent = 0);
|
||||||
~MainWindow();
|
~MainWindow();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::MainWindow *ui;
|
Ui::MainWindow *ui;
|
||||||
void *wtsChannel;
|
void *wtsChannel;
|
||||||
QSystemTrayIcon *trayIcon;
|
QSystemTrayIcon *trayIcon;
|
||||||
@ -44,9 +45,9 @@ private:
|
|||||||
int initWtsChannel();
|
int initWtsChannel();
|
||||||
int deinitWtsChannel();
|
int deinitWtsChannel();
|
||||||
void setStatusMsg(QString msg);
|
void setStatusMsg(QString msg);
|
||||||
void closeEvent(QCloseEvent * event);
|
void closeEvent(QCloseEvent *event);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onBtnRefreshClicked();
|
void onBtnRefreshClicked();
|
||||||
void onBtnUnmountClicked();
|
void onBtnUnmountClicked();
|
||||||
void onActionQuit();
|
void onActionQuit();
|
||||||
|
@ -14,73 +14,73 @@
|
|||||||
|
|
||||||
typedef struct stream
|
typedef struct stream
|
||||||
{
|
{
|
||||||
char* data; /* holds stream data */
|
char *data; /* holds stream data */
|
||||||
char* pos; /* current read/write position */
|
char *pos; /* current read/write position */
|
||||||
int size; /* number of bytes in data */
|
int size; /* number of bytes in data */
|
||||||
} STREAM;
|
} STREAM;
|
||||||
|
|
||||||
#define qstream_new(_s, _size) \
|
#define qstream_new(_s, _size) \
|
||||||
do \
|
do \
|
||||||
{ \
|
{ \
|
||||||
(_s).data = (char *) malloc(_size); \
|
(_s).data = (char *) malloc(_size); \
|
||||||
(_s).pos = (_s).data; \
|
(_s).pos = (_s).data; \
|
||||||
(_s).size = (_size); \
|
(_s).size = (_size); \
|
||||||
} \
|
} \
|
||||||
while (0)
|
while (0)
|
||||||
|
|
||||||
#define qstream_new_zero(_s, _size) \
|
#define qstream_new_zero(_s, _size) \
|
||||||
do \
|
do \
|
||||||
{ \
|
{ \
|
||||||
(_s).data = (char *) calloc((_size), 1); \
|
(_s).data = (char *) calloc((_size), 1); \
|
||||||
(_s).pos = (_s).data; \
|
(_s).pos = (_s).data; \
|
||||||
(_s).size = (_size); \
|
(_s).size = (_size); \
|
||||||
} \
|
} \
|
||||||
while (0)
|
while (0)
|
||||||
|
|
||||||
#define qstream_free(_s) \
|
#define qstream_free(_s) \
|
||||||
do \
|
do \
|
||||||
{ \
|
{ \
|
||||||
if ((_s)->data) \
|
if ((_s)->data) \
|
||||||
free((_s)->data); \
|
free((_s)->data); \
|
||||||
} \
|
} \
|
||||||
while (0)
|
while (0)
|
||||||
|
|
||||||
#define qstream_set_pos(_s, _p) \
|
#define qstream_set_pos(_s, _p) \
|
||||||
do \
|
do \
|
||||||
{ \
|
{ \
|
||||||
(_s)->pos = (_s)->data + (_p); \
|
(_s)->pos = (_s)->data + (_p); \
|
||||||
} \
|
} \
|
||||||
while (0)
|
while (0)
|
||||||
|
|
||||||
#define qstream_inc_pos(_s, _v) \
|
#define qstream_inc_pos(_s, _v) \
|
||||||
do \
|
do \
|
||||||
{ \
|
{ \
|
||||||
(_s)->pos += (_v); \
|
(_s)->pos += (_v); \
|
||||||
} \
|
} \
|
||||||
while (0)
|
while (0)
|
||||||
|
|
||||||
#define qstream_rd_u8(_s, _v) \
|
#define qstream_rd_u8(_s, _v) \
|
||||||
do \
|
do \
|
||||||
{ \
|
{ \
|
||||||
(_v) = *((unsigned char *) ((_s)->pos)); \
|
(_v) = *((unsigned char *) ((_s)->pos)); \
|
||||||
(_s)->pos++; \
|
(_s)->pos++; \
|
||||||
} \
|
} \
|
||||||
while (0)
|
while (0)
|
||||||
|
|
||||||
#define qstream_rd_u16(_s, _v) \
|
#define qstream_rd_u16(_s, _v) \
|
||||||
do \
|
do \
|
||||||
{ \
|
{ \
|
||||||
(_v) = (unsigned short) \
|
(_v) = (unsigned short) \
|
||||||
( \
|
( \
|
||||||
(*((unsigned char *) ((_s)->pos + 0)) << 0) | \
|
(*((unsigned char *) ((_s)->pos + 0)) << 0) | \
|
||||||
(*((unsigned char *) ((_s)->pos + 1)) << 8) \
|
(*((unsigned char *) ((_s)->pos + 1)) << 8) \
|
||||||
); \
|
); \
|
||||||
(_s)->pos += 2; \
|
(_s)->pos += 2; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define qstream_rd_u32(_s, _v) \
|
#define qstream_rd_u32(_s, _v) \
|
||||||
do \
|
do \
|
||||||
{ \
|
{ \
|
||||||
(_v) = (unsigned int) \
|
(_v) = (unsigned int) \
|
||||||
( \
|
( \
|
||||||
(*((unsigned char *) ((_s)->pos + 0)) << 0) | \
|
(*((unsigned char *) ((_s)->pos + 0)) << 0) | \
|
||||||
@ -89,27 +89,27 @@ do \
|
|||||||
(*((unsigned char *) ((_s)->pos + 3)) << 24) \
|
(*((unsigned char *) ((_s)->pos + 3)) << 24) \
|
||||||
); \
|
); \
|
||||||
(_s)->pos += 4; \
|
(_s)->pos += 4; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define qstream_wr_u8(_s, _v) \
|
#define qstream_wr_u8(_s, _v) \
|
||||||
do \
|
do \
|
||||||
{ \
|
{ \
|
||||||
*((_s)->pos) = (unsigned char) (_v); \
|
*((_s)->pos) = (unsigned char) (_v); \
|
||||||
(_s)->pos++; \
|
(_s)->pos++; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define qstream_wr_u16(_s, _v) \
|
#define qstream_wr_u16(_s, _v) \
|
||||||
do \
|
do \
|
||||||
{ \
|
{ \
|
||||||
*((_s)->pos) = (unsigned char) ((_v) >> 0); \
|
*((_s)->pos) = (unsigned char) ((_v) >> 0); \
|
||||||
(_s)->pos++; \
|
(_s)->pos++; \
|
||||||
*((_s)->pos) = (unsigned char) ((_v) >> 8); \
|
*((_s)->pos) = (unsigned char) ((_v) >> 8); \
|
||||||
(_s)->pos++; \
|
(_s)->pos++; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define qstream_wr_u32(_s, _v) \
|
#define qstream_wr_u32(_s, _v) \
|
||||||
do \
|
do \
|
||||||
{ \
|
{ \
|
||||||
*((_s)->pos) = (unsigned char) ((_v) >> 0); \
|
*((_s)->pos) = (unsigned char) ((_v) >> 0); \
|
||||||
(_s)->pos++; \
|
(_s)->pos++; \
|
||||||
*((_s)->pos) = (unsigned char) ((_v) >> 8); \
|
*((_s)->pos) = (unsigned char) ((_v) >> 8); \
|
||||||
@ -118,7 +118,7 @@ do \
|
|||||||
(_s)->pos++; \
|
(_s)->pos++; \
|
||||||
*((_s)->pos) = (unsigned char) ((_v) >> 24); \
|
*((_s)->pos) = (unsigned char) ((_v) >> 24); \
|
||||||
(_s)->pos++; \
|
(_s)->pos++; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
/* list of commands we support; this list should match the one in */
|
/* list of commands we support; this list should match the one in */
|
||||||
/* NeutrinoRDP channels/tcutils/tcutils_main.h */
|
/* NeutrinoRDP channels/tcutils/tcutils_main.h */
|
||||||
@ -141,7 +141,7 @@ enum TCU_UMOUNT_ERROR
|
|||||||
|
|
||||||
class Utils
|
class Utils
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Utils();
|
Utils();
|
||||||
static int getMountList(void *wtsChannel, QList<QListWidgetItem *> *itemList);
|
static int getMountList(void *wtsChannel, QList<QListWidgetItem *> *itemList);
|
||||||
static int unmountDevice(void *wtsChannel, QString device, QStatusBar *statusBar);
|
static int unmountDevice(void *wtsChannel, QString device, QStatusBar *statusBar);
|
||||||
|
@ -199,8 +199,8 @@ START_TEST(test_strnjoin__when_always__then_doesnt_write_beyond_end_of_destinati
|
|||||||
{
|
{
|
||||||
/* setup */
|
/* setup */
|
||||||
|
|
||||||
const char *src[] = { "a","b","c"};
|
const char *src[] = { "a", "b", "c"};
|
||||||
char result[5+1+1]; /* a-b-c + term null + guard value */
|
char result[5 + 1 + 1]; /* a-b-c + term null + guard value */
|
||||||
|
|
||||||
/* test */
|
/* test */
|
||||||
|
|
||||||
|
@ -20,19 +20,19 @@
|
|||||||
class Decoder : public QObject
|
class Decoder : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit Decoder(QObject *parent = 0);
|
explicit Decoder(QObject *parent = 0);
|
||||||
int init(QString filename);
|
int init(QString filename);
|
||||||
//int deinit();
|
//int deinit();
|
||||||
//int setWindow(QRectangle rect);
|
//int setWindow(QRectangle rect);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void *channel;
|
void *channel;
|
||||||
QRect mainWindowGeometry;
|
QRect mainWindowGeometry;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void onGeometryChanged(QRect *geometry);
|
void onGeometryChanged(QRect *geometry);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -22,8 +22,8 @@
|
|||||||
/* ffmpeg related stuff */
|
/* ffmpeg related stuff */
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
#include <libavformat/avformat.h>
|
#include <libavformat/avformat.h>
|
||||||
#include <libavcodec/avcodec.h>
|
#include <libavcodec/avcodec.h>
|
||||||
}
|
}
|
||||||
|
|
||||||
#define VCR_PLAY 1
|
#define VCR_PLAY 1
|
||||||
@ -36,18 +36,18 @@ class DemuxMedia : public QObject
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit DemuxMedia(QObject *parent = 0, QQueue<MediaPacket *> *videoQueue = 0,
|
explicit DemuxMedia(QObject *parent = 0, QQueue<MediaPacket *> *videoQueue = 0,
|
||||||
void *channel = 0, int stream_id = 101);
|
void *channel = 0, int stream_id = 101);
|
||||||
|
|
||||||
void setVcrOp(int op);
|
void setVcrOp(int op);
|
||||||
int clear();
|
int clear();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void startDemuxing();
|
void startDemuxing();
|
||||||
void onMediaSeek(int value);
|
void onMediaSeek(int value);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QMutex vcrMutex;
|
QMutex vcrMutex;
|
||||||
int vcrFlag;
|
int vcrFlag;
|
||||||
void *channel;
|
void *channel;
|
||||||
@ -65,10 +65,10 @@ private:
|
|||||||
|
|
||||||
void updateMediaPos();
|
void updateMediaPos();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void onMediaRestarted();
|
void onMediaRestarted();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void onElapsedtime(int val); /* in hundredth of a sec */
|
void onElapsedtime(int val); /* in hundredth of a sec */
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -3,22 +3,23 @@
|
|||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui
|
||||||
class DlgAbout;
|
{
|
||||||
|
class DlgAbout;
|
||||||
}
|
}
|
||||||
|
|
||||||
class DlgAbout : public QDialog
|
class DlgAbout : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit DlgAbout(QWidget *parent = 0);
|
explicit DlgAbout(QWidget *parent = 0);
|
||||||
~DlgAbout();
|
~DlgAbout();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::DlgAbout *ui;
|
Ui::DlgAbout *ui;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onOk();
|
void onOk();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -38,8 +38,8 @@
|
|||||||
/* ffmpeg related stuff */
|
/* ffmpeg related stuff */
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
#include <libavformat/avformat.h>
|
#include <libavformat/avformat.h>
|
||||||
#include <libavcodec/avcodec.h>
|
#include <libavcodec/avcodec.h>
|
||||||
}
|
}
|
||||||
|
|
||||||
#define VCR_PLAY 1
|
#define VCR_PLAY 1
|
||||||
@ -57,17 +57,17 @@ class MainWindow : public QMainWindow
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit MainWindow(QWidget *parent = 0);
|
explicit MainWindow(QWidget *parent = 0);
|
||||||
~MainWindow();
|
~MainWindow();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void onGeometryChanged(int x, int y, int width, int height);
|
void onGeometryChanged(int x, int y, int width, int height);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void onSliderValueChanged(int value);
|
void onSliderValueChanged(int value);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void on_actionOpen_Media_File_triggered();
|
void on_actionOpen_Media_File_triggered();
|
||||||
void on_actionExit_triggered();
|
void on_actionExit_triggered();
|
||||||
|
|
||||||
@ -84,12 +84,12 @@ private slots:
|
|||||||
|
|
||||||
void onVolSliderValueChanged(int value);
|
void onVolSliderValueChanged(int value);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void resizeEvent(QResizeEvent *e);
|
void resizeEvent(QResizeEvent *e);
|
||||||
void closeEvent(QCloseEvent *e);
|
void closeEvent(QCloseEvent *e);
|
||||||
void moveEvent(QMoveEvent *e);
|
void moveEvent(QMoveEvent *e);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::MainWindow *ui;
|
Ui::MainWindow *ui;
|
||||||
|
|
||||||
/* for UI */
|
/* for UI */
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
class MediaPacket
|
class MediaPacket
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MediaPacket();
|
MediaPacket();
|
||||||
|
|
||||||
void *av_pkt;
|
void *av_pkt;
|
||||||
|
@ -21,15 +21,15 @@
|
|||||||
/* ffmpeg related stuff */
|
/* ffmpeg related stuff */
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
#include <libavformat/avformat.h>
|
#include <libavformat/avformat.h>
|
||||||
#include <libavcodec/avcodec.h>
|
#include <libavcodec/avcodec.h>
|
||||||
}
|
}
|
||||||
|
|
||||||
class OurInterface : public QObject
|
class OurInterface : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit OurInterface(QObject *parent = 0);
|
explicit OurInterface(QObject *parent = 0);
|
||||||
|
|
||||||
/* public methods */
|
/* public methods */
|
||||||
@ -45,14 +45,14 @@ public:
|
|||||||
void setVcrOp(int op);
|
void setVcrOp(int op);
|
||||||
int setVolume(int volume);
|
int setVolume(int volume);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void onGeometryChanged(int x, int y, int width, int height);
|
void onGeometryChanged(int x, int y, int width, int height);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void on_ErrorMsg(QString title, QString msg);
|
void on_ErrorMsg(QString title, QString msg);
|
||||||
void onMediaDurationInSeconds(int duration);
|
void onMediaDurationInSeconds(int duration);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
/* private stuff */
|
/* private stuff */
|
||||||
|
|
||||||
|
@ -19,8 +19,8 @@
|
|||||||
/* ffmpeg related stuff */
|
/* ffmpeg related stuff */
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
#include <libavformat/avformat.h>
|
#include <libavformat/avformat.h>
|
||||||
#include <libavcodec/avcodec.h>
|
#include <libavcodec/avcodec.h>
|
||||||
}
|
}
|
||||||
|
|
||||||
#define VCR_PLAY 1
|
#define VCR_PLAY 1
|
||||||
@ -33,7 +33,7 @@ class PlayAudio : public QObject
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit PlayAudio(QObject *parent = 0,
|
explicit PlayAudio(QObject *parent = 0,
|
||||||
QQueue<MediaPacket *> *audioQueue = 0,
|
QQueue<MediaPacket *> *audioQueue = 0,
|
||||||
QMutex *sendMutex = 0,
|
QMutex *sendMutex = 0,
|
||||||
@ -42,10 +42,10 @@ public:
|
|||||||
|
|
||||||
void setVcrOp(int op);
|
void setVcrOp(int op);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void play();
|
void play();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QQueue<MediaPacket *> *audioQueue;
|
QQueue<MediaPacket *> *audioQueue;
|
||||||
QMutex *sendMutex;
|
QMutex *sendMutex;
|
||||||
QMutex vcrMutex;
|
QMutex vcrMutex;
|
||||||
|
@ -20,8 +20,8 @@
|
|||||||
/* ffmpeg related stuff */
|
/* ffmpeg related stuff */
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
#include <libavformat/avformat.h>
|
#include <libavformat/avformat.h>
|
||||||
#include <libavcodec/avcodec.h>
|
#include <libavcodec/avcodec.h>
|
||||||
}
|
}
|
||||||
|
|
||||||
#define VCR_PLAY 1
|
#define VCR_PLAY 1
|
||||||
@ -34,7 +34,7 @@ class PlayVideo : public QObject
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit PlayVideo(QObject *parent = 0,
|
explicit PlayVideo(QObject *parent = 0,
|
||||||
QQueue<MediaPacket *> *videoQueue = 0,
|
QQueue<MediaPacket *> *videoQueue = 0,
|
||||||
QMutex *sendMutex = 0,
|
QMutex *sendMutex = 0,
|
||||||
@ -46,29 +46,29 @@ public:
|
|||||||
//void setVcrOp(int op);
|
//void setVcrOp(int op);
|
||||||
//void onMediaRestarted();
|
//void onMediaRestarted();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void play();
|
void play();
|
||||||
|
|
||||||
//signals:
|
//signals:
|
||||||
// void onElapsedtime(int val); /* in hundredth of a sec */
|
// void onElapsedtime(int val); /* in hundredth of a sec */
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QQueue<MediaPacket *> *videoQueue;
|
QQueue<MediaPacket *> *videoQueue;
|
||||||
|
|
||||||
// int vcrFlag;
|
// int vcrFlag;
|
||||||
// QMutex vcrMutex;
|
// QMutex vcrMutex;
|
||||||
QMutex *sendMutex;
|
QMutex *sendMutex;
|
||||||
// QMutex posMutex;
|
// QMutex posMutex;
|
||||||
// int64_t la_seekPos; /* locked access; must hold posMutex */
|
// int64_t la_seekPos; /* locked access; must hold posMutex */
|
||||||
void *channel;
|
void *channel;
|
||||||
int stream_id;
|
int stream_id;
|
||||||
int fps;
|
int fps;
|
||||||
// int64_t elapsedTime; /* elapsed time in usecs since play started */
|
// int64_t elapsedTime; /* elapsed time in usecs since play started */
|
||||||
// int64_t pausedTime; /* time at which stream was paused */
|
// int64_t pausedTime; /* time at which stream was paused */
|
||||||
// bool isStopped;
|
// bool isStopped;
|
||||||
|
|
||||||
// void updateMediaPos();
|
// void updateMediaPos();
|
||||||
// void clearVideoQ();
|
// void clearVideoQ();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // PLAYVIDEO_H
|
#endif // PLAYVIDEO_H
|
||||||
|
@ -1133,8 +1133,9 @@ dynamic_monitor_data(intptr_t id, int chan_id, char *data, int bytes)
|
|||||||
/* redraw */
|
/* redraw */
|
||||||
xrdp_bitmap_invalidate(wm->screen, 0);
|
xrdp_bitmap_invalidate(wm->screen, 0);
|
||||||
|
|
||||||
struct xrdp_mod* v = wm->mm->mod;
|
struct xrdp_mod *v = wm->mm->mod;
|
||||||
if (v != 0) {
|
if (v != 0)
|
||||||
|
{
|
||||||
v->mod_server_version_message(v);
|
v->mod_server_version_message(v);
|
||||||
v->mod_server_monitor_resize(v, session_width, session_height);
|
v->mod_server_monitor_resize(v, session_width, session_height);
|
||||||
v->mod_server_monitor_full_invalidate(v, session_width, session_height);
|
v->mod_server_monitor_full_invalidate(v, session_width, session_height);
|
||||||
|
@ -53,11 +53,11 @@ struct xrdp_mod
|
|||||||
int (*mod_frame_ack)(struct xrdp_mod *v, int flags, int frame_id);
|
int (*mod_frame_ack)(struct xrdp_mod *v, int flags, int frame_id);
|
||||||
int (*mod_suppress_output)(struct xrdp_mod *v, int suppress,
|
int (*mod_suppress_output)(struct xrdp_mod *v, int suppress,
|
||||||
int left, int top, int right, int bottom);
|
int left, int top, int right, int bottom);
|
||||||
int (*mod_server_monitor_resize)(struct xrdp_mod* v,
|
int (*mod_server_monitor_resize)(struct xrdp_mod *v,
|
||||||
int width, int height);
|
int width, int height);
|
||||||
int (*mod_server_monitor_full_invalidate)(struct xrdp_mod* v,
|
int (*mod_server_monitor_full_invalidate)(struct xrdp_mod *v,
|
||||||
int width, int height);
|
int width, int height);
|
||||||
int (*mod_server_version_message)(struct xrdp_mod* v);
|
int (*mod_server_version_message)(struct xrdp_mod *v);
|
||||||
tintptr mod_dumby[100 - 14]; /* align, 100 minus the number of mod
|
tintptr mod_dumby[100 - 14]; /* align, 100 minus the number of mod
|
||||||
functions above */
|
functions above */
|
||||||
/* server functions */
|
/* server functions */
|
||||||
|
@ -337,7 +337,9 @@ xrdpvr_get_frame(void **av_pkt_ret, int *is_video_frame, int *delay_in_us)
|
|||||||
//printf("xrdpvr_get_frame:\n");
|
//printf("xrdpvr_get_frame:\n");
|
||||||
/* alloc an AVPacket */
|
/* alloc an AVPacket */
|
||||||
if ((av_pkt = (AVPacket *) malloc(sizeof(AVPacket))) == NULL)
|
if ((av_pkt = (AVPacket *) malloc(sizeof(AVPacket))) == NULL)
|
||||||
|
{
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
/* read one frame into AVPacket */
|
/* read one frame into AVPacket */
|
||||||
if (av_read_frame(g_psi.p_format_ctx, av_pkt) < 0)
|
if (av_read_frame(g_psi.p_format_ctx, av_pkt) < 0)
|
||||||
@ -491,7 +493,7 @@ xrdpvr_play_frame(void *channel, int stream_id, int *videoTimeout,
|
|||||||
bsfc = g_psi.bsfc;
|
bsfc = g_psi.bsfc;
|
||||||
while (bsfc != 0)
|
while (bsfc != 0)
|
||||||
{
|
{
|
||||||
new_pkt= av_pkt;
|
new_pkt = av_pkt;
|
||||||
error = av_bitstream_filter_filter(bsfc, g_psi.p_video_codec_ctx, 0,
|
error = av_bitstream_filter_filter(bsfc, g_psi.p_video_codec_ctx, 0,
|
||||||
&new_pkt.data, &new_pkt.size,
|
&new_pkt.data, &new_pkt.size,
|
||||||
av_pkt.data, av_pkt.size,
|
av_pkt.data, av_pkt.size,
|
||||||
@ -801,7 +803,7 @@ xrdpvr_create_metadata_file(void *channel, char *filename)
|
|||||||
int len;
|
int len;
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
if ((fd = open(filename , O_RDONLY)) < 0)
|
if ((fd = open(filename, O_RDONLY)) < 0)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -51,11 +51,11 @@ struct mod
|
|||||||
int (*mod_frame_ack)(struct mod *v, int flags, int frame_id);
|
int (*mod_frame_ack)(struct mod *v, int flags, int frame_id);
|
||||||
int (*mod_suppress_output)(struct mod *v, int suppress,
|
int (*mod_suppress_output)(struct mod *v, int suppress,
|
||||||
int left, int top, int right, int bottom);
|
int left, int top, int right, int bottom);
|
||||||
int (*mod_server_monitor_resize)(struct mod* v,
|
int (*mod_server_monitor_resize)(struct mod *v,
|
||||||
int width, int height);
|
int width, int height);
|
||||||
int (*mod_server_monitor_full_invalidate)(struct mod* v,
|
int (*mod_server_monitor_full_invalidate)(struct mod *v,
|
||||||
int width, int height);
|
int width, int height);
|
||||||
int (*mod_server_version_message)(struct mod* v);
|
int (*mod_server_version_message)(struct mod *v);
|
||||||
tintptr mod_dumby[100 - 14]; /* align, 100 minus the number of mod
|
tintptr mod_dumby[100 - 14]; /* align, 100 minus the number of mod
|
||||||
functions above */
|
functions above */
|
||||||
/* server functions */
|
/* server functions */
|
||||||
|
Loading…
Reference in New Issue
Block a user