Qt
TCP socket.
More...
#include <mxcpcAsynchronousCameraLiveMxPEGFastStream.h>
Inheritance diagram for mxcpcAsynchronousCameraLiveMxPEGFastStream:
Public Slots | |
void | processAuthentication (const QString &user, const QString &password) |
To be activated from an external place after the faststream source has emmitted the authenticationRequest() signal, or, alternatively: the processAuthenticationCancellation() slot. | |
void | processAuthenticationCancellation (void) |
To be activated from an external place after the faststream source has emmitted the authenticationRequest() signal, or, alternatively: the processAuthentication() slot. | |
Signals | |
void | bytesAvailable (void) |
Emitted when bytes have become available to be read. | |
void | authenticationRequest (QString msg) |
Emitted when during negotiation with the camera, need arises to get authentication information about the user. | |
Public Member Functions | |
mxcpcAsynchronousCameraLiveMxPEGFastStream (const mxcpcIPAddress &camera_ip, int camera_port, const mxcpcProxyConfiguration &camera_proxy_configuration, float fps=4) | |
mxcpcAsynchronousCameraLiveMxPEGFastStream (const mxcpcIPAddress &camera_ip, int port, float fps=4) | |
mxcpcAsynchronousCameraLiveMxPEGFastStream (const mxcpcIPAddress &camera_ip, int port, int fps=4) | |
mxcpcAsynchronousCameraLiveMxPEGFastStream (int ip1, int ip2, int ip3, int ip4, int port, int fps=4) | |
~mxcpcAsynchronousCameraLiveMxPEGFastStream () | |
int | fetchBytes (unsigned char *buffer, int num) |
Reimplemented. | |
bool | stillUp (void) |
Reimplemented. | |
bool | waitForBytes (int timeout_msecs=-1) |
Blocks for incoming. | |
bool | isAuthenticationDialogRaised (void) |
Tells whether or not the stream source's authentication dialog is currently raised. | |
bool | wasAuthenticationDialogRaised (void) |
Tells whether or not the stream source's authentication dialog was raised since the last call to this method. | |
Private Types | |
enum | HTTPNegotiationState { SendGET_NoAuth, ReceiveResponseHeader_NoAuth, RaisedAuthenticationDialog, WaitForAuthenticationDialog, SendGET_EnteredAuth, ReceiveResponseHeader_EnteredAuth, NegotiationSucceeded, NegotiationFailed } |
Private Slots | |
void | processIncomingBytes (void) |
Connected to the encapsuled socket's readyRead() signal. | |
Private Member Functions | |
void | constructCommonStuff (const mxcpcIPAddress &camera_ip, int camera_port, float fps) |
void | establishConnection (void) |
Internal method. | |
void | sendGETRequest (const char *user=0, const char *password=0) |
Internal method. | |
bool | receiveHTTPHeader (void) |
Internal method. | |
Private Attributes | |
QTcpSocket * | AsyncSocket |
mxcpcIPAddress | CameraIP |
int | CameraPort |
mxcpcProxyConfiguration | CameraProxyConfiguration |
float | FPS |
bool | HTTPNegotiationMode |
HTTPNegotiationState | NegotiationState |
char | HTTPHeaderBuffer [MXCPC_ASYNCHRONOUSCAMERALIVEMXPEGFASTSTREAM_HEADERBUFFER_SIZE] |
int | HTTPHeaderBytesRead |
int | HTTPHeaderSize |
bool | AuthenticationEntered |
bool | AuthenticationDialogRaised |
bool | AuthenticationDialogWasRaised |
QString | AuthenticationUser |
QString | AuthenticationPassword |
Qt
TCP socket.
Due to the socket's asynchronous nature the fetchBytes() method will not block in case no data is available - it will return 0
instead. To circumvent the need for polling, connect to the bytesAvailable() signal that will fire when new data comes in over the network.
If on the specified camera access to live streaming is restricted, the stream source will automatically handle the HTTP negotiation necessary to properly authenticate the user, including requesting and authentification information via appropriate signals and slots. Failure to authenticate is logged via the mxcpc
status message facility.
Definition at line 53 of file mxcpcAsynchronousCameraLiveMxPEGFastStream.h.
|
Emitted when during negotiation with the camera, need arises to get authentication information about the user. Originally indended to be connected to an mycpcAuthenticationDialog's raise() slot.
By using the component-oriented signal/slot-mechanism, we avoid doing an upcall from the Referenced by processIncomingBytes(). |
|
Internal method.
Definition at line 505 of file mxcpcAsynchronousCameraLiveMxPEGFastStream.cpp. References AsyncSocket, HTTPHeaderBuffer, HTTPHeaderBytesRead, and HTTPHeaderSize. Referenced by processIncomingBytes(). |
|
Blocks for incoming.
Definition at line 208 of file mxcpcAsynchronousCameraLiveMxPEGFastStream.cpp. |
|
Tells whether or not the stream source's authentication dialog was raised since the last call to this method.
If the dialog is currently raised the method will return Definition at line 227 of file mxcpcAsynchronousCameraLiveMxPEGFastStream.cpp. Referenced by mxcpcSimpleMxPEGViewer::processWatchdog(). |