function sl_internal_customization( cm ) % ( cm )
    if slfeature('SLGlueBigSwitch')
        if loc_TestInstallation
       
            im = DAS.InterfaceManager.getApplicationIM( 'Simulink' );
            
            if ~isempty( im )
                feature( 'scopedAccelEnablement', 'off' );
                % add Actions
                im.addAction( 'Simulink:MPlayVideoViewer', @MPlayVideoViewer, {}, { 'Simulink:Model' } );
            end
        end
    else
        cm.addCustomMenuFcn( 'Simulink:ToolsMenu', @getVIPMenuItems );
    end
    
    if loc_TestInstallation
    
        % Initialize the viewers in the ViewerLibraryCache.
        cache = Simulink.scopes.ViewerLibraryCache.Instance;
        
        % Get the default icon to be used in Signal and Scope manager
        defaultIcon = Simulink.scopes.getIconFile('default');
        
        % In the following viewer/generator block structure (b), the fields ioType,
        % ioRegCallbackFile, ioRegIconDisplay, ioRegSelectionMode, and
        % ioRegPortPrefix are used by the Signal and Scope manager GUI. The
        % value of field "ioType" must be the MaskType of the block. If the
        % block does not have a MaskType or it is empty, use BlockType.
        
        if ~ispc
            % VIP Viewers All
            libinfo = struct;
            libinfo.iotype = 'viewer';
            libinfo.name = 'vipviewers_all';
            libinfo.label = 'Computer Vision';
            libinfo.tag = 'ComputerVision';
            libinfo.children = {};
            
            b = struct;
            b.label = 'MPlay';
            b.path = 'vipviewers_all/MPlay';
            b.tag = 'VipViewers_MPlay';
            b.ioType = 'MPlay';
            b.ioRegCallbackFile = 'sigandscopemgr';
            b.ioRegIconDisplay = defaultIcon;
            b.ioRegSelectionMode = 'multiple';
            b.ioRegPortPrefix = 'Input';
            libinfo.children = [ libinfo.children { b } ];
            
            % add the library...
            cache.addLibrary( libinfo );
        else
            % VIP Viewers Win32
            libinfo = struct;
            libinfo.iotype = 'viewer';
            libinfo.name = 'vipviewers_win32';
            libinfo.label = 'Computer Vision';
            libinfo.tag = 'ComputerVision';
            libinfo.children = {};
            
            b = struct;
            b.label = 'MPlay';
            b.path = 'vipviewers_win32/MPlay';
            b.tag = 'VipViewers_MPlay';
            b.ioType = 'MPlay';
            b.ioRegCallbackFile = 'sigandscopemgr';
            b.ioRegIconDisplay = defaultIcon;
            b.ioRegSelectionMode = 'multiple';
            b.ioRegPortPrefix = 'Input';
            libinfo.children = [ libinfo.children { b } ];
            
            b = struct;
            b.label = 'To Video Display';
            b.path = 'vipviewers_win32/To Video Display';
            b.tag = 'VipViewers_To_Video_Display';
            b.ioType = 'To Video Display';
            b.ioRegCallbackFile = 'sigandscopemgr';
            b.ioRegIconDisplay = defaultIcon;
            b.ioRegSelectionMode = 'multiple';
            b.ioRegPortPrefix = 'Input';
            libinfo.children = [ libinfo.children { b } ];
            
            % add the library...
            cache.addLibrary( libinfo );
        end
        
        % VIP Generators All
        libinfo = struct;
        libinfo.iotype = 'siggen';
        libinfo.name = 'vipgenerators_all';
        libinfo.label = 'Computer Vision';
        libinfo.tag = 'ComputerVision';
        libinfo.children = {};
        
        b = struct;
        b.label = 'From Multimedia File';
        b.path = 'vipgenerators_all/From Multimedia File';
        b.tag = 'VipGenerators_From_Multimedia_File';
        b.ioType = 'From Multimedia File';
        b.ioRegCallbackFile = 'sigandscopemgr';
        b.ioRegIconDisplay = defaultIcon;
        b.ioRegSelectionMode = 'multiple';
        b.ioRegPortPrefix = 'Output';
        libinfo.children = [ libinfo.children { b } ];
        
        b = struct;
        b.label = 'Image From File';
        b.path = 'vipgenerators_all/Image From File';
        b.tag = 'VipGenerators_Image_From_File';
        b.ioType = 'Image From File';
        b.ioRegCallbackFile = 'sigandscopemgr';
        b.ioRegIconDisplay = defaultIcon;
        b.ioRegSelectionMode = 'multiple';
        b.ioRegPortPrefix = 'Output';
        libinfo.children = [ libinfo.children { b } ];
        
        b = struct;
        b.label = 'Image From Workspace';
        b.path = 'vipgenerators_all/Image From Workspace';
        b.tag = 'VipGenerators_Image_From_Workspace';
        b.ioType = 'Image From Workspace';
        b.ioRegCallbackFile = 'sigandscopemgr';
        b.ioRegIconDisplay = defaultIcon;
        b.ioRegSelectionMode = 'multiple';
        b.ioRegPortPrefix = 'Output';
        libinfo.children = [ libinfo.children { b } ];
        
        b = struct;
        b.label = 'Read Binary File';
        b.path = 'vipgenerators_all/Read Binary File';
        b.tag = 'VipGenerators_Read_Binary_File';
        b.ioType = 'Read Binary File';
        b.ioRegCallbackFile = 'sigandscopemgr';
        b.ioRegIconDisplay = defaultIcon;
        b.ioRegSelectionMode = 'multiple';
        b.ioRegPortPrefix = 'Output';
        libinfo.children = [ libinfo.children { b } ];
        
        b = struct;
        b.label = 'Video From Workspace';
        b.path = 'vipgenerators_all/Video From Workspace';
        b.tag = 'VipGenerators_Video_From_Workspace';
        b.ioType = 'Video From Workspace';
        b.ioRegCallbackFile = 'sigandscopemgr';
        b.ioRegIconDisplay = defaultIcon;
        b.ioRegSelectionMode = 'multiple';
        b.ioRegPortPrefix = 'Output';
        libinfo.children = [ libinfo.children { b } ];
        
        % add the library...
        cache.addLibrary( libinfo );
    end
    
end

function res = loc_TestInstallation
    res = ~isempty( ver( 'vision' ) ) && loc_TestLicense;
end

function res = loc_TestLicense
    res = license( 'test', 'Video_and_Image_Blockset' );
end

function schemaFcns = getVIPMenuItems() 
    schemaFcns = { @MPlayVideoViewer };
end

function schema = MPlayVideoViewer( ~ ) % ( cbinfo )
    schema          = sl_action_schema;
    schema.tag      = 'Simulink:MPlayVideoViewer';
    schema.label    = DAStudio.message( 'Simulink:studio:MPlayVideoViewer' );
    schema.callback = @MPlayVideoViewerCB;
    schema.autoDisableWhen = 'Busy';
end

function MPlayVideoViewerCB( ~ ) % ( cbinfo )
    mplay;
end
% EOF        