/usr/share/psychtoolbox-3/PsychDemos/MovieDemos/SimpleMovieDemo.m is in psychtoolbox-3-common 3.0.11.20140816.dfsg1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | function SimpleMovieDemo(moviename, windowrect)
% Most simplistic demo on how to play a movie.
%
% SimpleMovieDemo(moviename [, windowrect=[]]);
%
% This bare-bones demo plays a single movie whose name has to be provided -
% including the full filesystem path to the movie - exactly once, then
% exits. This is the most minimalistic way of doing it. For a more complex
% demo see PlayMoviesDemo. The remaining demos show more advanced concepts
% like proper timing etc.
%
% The demo will play our standard DualDiscs.mov movie if the 'moviename' is
% omitted.
%
% History:
% 02/05/2009 Created. (MK)
% 06/17/2013 Cleaned up. (MK)
% Check if Psychtoolbox is properly installed:
AssertOpenGL;
if nargin < 1 || isempty(moviename)
% No moviename given: Use our default movie:
moviename = [ PsychtoolboxRoot 'PsychDemos/MovieDemos/DualDiscs.mov' ];
end
if nargin < 2 || isempty(windowrect)
windowrect = [];
end
% Wait until user releases keys on keyboard:
KbReleaseWait;
% Select screen for display of movie:
screenid = max(Screen('Screens'));
try
% Open 'windowrect' sized window on screen, with black [0] background color:
win = Screen('OpenWindow', screenid, 0, windowrect);
% Open movie file:
movie = Screen('OpenMovie', win, moviename);
% Start playback engine:
Screen('PlayMovie', movie, 1);
% Playback loop: Runs until end of movie or keypress:
while ~KbCheck
% Wait for next movie frame, retrieve texture handle to it
tex = Screen('GetMovieImage', win, movie);
% Valid texture returned? A negative value means end of movie reached:
if tex<=0
% We're done, break out of loop:
break;
end
% Draw the new texture immediately to screen:
Screen('DrawTexture', win, tex);
% Update display:
Screen('Flip', win);
% Release texture:
Screen('Close', tex);
end
% Stop playback:
Screen('PlayMovie', movie, 0);
% Close movie:
Screen('CloseMovie', movie);
% Close Screen, we're done:
Screen('CloseAll');
catch %#ok<CTCH>
sca;
psychrethrow(psychlasterror);
end
return
|