Example #1
0
        private OperationResponse LoadDefaultProfile()
        {
            OperationResponse rs = new OperationResponse();

            OnvifServices.v10.Media.Profile[] profiles = null;

            try
            {
                profiles = this.Media.GetProfiles();

                if (profiles == null || profiles.Length == 0)
                {
                    _profile = new OnvifServices.v10.Media.Profile();

                    rs.Message   = "No se encontro ningun Perfil para utiliar";
                    rs.IsSuccess = false;

                    RaiseOnLog(rs.Message);

                    return(rs);
                }

                this.SetCurrentProfile(profiles[0].token);

                rs.IsSuccess = true;
            }
            catch (Exception ex)
            {
                _profile = new OnvifServices.v10.Media.Profile();

                rs.IsSuccess = false;
                rs.Exception = ex;
                rs.Message   = "Error conectando con servicio ONVIF Media";

                RaiseOnLog(rs);
            }

            return(rs);
        }
Example #2
0
 public void SetCurrentProfile(string profileToken)
 {
     _profile = this.Media.GetProfile(profileToken);
 }