-
Notifications
You must be signed in to change notification settings - Fork 5
/
videoReader.m
41 lines (33 loc) · 1.02 KB
/
videoReader.m
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
classdef videoReader < matlab.System
% Pre-computed constants
properties(Access = private, Nontunable)
v
end
methods(Access = protected)
function setupImpl(obj)
% Perform one-time calculations, such as computing constants
obj.v = VideoReader('livedata.mp4');
end
function y = stepImpl(obj)
% Calculate y as a function of input u and discrete states.
if hasFrame(obj.v)
out = readFrame(obj.v);
else
out = zeros(480, 640, 3);
end
y = uint8(out);
end
function out = getOutputSizeImpl(obj)
out = [480 640 3];
end
function y1 = getOutputDataTypeImpl(obj)
y1 = 'uint8';
end
function y1 = isOutputComplexImpl(~)
y1 = false;
end
function out = isOutputFixedSizeImpl(obj)
out = true;
end
end
end