function throwObsoletePackageWarning(className, varargin)
%throwObsoletePackageWarning Throws warning for obsolete video package

%   Copyright 1995-2010 The MathWorks, Inc.
%   $Revision: 1.1.6.2 $Date: 2010/11/01 23:13:27 $

oldName = className;

if nargin > 1
    newName = varargin{1};
else
    if strncmp(oldName(end-1:end), '2D', 2)
        newName = oldName(1:end-2);
    else
        newName = oldName;
    end
end

warning('vision:video:obsoleteVideoPackage', ...
    ['video.%s will be removed in a future release.' ...
    ' Use vision.%s instead. Run SYSOBJUPDATE to automatically '...
    'update your code. See Computer Vision System Toolbox Release Notes '...
    'for more information.'], ...
    oldName, newName);
end