Merge branch 'master' of github.com:FreeRDP/FreeRDP into cleanup

This commit is contained in:
Marc-Andre 2012-09-17 15:27:49 -04:00
commit dcceac59e7
10 changed files with 82 additions and 29 deletions

View File

@ -34,6 +34,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/)
include(AutoVersioning)
include(ConfigOptions)
include(BuildFeatureCheck)
include(FindOptionalPackage)
include(CheckCCompilerFlag)
include(GNUInstallDirsWrapper)

View File

@ -59,7 +59,7 @@ static boolean tsmf_ffmpeg_init_context(ITSMFDecoder* decoder)
{
TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*) decoder;
mdecoder->codec_context = avcodec_alloc_context();
mdecoder->codec_context = avcodec_alloc_context3(NULL);
if (!mdecoder->codec_context)
{
DEBUG_WARN("avcodec_alloc_context failed.");
@ -179,9 +179,9 @@ static boolean tsmf_ffmpeg_prepare(ITSMFDecoder* decoder)
{
TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*) decoder;
if (avcodec_open(mdecoder->codec_context, mdecoder->codec) < 0)
if (avcodec_open2(mdecoder->codec_context, mdecoder->codec, NULL) < 0)
{
DEBUG_WARN("avcodec_open failed.");
DEBUG_WARN("avcodec_open2 failed.");
return false;
}
@ -366,19 +366,29 @@ static boolean tsmf_ffmpeg_decode_audio(ITSMFDecoder* decoder, const uint8* data
}
dst += mdecoder->decoded_size;
}
frame_size = mdecoder->decoded_size_max - mdecoder->decoded_size;
#if LIBAVCODEC_VERSION_MAJOR < 52 || (LIBAVCODEC_VERSION_MAJOR == 52 && LIBAVCODEC_VERSION_MINOR <= 20)
len = avcodec_decode_audio2(mdecoder->codec_context,
(int16_t*) dst, &frame_size,
src, src_size);
(int16_t*) dst, &frame_size, src, src_size);
#else
{
AVFrame* decoded_frame = avcodec_alloc_frame();
int got_frame = 0;
AVPacket pkt;
av_init_packet(&pkt);
pkt.data = (uint8*) src;
pkt.size = src_size;
len = avcodec_decode_audio3(mdecoder->codec_context,
(int16_t*) dst, &frame_size, &pkt);
len = avcodec_decode_audio4(mdecoder->codec_context, decoded_frame, &got_frame, &pkt);
if (len >= 0 && got_frame)
{
frame_size = av_samples_get_buffer_size(NULL, mdecoder->codec_context->channels,
decoded_frame->nb_samples, mdecoder->codec_context->sample_fmt, 1);
memcpy(dst, decoded_frame->data[0], frame_size);
}
av_free(decoded_frame);
}
#endif
if (len <= 0 || frame_size <= 0)

View File

@ -200,7 +200,7 @@
<term>-x <replaceable class="parameter">flag</replaceable></term>
<listitem>
<para>
Set the experiance performance flags.
Set the experience performance flags.
<replaceable class="parameter">flag</replaceable> can be one of:
<itemizedlist>
<listitem>

View File

@ -0,0 +1,30 @@
# Central location to check for cmake (version) requirements
#
#=============================================================================
# Copyright 2012 Bernhard Miklautz <bmiklautz@thinstuff.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
# If WITH_MONOLITHIC_BUILD is used with cmake < 2.8.8 build fails
if (WITH_MONOLITHIC_BUILD)
if(${CMAKE_VERSION} VERSION_LESS 2.8.8)
message(FATAL_ERROR "CMAKE version >= 2.8.8 required for WITH_MONOLITHIC_BUILD")
endif()
endif(WITH_MONOLITHIC_BUILD)
# GetGitRevisionDescription requires FindGit which was added in version 2.8.2
# build won't fail but GIT_REVISION is set to n/a
if(${CMAKE_VERSION} VERSION_LESS 2.8.2)
message(WARNING "GetGitRevisionDescription reqires (FindGit) cmake >= 2.8.2 to work properly - GIT_REVISION will be set to n/a")
endif()

