Commit 7b19568e authored by jehan's avatar jehan

add tester for video configurations

parent b88153ef
......@@ -880,7 +880,11 @@ static int enc_set_configuration(MSFilter *f, void *data) {
if (vconf->extra != NULL) {
s->qmin = *((int *)vconf->extra);
}
ms_message("Video configuration set: bitrate=%dbits/s, fps=%f, vsize=%dx%d", s->vconf.required_bitrate, s->vconf.fps, s->vconf.vsize.width, s->vconf.vsize.height);
ms_message("Video configuration set: bitrate=%dbits/s, fps=%f, vsize=%dx%d for encoder [%p]", s->vconf.required_bitrate
, s->vconf.fps
, s->vconf.vsize.width
, s->vconf.vsize.height
, f);
return 0;
}
......
......@@ -500,7 +500,11 @@ static int enc_set_configuration(MSFilter *f, void *data) {
return 0;
}
ms_message("Video configuration set: bitrate=%dbits/s, fps=%f, vsize=%dx%d", s->vconf.required_bitrate, s->vconf.fps, s->vconf.vsize.width, s->vconf.vsize.height);
ms_message("Video configuration set: bitrate=%dbits/s, fps=%f, vsize=%dx%d for encoder [%p]" , s->vconf.required_bitrate
, s->vconf.fps
, s->vconf.vsize.width
, s->vconf.vsize.height
, f);
return 0;
}
......
......@@ -255,7 +255,7 @@ VideoStream *video_stream_new_with_sessions(const MSMediaStreamSessions *session
}
void video_stream_set_sent_video_size(VideoStream *stream, MSVideoSize vsize){
ms_message("Setting video size %dx%d", vsize.width, vsize.height);
ms_message("Setting video size %dx%d on stream [%p]", vsize.width, vsize.height,stream);
stream->sent_vsize=vsize;
}
......@@ -554,7 +554,7 @@ int video_stream_start (VideoStream *stream, RtpProfile *profile, const char *re
if (pt->normal_bitrate>0){
MSVideoConfiguration *vconf_list = NULL;
ms_message("Limiting bitrate of video encoder to %i bits/s",pt->normal_bitrate);
ms_message("Limiting bitrate of video encoder to %i bits/s for stream [%p]",pt->normal_bitrate,stream);
ms_filter_call_method(stream->ms.encoder, MS_VIDEO_ENCODER_GET_CONFIGURATION_LIST, &vconf_list);
if (vconf_list != NULL) {
MSVideoConfiguration vconf = ms_video_find_best_configuration_for_bitrate(vconf_list, pt->normal_bitrate);
......
......@@ -15,7 +15,12 @@ mediastreamer2_tester_SOURCES= \
mediastreamer2_sound_card_tester.c \
mediastreamer2_adaptive_tester.c \
mediastreamer2_audio_stream_tester.c \
mediastreamer2_framework_tester.c
mediastreamer2_framework_tester.c
if BUILD_MACOSX
mediastreamer2_tester_SOURCES+= mediastream_tester_cocoa.m
endif #BUILD_MACOSX
if BUILD_VIDEO
mediastreamer2_tester_SOURCES+= mediastreamer2_video_stream_tester.c
if BUILD_MATROSKA
......
/*
mediastreamer2 library - modular sound and video processing and streaming
Copyright (C) 2006-2013 Belledonne Communications, Grenoble
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#import <Carbon/Carbon.h>
#import <AppKit/AppKit.h>
extern int _main(int argc, char **argv);
@interface MyApplicationDelegate: NSObject
{
NSWindow *window;
@public
int argc;
char **argv;
}
-(void)applicationWillFinishLaunching: (NSNotification*) aNotification;
-(void)applicationDidFinishLaunching: (NSNotification*) aNotification;
-(BOOL)applicationShouldTerminateAfterLastWindowClosed: (NSApplication *)theApplication;
@end
@implementation MyApplicationDelegate
-(void) runLoop {
exit(_main(argc,argv));
}
-(void)applicationWillFinishLaunching: (NSNotification*) aNotification
{
[self performSelectorInBackground:@selector(runLoop) withObject:nil];
}
-(void)applicationDidFinishLaunching: (NSNotification*) aNotification
{
}
-(BOOL)applicationShouldTerminateAfterLastWindowClosed: (NSApplication *)theApplication
{
return YES;
}
-(void)dealloc
{
[window release];
[super dealloc];
}
@end
int main(int argc, char **argv)
{
static const ProcessSerialNumber thePSN = { 0, kCurrentProcess };
TransformProcessType(&thePSN, kProcessTransformToForegroundApplication);
SetFrontProcess(&thePSN);
NSAutoreleasePool *aPool = [[NSAutoreleasePool alloc] init];
[NSApplication sharedApplication];
MyApplicationDelegate *aMyApplicationDelegate = [[MyApplicationDelegate alloc] init];
aMyApplicationDelegate->argc = argc;
aMyApplicationDelegate->argv = argv;
[NSApp setDelegate: aMyApplicationDelegate];
[aPool release];
[NSApp run];
return 0;
}
......@@ -29,7 +29,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#if HAVE_CU_CURSES
#include "CUnit/CUCurses.h"
#endif
#ifdef __APPLE__
#include "TargetConditionals.h"
#endif
static test_suite_t **test_suite = NULL;
static int nb_test_suites = 0;
......@@ -137,7 +139,7 @@ void mediastreamer2_tester_uninit(void) {
}
int mediastreamer2_tester_run_tests(const char *suite_name, const char *test_name) {
int i;
int i,ret;
/* initialize the CUnit test registry */
if (CUE_SUCCESS != CU_initialize_registry())
......@@ -191,8 +193,9 @@ int mediastreamer2_tester_run_tests(const char *suite_name, const char *test_nam
printf("\n");
}
ret=CU_get_number_of_tests_failed()!=0;
CU_cleanup_registry();
return CU_get_error();
return ret;
}
void helper(const char *name) {
......@@ -220,7 +223,11 @@ void helper(const char *name) {
}
#ifndef WINAPI_FAMILY_PHONE_APP
#if TARGET_OS_MAC
int _main (int argc, char *argv[]) {
#else
int main (int argc, char *argv[]) {
#endif
int i;
int ret;
const char *suite_name = NULL;
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment