|
Compy 0.2.0
A lightweight RTSP 1.0 server library for embedded systems
|
An RTSP requests controller. More...
#include <compy/context.h>#include <compy/droppable.h>#include <compy/types/request.h>#include <compy/writer.h>#include <stddef.h>#include <interface99.h>

Go to the source code of this file.
Macros | |
| #define | Compy_Controller_IFACE |
| A controller that handles incoming RTSP requests. | |
| #define | Compy_Controller_EXTENDS (Compy_Droppable) |
| The superinterfaces of Compy_Controller_IFACE. | |
Enumerations | |
| enum | Compy_ControlFlow { Compy_ControlFlow_Break , Compy_ControlFlow_Continue } |
| Whether to stop or continue some processing. More... | |
Functions | |
| interface99 (Compy_Controller) | |
Defines the Compy_Controller interface. | |
| void | compy_dispatch (Compy_Writer conn, Compy_Controller controller, const Compy_Request *restrict req) |
Dispatches an incoming request to controller. | |
An RTSP requests controller.
| #define Compy_Controller_IFACE |
A controller that handles incoming RTSP requests.
All RTSP command handlers accept the following parameters:
ctx – a request context used to respond to your RTSP client.req – a fully parsed request object. | enum Compy_ControlFlow |
| void compy_dispatch | ( | Compy_Writer | conn, |
| Compy_Controller | controller, | ||
| const Compy_Request *restrict | req | ||
| ) |
Dispatches an incoming request to controller.
The algorithm is as follows:
before method of controller. Here you should do some preliminary stuff like logging a request or setting up initial response headers via compy_header. If before returns Compy_ControlFlow_Break, jump to step #4.controller. Here you should handle the request and respond to your client via compy_respond/compy_respond_ok or similar.after method of controller. Here you automatically receive the return value of compy_respond_* (invoked during one of the previous steps). If it is <0, it means that something bad happened so that the handler has not been able to respond properly.| [out] | conn | The writer to send RTSP responses. |
| [in] | controller | The controller to handle the incoming request req. |
| [in] | req | The fully parsed RTSP request object. |
conn.self && conn.vptr controller.self && controller.vptr req != NULL | interface99 | ( | Compy_Controller | ) |
Defines the Compy_Controller interface.
See Interface99 for the macro usage.