View File

@ -20,10 +20,10 @@
include_directories(${CUNIT_INCLUDE_DIRS})
include_directories(${CMAKE_SOURCE_DIR}) # for some internal tests
include_directories(../libfreerdp-core)
include_directories(../libfreerdp-gdi)
include_directories(../libfreerdp-cache)
include_directories(../libfreerdp-codec)
include_directories(../libfreerdp/core)
include_directories(../libfreerdp/gdi)
include_directories(../libfreerdp/cache)
include_directories(../libfreerdp/codec)
add_executable(test_freerdp
test_per.c

View File

@ -23,9 +23,9 @@
#include <winpr/sspi.h>
#include <freerdp/freerdp.h>
#include "winpr/sspi/NTLM/ntlm.h"
#include "winpr/sspi/NTLM/ntlm_compute.h"
#include "winpr/sspi/NTLM/ntlm_message.h"
#include "winpr/libwinpr/sspi/NTLM/ntlm.h"
#include "winpr/libwinpr/sspi/NTLM/ntlm_compute.h"
#include "winpr/libwinpr/sspi/NTLM/ntlm_message.h"
#include "test_ntlm.h"

View File

@ -22,8 +22,8 @@
#include <freerdp/utils/stream.h>
#include "test_orders.h"
#include "libfreerdp-core/orders.h"
#include "libfreerdp-core/update.h"
#include "libfreerdp/core/orders.h"
#include "libfreerdp/core/update.h"
ORDER_INFO* orderInfo;

View File

@ -54,7 +54,7 @@ int add_sspi_suite(void)
void test_EnumerateSecurityPackages(void)
{
uint32 cPackages;
ULONG cPackages;
SECURITY_STATUS status;
SecPkgInfo* pPackageInfo;
@ -64,7 +64,7 @@ void test_EnumerateSecurityPackages(void)
{
int index;
printf("\nEnumerateSecurityPackages (%d):\n", cPackages);
printf("\nEnumerateSecurityPackages (%d):\n", (unsigned int)cPackages);
for (index = 0; index < cPackages; index++)
{

View File

@ -1104,7 +1104,7 @@ int decompress_rdp_6(struct rdp_mppc_dec* dec, uint8* cbuf, int len, int ctype,
if (ctype & PACKET_AT_FRONT)
{
/* slid history_buf and reset history_buf to middle */
memcpy(history_buf, (history_buf + (history_ptr - history_buf - 32768)), 32768);
memmove(history_buf, (history_buf + (history_ptr - history_buf - 32768)), 32768);
history_ptr = history_buf + 32768;
dec->history_ptr = history_ptr;
*roff = 32768;

View File

@ -871,34 +871,46 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
/* username */
if (NULL == settings->username) {
char input[512];
input[0] = '\0';
printf("username: ");
scanf("%511s", input);
settings->username = xstrdup(input);
if (scanf("%511s", input) > 0) {
settings->username = xstrdup(input);
}
}
/* password */
if (NULL == settings->password) {
settings->password = xmalloc(512 * sizeof(char));
if (isatty(STDIN_FILENO))
freerdp_passphrase_read("password: ", settings->password, 512, settings->from_stdin);
else
{
else {
printf("password: ");
scanf("%511s", settings->password);
if (scanf("%511s", settings->password) <= 0) {
free(settings->password);
settings->password = NULL;
}
}
}
/* domain */
if (NULL == settings->domain) {
char input[512];
input[0] = '\0';
printf("domain (control-D to skip): ");
scanf("%511s", input);
settings->domain = xstrdup(input);
if (scanf("%511s", input) > 0) {
/* Try to catch the cases where the string is NULL-ish right
at the get go */
if (input[0] != '\0' && !(input[0] == '.' && input[1] == '\0')) {
settings->domain = xstrdup(input);
}
}
}
/* hostname */
if (NULL == settings->hostname) {
char input[512];
input[0] = '\0';
printf("hostname: ");
scanf("%511s", input);
freerdp_parse_hostname(settings, input);
if (scanf("%511s", input) > 0) {
freerdp_parse_hostname(settings, input);
}
}
}