Commit Graph

326 Commits

Author SHA1 Message Date
Armin Novak
641022b795 [logging] remove __FUNCTION__ from actual message
prefer the log formatter to provide that information.
2023-01-25 16:26:39 +01:00
akallabeth
8ed37e68d2 [stream] use logging capacity checks 2023-01-25 14:27:32 +01:00
Armin Novak
921315fdbf Fixed -Wmissing-variable-declarations 2022-11-21 10:12:31 +01:00
akallabeth
1849632c43
Fixed format strings to match arguments (#8254)
* Fixed format strings to match arguments

Reviewed and replaced all %d specifiers to match proper type

* Added proxy dynamic channel command type to log messages.
2022-09-29 14:55:27 +02:00
Armin Novak
6a1d44bb67 Added support for audin version 2 2022-09-12 10:03:31 +02:00
akallabeth
c3e8720c87 Removed ALAW/ULAW from supported backend formats
pulse/alsa/oss do not reliably work with ALAW/ULAW codecs with all
hardware available.
Since these formats are poor quality anyway, deactivate them for
audin channel.
2022-07-05 14:20:19 +02:00
akallabeth
bc8b4ade1c reformatted 2022-06-23 08:48:39 +02:00
akallabeth
5b163b7918 Add GetRdpContext function pointer for dynamic channels 2022-06-23 07:45:55 +02:00
David Fort
e389210673 client channels: mutualize common types between dynamic channels
Most dynamic channels share the same copied and pasted code for the XXX_CHANNEL_CALLBACK
and XXX_LISTENER_CALLBACK types. This patch introduce GENERIC_CHANNEL_CALLBACK and
GENERIC_LISTENER_CALLBACK that fits for most channels and discard custom type definitions.
2022-06-15 14:04:58 +02:00
Pascal Nowack
9d627e0df2 channels/server: Add APIs for DVCs to get notified of channel id
This allows server implementations to watch these channel ids for their
creation statuses.
2022-06-08 15:26:51 +02:00
Pascal Nowack
1f0b3c8004 audin/server: Do not overwrite values of the server audio formats
It just makes the usage of codecs impossible.
2022-06-08 15:26:51 +02:00
Felix Deimel
8cabdf6a04 Fixed memory leak in audin mac 2022-05-13 10:23:41 +02:00
akallabeth
73cdcdfe09
Logging and parser fixes (#7796)
* Fixed remdesk settings pointer

* Fixed sign warnings in display_write_monitor_layout_pdu

* Use freerdp_abort_connect_context and freerdp_shall_disconnect_context

* Added and updates settings

* info assert/dynamic timezone

* mcs assert/log/flags

* Fixed and added assertions for wStream

* Unified stream length checks

* Added new function to check for lenght and log
* Replace all usages with this new function

* Cleaned up PER, added parser logging

* Cleaned up BER, added parser logging

* log messages

* Modified Stream_CheckAndLogRequiredLengthEx

* Allow custom format and options
* Add Stream_CheckAndLogRequiredLengthExVa for prepared va_list

* Improved Stream_CheckAndLogRequiredLength

* Now have log level adjustable
* Added function equivalents for existing logger
* Added a backtrace in case of a failure is detected

* Fixed public API input checks
2022-04-19 14:29:17 +02:00
Armin Novak
4d03d7c0bf Freerdp remove #ifdef HAVE_CONFIG_H 2022-03-03 11:26:48 +01:00
Armin Novak
b2ad47a809 Reorganized FreeRDP headers 2022-03-03 11:26:48 +01:00
Armin Novak
fd027d1bf0 Removed BUILTIN_CHANNELS
Building client channels out of tree does not work reliable as the
dependencies can not be easily split. (exceptions may be simple ones
as echo channel)
It does complicate the build system and code though, so remove this
for maintainability reasons.
2022-02-23 10:43:46 +01:00
akallabeth
8cc6582044
Unify struct definitions (#7633)
* Unified enum/struct definitions, fixed include issues

* Fixed mac compilation issues

* Added missing include

* Fixed windows server build warnings

* Fixed VS2010 build issue

* Removed unnecessary library linking

* Fixed ThreadPool WinXP compatibility

* Fixed pr review remarks
2022-02-14 14:59:22 +01:00
Felix Deimel
6bc3def9d1 Fixes https://github.com/FreeRDP/FreeRDP/issues/7408 2022-01-31 15:54:17 +01:00
akallabeth
db1ee0cae6 Update nAvgBytesPerSec in audin_winmm_set_format
The format channel count and alignment may have changed.
Update nAvgBytesPerSec accordingly
2022-01-27 15:57:03 +01:00
akallabeth
6ef65b97aa Fixed const warnings audin/winmm 2022-01-19 09:24:57 +01:00
akallabeth
f8758a4b10 Fixed const warning in opensl es backend 2022-01-11 14:32:18 +01:00
Richard Markiewicz
16202322d1 freerdp: add audin channel for iOS 2021-12-21 08:31:04 +01:00
akallabeth
b73ce8a9f6 Fixed warning in mac audin backend. 2021-11-25 12:25:18 +01:00
David Fort
67986ea298 Fix compilation with mingw
This patch addresses some issues when compiling against mingw. With these changes
FreeRDP can be compiled out-of-the box on a Ubuntu 20.04.
2021-11-15 09:23:16 +01:00
akallabeth
834fdf0046
[audin] Always reset dsp_context before open (#7342) 2021-10-11 15:45:36 +02:00
Armin Novak
96cf17a45b Replaced (IWTSPlugin*) casts with struct address return 2021-10-07 16:22:04 +02:00
Simon Nivault
845947651e Force one channel input fallback for audin
Windows winmm backend does not support stereo microphone properly.
Fall back to mono and ensure that fallback is used.
2021-09-30 11:15:24 +02:00
Armin Novak
0f8c52b9ca Fixed const warnings with argument parser 2021-09-09 08:53:20 +02:00
Armin Novak
5afa592244 Fixed cast-qual warnings 2021-08-24 11:10:51 +02:00
Simon Nivault
e42696bb2e
Some fixes for audin redirection (#7231)
* Fixed research for native PCM format

* Fixed compatibility detection for resampling

* dsp: Makes channel mix and encoding process use separated buffers

* Give FramesPerPacket to freerdp_dsp_context_reset function

* dsp: Fix DVI_ADPCM codec by respecting the required packet size

* Forbid mono channel in macos

* Fix audin command line channel option

* Disable ADPCM codec as it does not work

* Refactor valid native codec research

* Native codec research: Try different channels number

* Fix dsp channel mix

* Fix dsp resample
2021-08-23 14:49:28 +02:00
Armin Novak
6854c7da7e Fixed windows audio recording issues:
1. Fix recording channels to mono
2. Fix alignment of PCM data to 2 bytes
2021-07-29 15:27:24 +02:00
Armin Novak
8ef57bf296 Replaced CMAKE_[SOURCE|BINARY]_DIR with PROJECT_[SOURCE|BINARY]_DIR
Thanks @Pollux42 for the hint in #7096
2021-06-22 08:54:18 +02:00
Armin Novak
c4c5847f81 channels: Fixed warnings, added assertions 2021-06-18 11:32:16 +02:00
akallabeth
8b01c2f8ae Fixed codql warning 2021-06-17 10:35:22 +02:00
Armin Novak
2e0d1cc33c Fixed integer warnings, fixed data types 2021-06-17 10:35:22 +02:00
Armin Novak
4a6517757d Fixed logging macro warnings 2021-06-17 10:35:22 +02:00
Armin Novak
19dd3f6703 Fixed compilation warnings 2021-06-16 14:26:06 +02:00
Armin Novak
d36d94766e Replaced assert with WINPR_ASSERT 2021-06-14 09:37:07 +02:00
Denis
8ba1dc49da fix formating with clang-format 2021-03-08 13:11:50 +01:00
Denis
b3a2042103 Add support for OpenBSD sndio 2021-03-08 13:11:50 +01:00
Armin Novak
1cd97c3270 Added API check to allow compilation/run with mac os < 10.14 2021-03-02 10:03:41 +01:00
akallabeth
e2fd9db0b5 Added const to function arguments 2021-02-17 11:29:56 +01:00
Martin Fleisz
a5fce9e64b channels/audin: Request correct media type in audin channel on Mac 2020-11-20 15:37:19 +01:00
Armin Novak
0e0eb5f41f Added permission checks for mac audio backend. 2020-10-21 19:44:09 +02:00
Armin Novak
75aab487e2 Added duplicate initialization check for plugins. 2020-08-10 16:17:44 +02:00
akallabeth
64ad42b95b Fixed DestroyListener arguments and call order 2020-05-13 17:11:17 +02:00
akallabeth
2f5e5359f6 Destroy channel listeners on terminate 2020-05-12 11:40:42 +02:00
Armin Novak
0154d3ceb8 audin pulse log states by name 2020-02-25 14:57:42 +01:00
Martin Fleisz
53f7927bf3 audin: Fix possible crash in winmm backend 2020-01-16 10:23:17 +01:00
Martin Fleisz
05a865281e channels: Fix memory leak and make log messages more precise 2020-01-08 16:49:15 +01:00
Martin Fleisz
d21e0a6d6d Fix audio channel init when no audio devices are present
This PR fixes the handling of using rdpsnd or audin when the system has
no audio device available.
In case of a missing playback device the
Windows backend now correctly reports an error and the fake rdpsnd
backend is loaded.
If audin is enabled and no microphone is present the channel
initialization will report an error but it won't cut the connection (as
it did before).
2019-12-30 12:59:14 +01:00
Armin Novak
da6ff1ca65 Removed some unnecessary casts. 2019-12-05 11:40:56 +01:00
Armin Novak
72ca88f49c Reformatted to new style 2019-11-07 10:53:54 +01:00
Martin Fleisz
bc39b32d20
Merge pull request #5685 from akallabeth/multi_instance_arg_parse
COMMAND_LINE_ARGUMENT structs contain parser results, use one per instance
2019-11-06 09:09:22 +01:00
Armin Novak
f01e042211 Code cleanups (strlen, casts, size_t, ...) 2019-10-29 11:58:43 +01:00
Armin Novak
0c87eaee4d COMMAND_LINE_ARGUMENT structs contain parser results, use one per instance
Remove the old global structs as the parser modifies them. When using
multiple instances in the same process space this could break parsing.
2019-10-28 13:30:05 +01:00
Armin Novak
30c21279cb Fixed memory leak when freeing up audin formats. 2019-10-24 12:18:24 +02:00
Armin Novak
624d895106 Fixed sign issues 2019-04-05 09:22:35 +02:00
Armin Novak
ef1728faf5 Fixed NULL dereferences and uninitialized values 2019-01-30 16:11:10 +01:00
Peter Åstrand (astrand)
30cd1ba1ab Use lowercase for includes and libs
Makes build possible on case sensitive systems such as MinGW on Linux.
2019-01-09 09:36:28 +01:00
Ilya Shipitsin
bdc039e719 resolve several issues found by cppcheck
[client/X11/xf_floatbar.c:800] -> [client/X11/xf_floatbar.c:796]: (warning) Either the condition '!floatbar' is redundant or there is possible null pointer dereference: floatbar.
[client/X11/xf_floatbar.c:800] -> [client/X11/xf_floatbar.c:797]: (warning) Either the condition '!floatbar' is redundant or there is possible null pointer dereference: floatbar.
[client/X11/xf_floatbar.c:800] -> [client/X11/xf_floatbar.c:798]: (warning) Either the condition '!floatbar' is redundant or there is possible null pointer dereference: floatbar.
[libfreerdp/codec/dsp.c:1156] -> [libfreerdp/codec/dsp.c:1154]: (warning) Either the condition '!srcFormat' is redundant or there is possible null pointer dereference: srcFormat.
[channels/drdynvc/client/drdynvc_main.c:1453] -> [channels/drdynvc/client/drdynvc_main.c:1450]: (warning) Either the condition '!drdynvc' is redundant or there is possible null pointer dereference: drdynvc.
[channels/audin/client/opensles/audin_opensl_es.c:98] -> [channels/audin/client/opensles/audin_opensl_es.c:94]: (warning) Either the condition '!opensles' is redundant or there is possible null pointer dereference: opensles.
[channels/audin/client/opensles/audin_opensl_es.c:159] -> [channels/audin/client/opensles/audin_opensl_es.c:153]: (warning) Either the condition '!opensles' is redundant or there is possible null pointer dereference: opensles.
2019-01-02 20:35:24 +05:00
Armin Novak
0f45a570fa Added fallback for supported sample rates if original not supported.
Added format compatibility check between recording input and destination.
2018-11-14 13:27:20 +01:00
Armin Novak
93eea24120 Fixed possible NULL pointer dereference 2018-11-14 13:27:20 +01:00
Armin Novak
7aebf8ebd2 Silence code analyzers, check correct variable for NULL. 2018-10-25 13:19:45 +02:00
Martin Fleisz
00af869cd3
Merge pull request #4889 from akallabeth/shadow_server_audin_refactor
Shadow server audin refactor
2018-10-08 12:56:09 +02:00
Armin Novak
ac14763564 [audin] Abort version exchange if server version is not supported. 2018-10-04 13:53:18 +02:00
Armin Novak
47f8804073 Fixed audio recording with opensles. 2018-10-04 13:18:06 +02:00
Armin Novak
d56efaae8b Fixed server format selection. 2018-09-26 12:49:09 +02:00
Armin Novak
16531e1437 Fixed server audin callback, provide more information. 2018-09-26 12:49:09 +02:00
Armin Novak
18f97d03e7 Cleaned up defaults. 2018-09-26 12:49:09 +02:00
Armin Novak
106dde9571 Working mic redirection for shadow server. 2018-09-26 12:49:09 +02:00
Armin Novak
28efbbc01f Refactored audio_format* functions. 2018-09-26 12:49:09 +02:00
Armin Novak
dab5770fed Added microphone support to shadow server. 2018-09-25 11:14:10 +02:00
Ondrej Holy
926ac4f938 channels/audin: Fix leak found by covscan
leaked_storage: Variable out going out of scope leaks the storage it points to.
2018-08-22 13:35:43 +02:00
Armin Novak
44d1438eac Fixed mac audin 2018-08-01 12:56:17 +02:00
Armin Novak
7355b4e5f3 Fixed leak in audio format processing. 2018-07-31 10:33:19 +02:00
MartinHaimberger
2d7499b7c0
Merge pull request #4758 from akallabeth/dsp_fix
Audio/microphone fixes
2018-07-31 10:22:22 +02:00
Armin Novak
033abe93d4 Fixed callback parameter checks. 2018-07-30 11:22:11 +02:00
Armin Novak
3b187ef321 Code Cleanup 2018-07-19 16:21:03 +02:00
Martin Fleisz
b6a41b26e5 audin: Fix server-side dsp decoding
The decoder format was never set and so dsp_decode always failed
on the server side.
2018-07-19 16:00:31 +02:00
Armin Novak
d40daedb9c Fixed FFMPEG backend: Do not drop samples for package alignment. 2018-07-19 15:17:54 +02:00
Armin Novak
d7e88b1b81 Fixed winmm backend logging. 2018-07-19 11:55:48 +02:00
Armin Novak
a003890b34 Fixed opensles compilation errors. 2018-07-19 11:51:26 +02:00
Armin Novak
ec83f3d4f1 Fixed number of samples returned. 2018-07-18 12:33:52 +02:00
Armin Novak
7c8a556377 Fixed alignment issues. 2018-07-18 12:14:37 +02:00
Armin Novak
8664a3c91e Fixed alsa and pulse backend receive buffer sizes 2018-07-17 16:18:21 +02:00
Armin Novak
b9645c9247 Using dynamic logger again. 2018-07-17 11:20:45 +02:00
Armin Novak
4465bcfa86 Fixed remarks 2018-07-04 11:03:32 +02:00
Armin Novak
bf70ee6267 Keep extra data of audio format locally cached. 2018-07-03 09:54:29 +02:00
Pascal J. Bourguignon
15f2bafeab Cleaned up const char** -> char** for argv, since we definitely do modify the argv!
(we overwrite the password and pin arguments).
This implies changes in the argument parsing tests that now must pass a mutable argv
(copied from the statically declared test argvs).
Some other const inconsistency have been dealt with too.
2018-06-06 16:43:09 +02:00
Armin Novak
8758638c2a Ensure audin channel uses supported protocol version 1. 2018-04-16 10:23:45 +02:00
Armin Novak
3f712cab70 Fixed formatting of changed files. 2018-04-05 13:14:16 +02:00
Armin Novak
2e801a8425 Free dsp context on close. 2018-04-05 13:14:16 +02:00
Armin Novak
1c127fab7d Added AudioFormatFlags fallback. 2018-04-05 13:14:16 +02:00
Armin Novak
65a82e9cdc Fix #4462: Fallback typedef for AudioFormatID on MacOS < 10.10 2018-04-05 13:14:16 +02:00
Armin Novak
f89c1857b9 Rewrite of sound and microphone channels
The sound and microphone redirection channels (and in part TSMF)
did not properly decouple encoding/decoding from the backends used
to play/record sound.
Encapsulating encoding/decoding in rewritten freerdp_dsp_* functions
with variable backends, simplifying alsa/oss/pulse/... audio backends.
2018-04-05 13:14:16 +02:00
Armin Novak
0c49152a3d Fixed #4412: memory corruption in audin channel. 2018-03-26 16:29:50 +02:00
Armin Novak
c53d72211a Audin channel use dynamic logger where possible. 2018-03-26 14:40:23 +02:00
Armin Novak
2517755d25 Fixed thread function return and parameters. 2018-03-07 14:36:55 +01:00
Armin Novak
4eb5b8e349 Replaced atoi 2017-11-15 15:52:16 +01:00