getinfo.m 817 B

1234567891011121314151617181920212223242526
  1. function info = getinfo(vw)
  2. %INFO=GETINFO(VW)
  3. % Returns a structure whose fields contain information about the opened
  4. % video object. This structure may be flattened to a cell array and used
  5. % with the videoWriter constructor to recreate the current video file.
  6. %
  7. %SEE ALSO
  8. % videoWriter
  9. %
  10. %Copyright (c) 2006 Gerald Dalley
  11. %See "MIT.txt" in the installation directory for licensing details (especially
  12. %when using this library on GNU/Linux).
  13. [names, vals] = feval(vw.plugin, 'getinfo', vw.handle);
  14. info = cell2struct({vals{:}}, {names{:}}, 2);
  15. % be nice and convert anything that looks like a number into one.
  16. for i=1:length(names)
  17. name = names{i};
  18. if (length(info.(name)) < 64)
  19. num = str2num(info.(name));
  20. if numel(num) > 0
  21. info.(name) = num;
  22. end
  23. end
  24. end