Merge pull request #74 from chihchun/master
fixed cmake and rdpsnd/pulseaudio playback issue
This commit is contained in:
commit
3ce4079388
@ -51,6 +51,11 @@ if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
|
||||
set(CMAKE_INSTALL_LIBDIR "lib")
|
||||
endif()
|
||||
|
||||
# build shared libs
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
set(BUILD_SHARED_LIBS ON)
|
||||
endif()
|
||||
|
||||
# Compiler-specific flags
|
||||
if(CMAKE_COMPILER_IS_GNUCC)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-unused-but-set-variable")
|
||||
@ -138,3 +143,4 @@ endif()
|
||||
|
||||
add_subdirectory(client)
|
||||
add_subdirectory(server)
|
||||
add_subdirectory(keymaps)
|
||||
|
@ -25,7 +25,7 @@ set(CLIPRDR_SRCS
|
||||
cliprdr_main.h
|
||||
)
|
||||
|
||||
add_library(cliprdr SHARED ${CLIPRDR_SRCS})
|
||||
add_library(cliprdr ${CLIPRDR_SRCS})
|
||||
set_target_properties(cliprdr PROPERTIES PREFIX "")
|
||||
|
||||
target_link_libraries(cliprdr freerdp-utils)
|
||||
|
@ -25,7 +25,7 @@ set(DRDYNVC_SRCS
|
||||
dvcman.h
|
||||
)
|
||||
|
||||
add_library(drdynvc SHARED ${DRDYNVC_SRCS})
|
||||
add_library(drdynvc ${DRDYNVC_SRCS})
|
||||
set_target_properties(drdynvc PROPERTIES PREFIX "")
|
||||
|
||||
target_link_libraries(drdynvc freerdp-utils)
|
||||
|
@ -23,7 +23,7 @@ set(RAIL_SRCS
|
||||
rail_orders.c
|
||||
rail_orders.h)
|
||||
|
||||
add_library(rail SHARED ${RAIL_SRCS})
|
||||
add_library(rail ${RAIL_SRCS})
|
||||
set_target_properties(rail PROPERTIES PREFIX "")
|
||||
|
||||
target_link_libraries(rail freerdp-utils)
|
||||
|
@ -21,7 +21,7 @@ set(RDPDBG_SRCS
|
||||
rdpdbg_main.c
|
||||
)
|
||||
|
||||
add_library(rdpdbg SHARED ${RDPDBG_SRCS})
|
||||
add_library(rdpdbg ${RDPDBG_SRCS})
|
||||
set_target_properties(rdpdbg PROPERTIES PREFIX "")
|
||||
|
||||
target_link_libraries(rdpdbg freerdp-utils)
|
||||
|
@ -30,7 +30,7 @@ set(RDPDR_SRCS
|
||||
rdpdr_main.h
|
||||
)
|
||||
|
||||
add_library(rdpdr SHARED ${RDPDR_SRCS})
|
||||
add_library(rdpdr ${RDPDR_SRCS})
|
||||
set_target_properties(rdpdr PROPERTIES PREFIX "")
|
||||
|
||||
target_link_libraries(rdpdr freerdp-utils)
|
||||
|
@ -25,7 +25,7 @@ set(DISK_SRCS
|
||||
|
||||
include_directories(..)
|
||||
|
||||
add_library(disk SHARED ${DISK_SRCS})
|
||||
add_library(disk ${DISK_SRCS})
|
||||
set_target_properties(disk PROPERTIES PREFIX "")
|
||||
|
||||
target_link_libraries(disk freerdp-utils)
|
||||
|
@ -33,7 +33,7 @@ endif()
|
||||
|
||||
include_directories(..)
|
||||
|
||||
add_library(printer SHARED ${PRINTER_SRCS})
|
||||
add_library(printer ${PRINTER_SRCS})
|
||||
set_target_properties(printer PROPERTIES PREFIX "")
|
||||
|
||||
target_link_libraries(printer freerdp-utils)
|
||||
|
@ -22,7 +22,7 @@ set(RDPSND_SRCS
|
||||
rdpsnd_main.h
|
||||
)
|
||||
|
||||
add_library(rdpsnd SHARED ${RDPSND_SRCS})
|
||||
add_library(rdpsnd ${RDPSND_SRCS})
|
||||
set_target_properties(rdpsnd PROPERTIES PREFIX "")
|
||||
|
||||
target_link_libraries(rdpsnd freerdp-utils)
|
||||
|
@ -24,7 +24,7 @@ set(RDPSND_ALSA_SRCS
|
||||
include_directories(..)
|
||||
include_directories(${ALSA_INCLUDE_DIRS})
|
||||
|
||||
add_library(rdpsnd_alsa SHARED ${RDPSND_ALSA_SRCS})
|
||||
add_library(rdpsnd_alsa ${RDPSND_ALSA_SRCS})
|
||||
set_target_properties(rdpsnd_alsa PROPERTIES PREFIX "")
|
||||
|
||||
target_link_libraries(rdpsnd_alsa freerdp-utils)
|
||||
|
@ -24,7 +24,7 @@ set(RDPSND_PULSE_SRCS
|
||||
include_directories(..)
|
||||
include_directories(${PULSE_INCLUDE_DIRS})
|
||||
|
||||
add_library(rdpsnd_pulse SHARED ${RDPSND_PULSE_SRCS})
|
||||
add_library(rdpsnd_pulse ${RDPSND_PULSE_SRCS})
|
||||
set_target_properties(rdpsnd_pulse PROPERTIES PREFIX "")
|
||||
|
||||
target_link_libraries(rdpsnd_pulse freerdp-utils)
|
||||
|
@ -58,7 +58,7 @@ static void rdpsnd_pulse_context_state_callback(pa_context* context, void* userd
|
||||
|
||||
case PA_CONTEXT_FAILED:
|
||||
case PA_CONTEXT_TERMINATED:
|
||||
DEBUG_SVC("state %d", (int)state);
|
||||
DEBUG_SVC("PA_CONTEXT_FAILED/PA_CONTEXT_TERMINATED %d", (int)state);
|
||||
pa_threaded_mainloop_signal(pulse->mainloop, 0);
|
||||
break;
|
||||
|
||||
@ -224,13 +224,21 @@ static void rdpsnd_pulse_open(rdpsndDevicePlugin* device, rdpsndFormat* format)
|
||||
{
|
||||
rdpsndPulsePlugin* pulse = (rdpsndPulsePlugin*)device;
|
||||
pa_stream_state_t state;
|
||||
pa_buffer_attr buffer_attr = { 0 };
|
||||
char ss[PA_SAMPLE_SPEC_SNPRINT_MAX];
|
||||
|
||||
if (!pulse->context || pulse->stream)
|
||||
if (!pulse->context || pulse->stream) {
|
||||
DEBUG_WARN("pulse stream has been created.");
|
||||
return;
|
||||
}
|
||||
|
||||
rdpsnd_pulse_set_format_spec(pulse, format);
|
||||
|
||||
if (pa_sample_spec_valid(&pulse->sample_spec) == 0) {
|
||||
pa_sample_spec_snprint(ss, sizeof(ss), &pulse->sample_spec);
|
||||
DEBUG_WARN("Invalid sample spec %s", ss);
|
||||
return;
|
||||
}
|
||||
|
||||
pa_threaded_mainloop_lock(pulse->mainloop);
|
||||
pulse->stream = pa_stream_new(pulse->context, "freerdp",
|
||||
&pulse->sample_spec, NULL);
|
||||
@ -241,17 +249,15 @@ static void rdpsnd_pulse_open(rdpsndDevicePlugin* device, rdpsndFormat* format)
|
||||
pa_context_errno(pulse->context));
|
||||
return;
|
||||
}
|
||||
|
||||
/* install essential callbacks */
|
||||
pa_stream_set_state_callback(pulse->stream,
|
||||
rdpsnd_pulse_stream_state_callback, pulse);
|
||||
pa_stream_set_write_callback(pulse->stream,
|
||||
rdpsnd_pulse_stream_request_callback, pulse);
|
||||
buffer_attr.maxlength = (uint32_t) -1;
|
||||
buffer_attr.tlength = (uint32_t) -1; /* pa_usec_to_bytes(2000000, &pulse->sample_spec); */
|
||||
buffer_attr.prebuf = (uint32_t) -1;
|
||||
buffer_attr.minreq = (uint32_t) -1;
|
||||
buffer_attr.fragsize = (uint32_t) -1;
|
||||
|
||||
if (pa_stream_connect_playback(pulse->stream,
|
||||
pulse->device_name, &buffer_attr, 0, NULL, NULL) < 0)
|
||||
pulse->device_name, NULL, PA_STREAM_INTERPOLATE_TIMING|PA_STREAM_AUTO_TIMING_UPDATE, NULL, NULL) < 0)
|
||||
{
|
||||
pa_threaded_mainloop_unlock(pulse->mainloop);
|
||||
DEBUG_WARN("pa_stream_connect_playback failed (%d)",
|
||||
@ -452,7 +458,10 @@ int FreeRDPRdpsndDeviceEntry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints)
|
||||
data = pEntryPoints->plugin_data;
|
||||
if (data && strcmp((char*)data->data[0], "pulse") == 0)
|
||||
{
|
||||
if(strlen((char*)data->data[1]) > 0)
|
||||
pulse->device_name = xstrdup((char*)data->data[1]);
|
||||
else
|
||||
pulse->device_name = NULL;
|
||||
}
|
||||
|
||||
pulse->mainloop = pa_threaded_mainloop_new();
|
||||
|
@ -17,5 +17,14 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
file(GLOB HEADERS "freerdp/*")
|
||||
file(GLOB HEADERS "freerdp/*.h")
|
||||
install_files(/include/freerdp FILES ${HEADERS})
|
||||
|
||||
install(DIRECTORY freerdp/utils DESTINATION include/freerdp FILES_MATCHING PATTERN "*.h")
|
||||
install(DIRECTORY freerdp/chanman DESTINATION include/freerdp FILES_MATCHING PATTERN "*.h")
|
||||
install(DIRECTORY freerdp/cache DESTINATION include/freerdp FILES_MATCHING PATTERN "*.h")
|
||||
install(DIRECTORY freerdp/gdi DESTINATION include/freerdp FILES_MATCHING PATTERN "*.h")
|
||||
install(DIRECTORY freerdp/kbd DESTINATION include/freerdp FILES_MATCHING PATTERN "*.h")
|
||||
install(DIRECTORY freerdp/rali DESTINATION include/freerdp FILES_MATCHING PATTERN "*.h")
|
||||
install(DIRECTORY freerdp/rfx DESTINATION include/freerdp FILES_MATCHING PATTERN "*.h")
|
||||
install(DIRECTORY freerdp/plugins DESTINATION include/freerdp FILES_MATCHING PATTERN "*.h")
|
||||
|
3
keymaps/CMakeLists.txt
Normal file
3
keymaps/CMakeLists.txt
Normal file
@ -0,0 +1,3 @@
|
||||
install(FILES aliases amiga ataritt empty evdev fujitsu hp ibm macintosh macosx sony sun xfree86 xfree98 xkb.pl DESTINATION share/freerdp/keymaps)
|
||||
install(DIRECTORY digital_vndr DESTINATION share/freerdp/keymaps FILES_MATCHING PATTERN "*")
|
||||
install(DIRECTORY sgi_vndr DESTINATION share/freerdp/keymaps FILES_MATCHING PATTERN "*")
|
@ -26,7 +26,7 @@ set(FREERDP_CACHE_SRCS
|
||||
glyph.c
|
||||
cache.c)
|
||||
|
||||
add_library(freerdp-cache SHARED ${FREERDP_CACHE_SRCS})
|
||||
add_library(freerdp-cache ${FREERDP_CACHE_SRCS})
|
||||
|
||||
set_target_properties(freerdp-cache PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib")
|
||||
|
||||
|
@ -21,7 +21,7 @@ set(FREERDP_CHANMAN_SRCS
|
||||
libchanman.c
|
||||
libchanman.h)
|
||||
|
||||
add_library(freerdp-chanman SHARED ${FREERDP_CHANMAN_SRCS})
|
||||
add_library(freerdp-chanman ${FREERDP_CHANMAN_SRCS})
|
||||
|
||||
set_target_properties(freerdp-chanman PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib")
|
||||
target_link_libraries(freerdp-chanman freerdp-utils)
|
||||
|
@ -92,7 +92,7 @@ set(LIBFREERDP_CORE_SRCS
|
||||
peer.h
|
||||
)
|
||||
|
||||
add_library(freerdp-core SHARED ${LIBFREERDP_CORE_SRCS})
|
||||
add_library(freerdp-core ${LIBFREERDP_CORE_SRCS})
|
||||
|
||||
set_target_properties(freerdp-core PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib")
|
||||
|
||||
|
@ -34,7 +34,7 @@ set(FREERDP_GDI_SRCS
|
||||
shape.c
|
||||
gdi.c)
|
||||
|
||||
add_library(freerdp-gdi SHARED ${FREERDP_GDI_SRCS})
|
||||
add_library(freerdp-gdi ${FREERDP_GDI_SRCS})
|
||||
|
||||
target_link_libraries(freerdp-gdi freerdp-cache)
|
||||
target_link_libraries(freerdp-gdi freerdp-rfx)
|
||||
|
@ -27,7 +27,7 @@ set(FREERDP_KBD_SRCS
|
||||
libkbd.c
|
||||
libkbd.h)
|
||||
|
||||
add_library(freerdp-kbd SHARED ${FREERDP_KBD_SRCS})
|
||||
add_library(freerdp-kbd ${FREERDP_KBD_SRCS})
|
||||
|
||||
find_suggested_package(XKBFile)
|
||||
if(XKBFILE_FOUND)
|
||||
|
@ -23,7 +23,7 @@ set(FREERDP_RAIL_SRCS
|
||||
icon.c
|
||||
rail.c)
|
||||
|
||||
add_library(freerdp-rail SHARED ${FREERDP_RAIL_SRCS})
|
||||
add_library(freerdp-rail ${FREERDP_RAIL_SRCS})
|
||||
|
||||
set_target_properties(freerdp-rail PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib")
|
||||
|
||||
|
@ -39,7 +39,7 @@ set(LIBFREERDP_RFX_SRCS
|
||||
librfx.c
|
||||
)
|
||||
|
||||
add_library(freerdp-rfx SHARED ${LIBFREERDP_RFX_SRCS})
|
||||
add_library(freerdp-rfx ${LIBFREERDP_RFX_SRCS})
|
||||
|
||||
set_target_properties(freerdp-rfx PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib")
|
||||
|
||||
|
@ -24,8 +24,9 @@ set(LIBFREERDP_RFX_SSE2_SRCS
|
||||
|
||||
include_directories(..)
|
||||
|
||||
add_library(freerdp-rfx-sse2 STATIC ${LIBFREERDP_RFX_SSE2_SRCS})
|
||||
add_library(freerdp-rfx-sse2 ${LIBFREERDP_RFX_SSE2_SRCS})
|
||||
|
||||
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
|
||||
set_target_properties(freerdp-rfx-sse2 PROPERTIES COMPILE_FLAGS "-fPIC")
|
||||
endif()
|
||||
install(TARGETS freerdp-rfx-sse2 DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
|
@ -47,7 +47,7 @@ set(FREERDP_UTILS_SRCS
|
||||
|
||||
add_definitions(-DPLUGIN_PATH="${FREERDP_PLUGIN_PATH}")
|
||||
|
||||
add_library(freerdp-utils SHARED ${FREERDP_UTILS_SRCS})
|
||||
add_library(freerdp-utils ${FREERDP_UTILS_SRCS})
|
||||
|
||||
set_target_properties(freerdp-utils PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user