restInspectFrame

class restInspectFrame : public kotekan::Stage

Exposes the binary contents of a buffer frame (or subset there of) to the REST server via a GET request.

Returns the latest data copied into the internal frame frame_copy. The length of this data is either the frame size, or the len config option When returning data to the REST client, this class will not update frame_copy So it’s possible that if too many requests are made, it will keep returning the same (old) frame contents. This is a side effect of trying to prevent the system from locking up the buffer itself. We might want to adjust this someday, but for testing this seems like a reasonable compromise.

Todo:

Once the new buffers are implemented this should use the frame “freeze out” method instead of doing memory copies.

REST Endpoints

  • /inspect_frame/<buffer name> GET Returns binary data from the latest frame in the buffer given in in_buf

Buffers

  • in_buf Input kotekan buffer

    • Format: Any

    • Metadata: Any

Author

Andre Renard

Warning

This stage makes a copy of the data in each and every frame ( upto len ). So it should not be used in places where this extra memory copy would be expensive for the system to deal with, and should only be enabled when it is needed for trouble shooting.

Param len:

Int. the amount of bindary data in bytes to return from the front of the latest frame. Default the frame size of in_buf Note if set to zero, this will be set to frame size of in_buf

Public Functions

restInspectFrame(kotekan::Config &config, const std::string &unique_name, kotekan::bufferContainer &buffer_container)

Constructor.

virtual ~restInspectFrame()

Destructor.

virtual void main_thread() override

Gets the latest frame from in_buf and copies it to frame_copy.

void rest_callback(kotekan::connectionInstance &conn)

Retruns the binary data in frame_copy to the REST client.

Internal callback function, shouldn’t be directly called outside the HTTP/REST server

Parameters:

conn – The HTTP connection object