~ubuntu-branches/ubuntu/trusty/psychtoolbox-3/trusty-proposed

« back to all changes in this revision

Viewing changes to Psychtoolbox/PsychVideoCapture/PsychVideoDelayLoop.m

  • Committer: Package Import Robot
  • Author(s): Yaroslav Halchenko
  • Date: 2013-11-19 23:34:50 UTC
  • mfrom: (3.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20131119233450-f7nf92vb8qavjmk8
Tags: 3.0.11.20131017.dfsg1-3
Upload to unsable since fresh glew has arrived to sid!

Show diffs side-by-side

added added

removed removed

Lines of Context:
542
542
        dstrect = CenterRect(ROI, Screen('Rect', win));
543
543
    end
544
544
 
545
 
    if mirrored>0 | upsidedown>0 %#ok<OR2>
 
545
    if mirrored>0 || upsidedown>0
546
546
        % Setup transformation for our image.
547
547
        Screen('glPushMatrix', win);
548
548
        [hw hh] = RectCenter(dstrect);
601
601
    while (tonset - tstart) < aborttimeout
602
602
        % Calling KbCheck is expensive (often more than 1 millisecond). We avoid it,
603
603
        % if onlinecontrol is disabled and no abort keys are set.
604
 
        if ~isempty(abortkeys) | onlinecontrol %#ok<OR2>
 
604
        if ~isempty(abortkeys) || onlinecontrol
605
605
            % Check for keypress:
606
606
            [down secs keycode] = KbCheck;
607
607
            
665
665
        [tex cts nrdropped]=Screen('GetCapturedImage', win, grabber, 1, recycledtex);
666
666
 
667
667
        % Frame dropped during this capture cycle?
668
 
        if nrdropped > 0 & verbose > 1 %#ok<AND2>
 
668
        if nrdropped > 0 && verbose > 1
669
669
            fprintf('Frame dropped: %i, %f\n', capturecount, (cts-oldcts)*1000);
670
670
        end;
671
671
 
672
 
        if (cts < oldcts & oldcts~=tstart & verbose >0) %#ok<AND2>
 
672
        if (cts < oldcts && oldcts~=tstart && verbose >0)
673
673
            fprintf('BUG! TIMESTAMP REVERSION AT FRAME %i, DELTA = %f !!!\n', capturecount, (cts-oldcts)*1000);
674
674
        end;
675
675
 
722
722
                timestamps(3, readcount) = timestamps(2, readcount) + camlatency;
723
723
            end;
724
724
 
725
 
            if (recordframes>0) & (privateMod(readcount, recordframes)==0) %#ok<AND2>
 
725
            if (recordframes>0) && (privateMod(readcount, recordframes)==0)
726
726
                captexscount = captexscount + 1;
727
727
                captexs(1, captexscount) = tex;
728
728
                captexs(2, captexscount) = tonset;
743
743
    % Done with video feedback loop. Shutdown video capture:
744
744
    rc.telapsed = GetSecs - tstart;
745
745
 
746
 
    if mirrored>0 | upsidedown>0 %#ok<OR2>
 
746
    if mirrored>0 || upsidedown>0
747
747
        % Undo image transforms:
748
748
        Screen('glPopMatrix', win);
749
749
    end;