def validate_iso_and_shutter(iso=None, s_speed=None):
    """Validate iso value and shutter speed.

    Both iso value and shutter speed must be a pre-defined value.
    See the THETA developers site:
    https://developers.theta360.com/en/docs/v2/api_reference/

    :rtype: tuple, (int, int or float)
    :returns: iso and shutter speed which can be set to the RICOH THETA API v2.
    :raises: ValueError if parameters does not match the Theta v2 SDK format.
    """

    authorized_iso = [
        100, 125, 160, 200, 250, 320, 400, 500, 640, 800, 1000, 1250, 1600]

    authorized_ss = [
        0.00015625, 0.0002, 0.00025, 0.0003125, 0.0004, 0.0005,
        0.000625, 0.0008, 0.001, 0.00125, 0.0015625, 0.002,
        0.0025, 0.003125, 0.004, 0.005, 0.00625, 0.008,
        0.01, 0.0125, 0.01666666, 0.02, 0.025, 0.03333333,
        0.04, 0.05, 0.06666666, 0.07692307, 0.1, 0.125, 0.16666666, 0.2,
        0.25, 0.33333333, 0.4, 0.5, 0.625, 0.76923076, 1,
        1.3, 1.6, 2, 2.5, 3.2, 4, 5, 6, 8, 10, 13, 15, 20, 25, 30, 60]

    authorized_ss_frac = [
        '1/6400', '1/5000', '1/4000', '1/3200', '1/2500', '1/2000',
        '1/1600', '1/1250', '1/1000', '1/800', '1/640', '1/500',
        '1/400', '1/320', '1/250', '1/200', '1/160', '1/125',
        '1/100', '1/80', '1/60', '1/50', '1/40', '1/30',
        '1/25', '1/20', '1/15', '1/13', '1/10', '1/8', '1/6', '1/5',
        '1/4', '1/3', '1/2.5', '1/2', '1/1.6', '1/1.3', '1/1',
        '1.3/1', '1.6/1', '2/1', '2.5/1', '3.2/1', '4/1', '5/1',
        '6/1', '8/1', '10/1', '13/1', '15/1', '20/1', '25/1', '30/1', '60/1']

    if not iso is None:
        if not iso in authorized_iso:
            raise ValueError('Unsupported iso value.')

    if not s_speed is None:
        for (frac, speed) in zip(authorized_ss_frac, authorized_ss):
            if frac == s_speed:
                s_speed = speed
                break
            elif speed == s_speed:
                break
        else:
            raise ValueError('Unsupported shutter speed.')

        if (s_speed > 0.125) and (iso is None):
            raise ValueError('Both iso value and shutter speed should be specified '
                             'when the shutter speed is longer than 1/6 sec.')

    return (iso, s_speed)