stop_recording Function

private function stop_recording(self, frames) result(ok)

Stop recording: ffmpeg finishes the file. The window's time goes on from where the video was, on the wall clock again. frames: the frames written. Returns false if not recording or if the recording failed (ffmpeg's messages are on the standard error).

Type Bound

WindowProxy

Arguments

Type IntentOptional Attributes Name
class(WindowProxy), intent(inout) :: self
integer(kind=int64), intent(out), optional :: frames

frames written to the video

Return Value logical


Calls

proc~~stop_recording~~CallsGraph proc~stop_recording WindowProxy%stop_recording interface~vkf_viewer_record_stop vkf_viewer_record_stop proc~stop_recording->interface~vkf_viewer_record_stop proc~set_time~4 SimulationClock%set_time proc~stop_recording->proc~set_time~4 proc~synchronized_to SimulationClock%synchronized_to proc~stop_recording->proc~synchronized_to proc~wall_time wall_time proc~stop_recording->proc~wall_time proc~window_wall window_wall proc~stop_recording->proc~window_wall proc~set_time~4->proc~set_time~4 proc~now now proc~set_time~4->proc~now proc~window_wall->proc~wall_time proc~now->proc~wall_time

Called by

proc~~stop_recording~~CalledByGraph proc~stop_recording WindowProxy%stop_recording proc~close WindowProxy%close proc~close->proc~stop_recording proc~frame WindowProxy%frame proc~frame->proc~stop_recording proc~resize WindowProxy%resize proc~resize->proc~frame proc~run WindowProxy%run proc~run->proc~frame

Source Code

    logical function stop_recording(self, frames) result(ok)
        class(WindowProxy), intent(inout) :: self
        integer(int64), intent(out), optional :: frames     !! frames written to the video
        integer(c_long_long) :: n
        real(wp) :: shift
        ok = .false.
        if (present(frames)) frames = 0_int64
        if (.not. self%recording_) return
        n = -1
        if (c_associated(self%viewer_)) n = vkf_viewer_record_stop(self%viewer_)
        shift = wall_time() - window_wall(self)
        self%recording_ = .false.
        if (.not. associated(self%clock_%synchronized_to())) call self%clock_%set_time(self%clock_%time())
        if (self%flight%active) self%flight%started = self%flight%started + shift
        ok = n >= 0
        if (present(frames)) frames = max(0_c_long_long, n)
    end function stop_recording