diff --git a/lib/native/windows-64/jawtrenderer.dll b/lib/native/windows-64/jawtrenderer.dll index 79f2f7abe..9fa486a4c 100755 Binary files a/lib/native/windows-64/jawtrenderer.dll and b/lib/native/windows-64/jawtrenderer.dll differ diff --git a/lib/native/windows/jawtrenderer.dll b/lib/native/windows/jawtrenderer.dll index 77150dec1..6163f058f 100644 Binary files a/lib/native/windows/jawtrenderer.dll and b/lib/native/windows/jawtrenderer.dll differ diff --git a/src/native/jawtrenderer/JAWTRenderer_Windows.cpp b/src/native/jawtrenderer/JAWTRenderer_Windows.cpp index 68fd81c6b..52c3354e2 100644 --- a/src/native/jawtrenderer/JAWTRenderer_Windows.cpp +++ b/src/native/jawtrenderer/JAWTRenderer_Windows.cpp @@ -95,10 +95,10 @@ jboolean JAWTRenderer_paint if(!blitter->device->validate()) { - blitter->lost = true; - return JNI_TRUE; + blitter->lost = true; + return JNI_TRUE; } - + blitter->device->render(blitter->surface); return JNI_TRUE; } @@ -119,6 +119,9 @@ jboolean JAWTRenderer_process if(!blitter->device || blitter->width != width || blitter->height != height || blitter->lost) { + D3DSurface* oldSurface = NULL; + D3DDevice* oldDevice = NULL; + blitter->lost = false; /* size has changed, recreate our device and surface */ @@ -134,6 +137,11 @@ jboolean JAWTRenderer_process blitter->device = NULL; } + if(blitter->hwnd == NULL) + { + return JNI_TRUE; + } + blitter->device = blitter->d3d->createDevice(blitter->hwnd, width, height); @@ -141,6 +149,7 @@ jboolean JAWTRenderer_process { /* device creation failed */ + blitter->surface = NULL; /* maybe we go fullscreen and/or hwnd of the window has changed * so we return true to force native method to be called and so * update blitter->hwnd for the next call diff --git a/src/native/jawtrenderer/windows/d3d_device.cpp b/src/native/jawtrenderer/windows/d3d_device.cpp index 16c7c4225..73e3015c2 100644 --- a/src/native/jawtrenderer/windows/d3d_device.cpp +++ b/src/native/jawtrenderer/windows/d3d_device.cpp @@ -72,7 +72,7 @@ D3DDevice::~D3DDevice() { if(m_backSurface) { - m_backSurface->Release(); + //m_backSurface->Release(); } if(m_device) diff --git a/src/net/java/sip/communicator/impl/neomedia/jmfext/media/renderer/video/JAWTRenderer.java b/src/net/java/sip/communicator/impl/neomedia/jmfext/media/renderer/video/JAWTRenderer.java index d3394b125..3d563de58 100644 --- a/src/net/java/sip/communicator/impl/neomedia/jmfext/media/renderer/video/JAWTRenderer.java +++ b/src/net/java/sip/communicator/impl/neomedia/jmfext/media/renderer/video/JAWTRenderer.java @@ -354,12 +354,16 @@ public synchronized int process(Buffer buffer) } Component component = getComponent(); - boolean repaint - = process( + boolean repaint = false; + + synchronized(this) + { + repaint = process( handle, component, (int[]) buffer.getData(), buffer.getOffset(), bufferLength, size.width, size.height); + } if (repaint) component.repaint(); diff --git a/src/net/java/sip/communicator/impl/neomedia/videoflip/VideoFlipEffect.java b/src/net/java/sip/communicator/impl/neomedia/videoflip/VideoFlipEffect.java index 5142ec143..48934c20f 100644 --- a/src/net/java/sip/communicator/impl/neomedia/videoflip/VideoFlipEffect.java +++ b/src/net/java/sip/communicator/impl/neomedia/videoflip/VideoFlipEffect.java @@ -116,7 +116,7 @@ public Format[] getSupportedOutputFormats(Format input) return new Format[] { - (Format)input.clone(), + (Format)input.clone(), }; } @@ -150,7 +150,7 @@ public Format setOutputFormat(Format format) * @throws ResourceUnavailableException If all of the required resources * cannot be acquired. */ - public void open() throws ResourceUnavailableException + public synchronized void open() throws ResourceUnavailableException { graph = FFmpeg.avfilter_alloc_filtergraph(); inputstream = FFmpeg.avfilter_alloc_inputstream(); @@ -160,7 +160,7 @@ public void open() throws ResourceUnavailableException /** * Closes this effect. */ - public void close() + public synchronized void close() { if(graph != 0) { @@ -202,7 +202,7 @@ public String getName() * @return BUFFER_PROCESSED_OK if the processing is successful. * @see PlugIn */ - public int process(Buffer inputBuffer, Buffer outputBuffer) + public synchronized int process(Buffer inputBuffer, Buffer outputBuffer) { int ret = 0;