def _set_annotate_text(self, value):
    self._check_camera_open()
    mp = self._camera.control.params[mmal.MMAL_PARAMETER_ANNOTATE]
    mp.enable = bool((value or mp.show_frame_num))
    if mp.enable:
        try:
            mp.text = value.encode('ascii')
        except ValueError as e:
            raise PiCameraValueError(str(e))
    self._camera.control.params[mmal.MMAL_PARAMETER_ANNOTATE] = mp
def _set_annotate_text(self, value):
    self._check_camera_open()
    mp = self._camera.control.params[mmal.MMAL_PARAMETER_ANNOTATE]
    mp.enable = bool((value or mp.show_frame_num))
    if mp.enable:
        try:
            mp.text = value.encode('ascii')
        except ValueError as e:
            raise PiCameraValueError(str(e))
    self._camera.control.params[mmal.MMAL_PARAMETER_ANNOTATE] = mp