Skip to content

Commit f534803

Browse files
committed
mediastreamer2_adaptive_tester.c: disable stateful tests for yet
1 parent 36213e7 commit f534803

File tree

2 files changed

+47
-46
lines changed

2 files changed

+47
-46
lines changed

src/videofilters/msosxdisplay.m

Lines changed: 45 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
/*
22
msosxdisplay.m
33
Copyright (C) 2011 Belledonne Communications, Grenoble, France
4-
4+
55
This program is free software; you can redistribute it and/or
66
modify it under the terms of the GNU General Public License
77
as published by the Free Software Foundation; either version 2
88
of the License, or (at your option) any later version.
9-
9+
1010
This program is distributed in the hope that it will be useful,
1111
but WITHOUT ANY WARRANTY; without even the implied warranty of
1212
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1313
GNU General Public License for more details.
14-
14+
1515
You should have received a copy of the GNU General Public License
1616
along with this program; if not, write to the Free Software
1717
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
@@ -55,12 +55,12 @@ - (id)init {
5555
self->prevBounds = CGRectMake(0, 0, 0, 0);
5656
self->lock = [[NSRecursiveLock alloc] init];
5757
self->display_helper = ogl_display_new();
58-
58+
5959
[self setOpaque:YES];
6060
[self setAsynchronous:NO];
6161
[self setAutoresizingMask: kCALayerWidthSizable | kCALayerHeightSizable];
6262
[self setNeedsDisplayOnBoundsChange:YES];
63-
63+
6464
// FBO Support
6565
GLint numPixelFormats = 0;
6666
CGLPixelFormatAttribute attributes[] =
@@ -70,19 +70,19 @@ - (id)init {
7070
kCGLPFADoubleBuffer,
7171
0
7272
};
73-
73+
7474
CGLChoosePixelFormat(attributes, &cglPixelFormat, &numPixelFormats);
7575
assert(cglPixelFormat);
76-
76+
7777
cglContext = [super copyCGLContextForPixelFormat:cglPixelFormat];
7878
assert(cglContext);
79-
79+
8080
CGLContextObj savedContext = CGLGetCurrentContext();
8181
CGLSetCurrentContext(cglContext);
8282
CGLLockContext(cglContext);
83-
83+
8484
ogl_display_init(display_helper, prevBounds.size.width, prevBounds.size.height);
85-
85+
8686
CGLUnlockContext(cglContext);
8787
CGLSetCurrentContext(savedContext);
8888
}
@@ -93,17 +93,17 @@ - (void)dealloc {
9393
CGLContextObj savedContext = CGLGetCurrentContext();
9494
CGLSetCurrentContext(cglContext);
9595
CGLLockContext(cglContext);
96-
96+
9797
ogl_display_uninit(display_helper, TRUE);
9898
ogl_display_free(display_helper);
99-
99+
100100
CGLUnlockContext(cglContext);
101101
CGLSetCurrentContext(savedContext);
102-
102+
103103
[self releaseCGLContext:cglContext];
104104
[self releaseCGLPixelFormat:cglPixelFormat];
105105
[lock release];
106-
106+
107107
[super dealloc];
108108
}
109109

@@ -125,31 +125,31 @@ - (void)releaseCGLContext:(CGLContextObj)glContext {
125125
CGLReleaseContext(cglContext);
126126
}
127127

128-
- (void)drawInCGLContext:(CGLContextObj)glContext
129-
pixelFormat:(CGLPixelFormatObj)pixelFormat
130-
forLayerTime:(CFTimeInterval)timeInterval
131-
displayTime:(const CVTimeStamp *)timeStamp {
128+
- (void)drawInCGLContext:(CGLContextObj)glContext
129+
pixelFormat:(CGLPixelFormatObj)pixelFormat
130+
forLayerTime:(CFTimeInterval)timeInterval
131+
displayTime:(const CVTimeStamp *)timeStamp {
132132
if([lock tryLock]) {
133133
CGLContextObj savedContext = CGLGetCurrentContext();
134134
CGLSetCurrentContext(cglContext);
135135
CGLLockContext(cglContext);
136-
136+
137137
if (!CGRectEqualToRect(prevBounds, [self bounds])) {
138138
prevBounds = [self bounds];
139139
ogl_display_set_size(display_helper, prevBounds.size.width, prevBounds.size.height);
140140
}
141-
141+
142142
glClearColor(0, 0, 0, 0);
143143
glClear(GL_COLOR_BUFFER_BIT);
144144
ogl_display_render(display_helper, 0);
145-
145+
146146
CGLUnlockContext(cglContext);
147147
CGLSetCurrentContext(savedContext);
148148
CGLFlushDrawable(cglContext);
149-
150-
[super drawInCGLContext:glContext
151-
pixelFormat:pixelFormat
152-
forLayerTime:timeInterval
149+
150+
[super drawInCGLContext:glContext
151+
pixelFormat:pixelFormat
152+
forLayerTime:timeInterval
153153
displayTime:timeStamp];
154154
[lock unlock];
155155
}
@@ -219,7 +219,7 @@ - (id)init {
219219

220220
- (void)resetContainers {
221221
[glLayer removeFromSuperlayer];
222-
222+
223223
if(window != nil) {
224224
if(closeWindow) {
225225
[window close];
@@ -241,14 +241,14 @@ - (void)setWindow:(NSWindow*)awindow {
241241
if(window == awindow) {
242242
return;
243243
}
244-
244+
245245
[self resetContainers];
246-
246+
247247
if(awindow != nil) {
248248
window = [awindow retain];
249249
[glLayer setFrame:[[window.contentView layer] bounds]];
250250
[[window.contentView layer] addSublayer: glLayer];
251-
251+
252252
glLayer.sourceSize = CGSizeMake(0, 0); // Force window resize
253253
}
254254
}
@@ -257,9 +257,9 @@ - (void)setView:(NSView*)aview {
257257
if(view == aview) {
258258
return;
259259
}
260-
260+
261261
[self resetContainers];
262-
262+
263263
if(aview != nil) {
264264
view = [aview retain];
265265
[view setWantsLayer:YES];
@@ -272,9 +272,9 @@ - (void)setLayer:(CALayer*)alayer {
272272
if(layer == alayer) {
273273
return;
274274
}
275-
275+
276276
[self resetContainers];
277-
277+
278278
if(alayer != nil) {
279279
layer = [alayer retain];
280280
[glLayer setFrame:[layer bounds]];
@@ -294,24 +294,25 @@ - (void)createWindowIfNeeded {
294294
CGFloat xPos = NSWidth([[awindow screen] frame])/2 - NSWidth([awindow frame])/2;
295295
CGFloat yPos = NSHeight([[awindow screen] frame])/2 - NSHeight([awindow frame])/2;
296296
[awindow setFrame:NSMakeRect(xPos, yPos, NSWidth([awindow frame]), NSHeight([awindow frame])) display:YES];
297-
297+
298298
// Init view
299299
NSView *innerView = [[NSView alloc] initWithFrame:[window frame]];
300300
[innerView setWantsLayer:YES];
301301
[innerView.layer setAutoresizingMask: kCALayerWidthSizable | kCALayerHeightSizable];
302302
[innerView.layer setNeedsDisplayOnBoundsChange: YES];
303303
[awindow setContentView: innerView];
304304
[innerView release];
305-
305+
306306
self.window = awindow;
307307
self.closeWindow = TRUE;
308308
}
309309
}
310310

311311
- (void)dealloc {
312312
[self resetContainers];
313+
[self.glLayer release];
313314
self.glLayer = nil;
314-
315+
315316
[super dealloc];
316317
}
317318

@@ -336,7 +337,7 @@ static void osx_gl_process(MSFilter* f) {
336337
OSXDisplay* thiz = (OSXDisplay*) f->data;
337338
mblk_t* m = 0;
338339
MSPicture pic;
339-
340+
340341
NSAutoreleasePool *loopPool = [[NSAutoreleasePool alloc] init];
341342

342343
if ((m=ms_queue_peek_last(f->inputs[0])) != NULL) {
@@ -345,14 +346,14 @@ static void osx_gl_process(MSFilter* f) {
345346
// Source size change?
346347
if (pic.w != thiz.glLayer.sourceSize.width || pic.h != thiz.glLayer.sourceSize.height) {
347348
thiz.glLayer.sourceSize = CGSizeMake(pic.w, pic.h);
348-
349+
349350
// Force window resize
350351
if(thiz.window != nil) {
351352
[thiz.glLayer performSelectorOnMainThread:@selector(resizeToWindow:) withObject:thiz.window waitUntilDone:FALSE];
352353
}
353354
}
354355
ogl_display_set_yuv_to_display(thiz.glLayer->display_helper, m);
355-
356+
356357
// Force redraw
357358
[thiz.glLayer performSelectorOnMainThread:@selector(setNeedsDisplay) withObject:nil waitUntilDone:FALSE];
358359
}
@@ -367,7 +368,7 @@ static void osx_gl_process(MSFilter* f) {
367368
if (thiz != nil) {
368369
if (!mblk_get_precious_flag(m)) ms_yuv_buf_mirror(&pic);
369370
ogl_display_set_preview_yuv_to_display(thiz.glLayer->display_helper, m);
370-
371+
371372
// Force redraw
372373
[thiz.glLayer performSelectorOnMainThread:@selector(setNeedsDisplay) withObject:nil waitUntilDone:FALSE];
373374
}
@@ -396,7 +397,7 @@ static int osx_gl_set_vsize(MSFilter* f, void* arg) {
396397
static int osx_gl_get_native_window_id(MSFilter* f, void* arg) {
397398
OSXDisplay* thiz = (OSXDisplay*) f->data;
398399
unsigned long *winId = (unsigned long*)arg;
399-
int ret = -1;
400+
int ret = -1;
400401
if(thiz != nil) {
401402
if(thiz.window != nil) {
402403
*winId = (unsigned long)thiz.window;
@@ -407,7 +408,7 @@ static int osx_gl_get_native_window_id(MSFilter* f, void* arg) {
407408
} else if(thiz.layer != nil) {
408409
*winId = (unsigned long)thiz.layer;
409410
ret = 0;
410-
} else if(thiz.autoWindow) {
411+
} else if(thiz.autoWindow) {
411412
*winId = MS_FILTER_VIDEO_AUTO;
412413
ret = 0;
413414
} else {
@@ -422,7 +423,7 @@ static int osx_gl_set_native_window_id(MSFilter* f, void* arg) {
422423
OSXDisplay* thiz = (OSXDisplay*) f->data;
423424
unsigned long winId = *((unsigned long*)arg);
424425
NSObject *obj = *((NSObject **)arg);
425-
int ret = -1;
426+
int ret = -1;
426427
if(thiz != nil) {
427428
NSAutoreleasePool *loopPool = [[NSAutoreleasePool alloc] init];
428429
if(winId != MS_FILTER_VIDEO_AUTO && winId != MS_FILTER_VIDEO_NONE) {
@@ -441,7 +442,7 @@ static int osx_gl_set_native_window_id(MSFilter* f, void* arg) {
441442
thiz.autoWindow = FALSE;
442443
} else {
443444
thiz.autoWindow = TRUE;
444-
}
445+
}
445446
[thiz performSelectorOnMainThread:@selector(resetContainers) withObject:nil waitUntilDone:NO];
446447
ret = 0;
447448
}

tester/mediastreamer2_adaptive_tester.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ static void upload_bitrate_opus_3g() {
444444
upload_bitrate("opus", OPUS_PAYLOAD_TYPE, THIRDGENERATION_BW, 200);
445445
}
446446

447-
#if VIDEO_ENABLED
447+
#if VIDEO_ENABLED && 0
448448
void adaptive_video(int max_bw, int exp_min_bw, int exp_max_bw, int loss_rate, int exp_min_loss, int exp_max_loss) {
449449
bool_t supported = ms_filter_codec_supported("VP8");
450450
if( supported ) {
@@ -486,7 +486,7 @@ static test_t tests[] = {
486486
{ "Upload bitrate [opus] - edge", upload_bitrate_opus_edge },
487487
{ "Upload bitrate [opus] - 3g", upload_bitrate_opus_3g },
488488

489-
#if VIDEO_ENABLED
489+
#if VIDEO_ENABLED && 0
490490
{ "Network detection [VP8] - ideal", adaptive_vp8_ideal },
491491
{ "Network detection [VP8] - lossy", adaptive_vp8_lossy },
492492
{ "Network detection [VP8] - congested", adaptive_vp8_congestion },

0 commit comments

Comments
 (0)