~josejuan-sanchez/jhelioviewer/soc

« back to all changes in this revision

Viewing changes to src/viewmodel/src/org/helioviewer/viewmodel/view/jp2view/J2KRender.java

  • Committer: José Juan Sánchez Hernández
  • Date: 2011-10-24 19:09:33 UTC
  • Revision ID: josejuan.sanchez@gmail.com-20111024190933-31ncf40hl3cimn7i
Modifications in the communication scheme. In this version the client updates the estimated bandwidth and the framerate. The miniview is disabled.

Show diffs side-by-side

added added

removed removed

Lines of Context:
268
268
                    intBuffer = new int[currParams.subImage.getNumPixels()];
269
269
                }
270
270
            }
271
 
 
272
 
            /****/
273
 
            boolean stop = false;
274
 
            /****/
275
271
            
276
 
            while (!compositorRef.Is_processing_complete() && !stop) {        
277
 
            //while (!compositorRef.Is_processing_complete()) {
278
 
                
279
 
                // DEBUG
280
 
                /****/
 
272
            boolean stopProcess = false;            
 
273
            while (!compositorRef.Is_processing_complete() && !stopProcess) {                   
281
274
                try{
282
275
                    compositorRef.Process(MAX_RENDER_SAMPLES, newRegion);                    
283
276
                } catch(kdu_jni.KduException e){
284
277
                        System.out.println("Exception: " + e.getMessage());
285
278
                        e.printStackTrace();
286
 
                        stop = true;
 
279
                        stopProcess = true;
287
280
                }
288
 
                /****/
289
281
                
290
282
                Kdu_coords newOffset = newRegion.Access_pos();
291
283
                Kdu_coords newSize = newRegion.Access_size();
358
350
                
359
351
                tfrm = System.currentTimeMillis();
360
352
                int curLayer = currParams.compositionLayer;
361
 
 
362
 
                /****/                
 
353
                                
363
354
                if (parentViewRef instanceof MovieView) {
364
355
 
365
356
                    MovieView parent = (MovieView) parentViewRef;
366
357
                    if (parent.getMaximumAccessibleFrameNumber() < curLayer) {
367
358
                        try {
 
359
                                /****/
368
360
                                System.out.println("[J2KRender] Thread.sleep(200)");
 
361
                                /****/
369
362
                            Thread.sleep(200);
370
363
                        } catch (InterruptedException e) {
371
364
                        }
372
365
                        parentViewRef.renderRequestedSignal.signal(RenderReasons.NEW_DATA);
373
366
                        break;
374
367
                    }
375
 
                }
376
 
                /****/                
 
368
                }                                
377
369
 
378
370
                if (movieMode && parentViewRef instanceof JHVJPXView) {
379
371
                    JHVJPXView jpxView = ((JHVJPXView) parentViewRef);