Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

mxcpcAsynchronousCameraLiveMxPEGFastStream Class Reference
[mxcpc_tek (Tek Module - Generic Mx Mechanisms)]

Camera FastStream implementation using an asynchronous Qt TCP socket. More...

#include <mxcpcAsynchronousCameraLiveMxPEGFastStream.h>

Inheritance diagram for mxcpcAsynchronousCameraLiveMxPEGFastStream:

mxcpcCameraLiveMxPEGFastStream mxcpcStreamSource List of all members.

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

Detailed Description

Camera FastStream implementation using an asynchronous 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.


Member Function Documentation

void mxcpcAsynchronousCameraLiveMxPEGFastStream::authenticationRequest QString  msg  )  [signal]
 

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 mxcpc_tek to the mxcpc_gui library.

Referenced by processIncomingBytes().

bool mxcpcAsynchronousCameraLiveMxPEGFastStream::receiveHTTPHeader void   )  [private]
 

Internal method.

Returns:
true if the complete header has successfully been read into the buffer, or false if header bytes are still missing.

Definition at line 505 of file mxcpcAsynchronousCameraLiveMxPEGFastStream.cpp.

References AsyncSocket, HTTPHeaderBuffer, HTTPHeaderBytesRead, and HTTPHeaderSize.

Referenced by processIncomingBytes().

bool mxcpcAsynchronousCameraLiveMxPEGFastStream::waitForBytes int  timeout_msecs = -1  ) 
 

Blocks for incoming.

Parameters:
timeout_msecs If not -1 the wait operation will time out after the number of milliseconds specified.
Returns:
true if data is available, and false in case of error or timeout

Definition at line 208 of file mxcpcAsynchronousCameraLiveMxPEGFastStream.cpp.

bool mxcpcAsynchronousCameraLiveMxPEGFastStream::wasAuthenticationDialogRaised void   ) 
 

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 true and the internal raise flag will not be reset.

Definition at line 227 of file mxcpcAsynchronousCameraLiveMxPEGFastStream.cpp.

Referenced by mxcpcSimpleMxPEGViewer::processWatchdog().


The documentation for this class was generated from the following files:
Generated on Mon Jan 30 15:13:08 2006 for mxcpc by  doxygen 1.4.4