Under Qanun-e-Shahadat who is bound to determine competency of witness ?

Under Qanun-e-Shahadat who is bound to determine competency of witness ?

A. Prosecution or plaintiff
B. Court
C. Accused or defendant
D. None of these