@@ -66,6 +66,15 @@ typedef UINT32 in_addr_t;
6666
6767#include <rfb/threading.h>
6868
69+ #ifdef LIBVNCSERVER_HAVE_LIBAVCODEC
70+ struct AVCodecContext ;
71+ struct AVFrame ;
72+ struct AVPacket ;
73+ #ifdef LIBVNCSERVER_HAVE_LIBSWSCALE
74+ struct SwsContext ;
75+ #endif
76+ #endif
77+
6978/* if you use pthreads, but don't define LIBVNCSERVER_HAVE_LIBPTHREAD, the structs
7079 get all mixed up. So this gives a linker error reminding you to compile
7180 the library and your application (at least the parts including rfb.h)
@@ -582,6 +591,25 @@ typedef struct _rfbClientRec {
582591 int rawBytesEquivalent ;
583592 int bytesSent ;
584593
594+ #ifdef LIBVNCSERVER_HAVE_LIBAVCODEC
595+ struct AVCodecContext * h264Encoder ;
596+ struct AVFrame * h264Frame ;
597+ struct AVPacket * h264Packet ;
598+ #ifdef LIBVNCSERVER_HAVE_LIBSWSCALE
599+ struct SwsContext * h264SwsContext ;
600+ #endif
601+ uint8_t * h264RgbBuffer ;
602+ size_t h264RgbBufferSize ;
603+ uint8_t * h264EncodeBuffer ;
604+ size_t h264EncodeBufferSize ;
605+ int h264CodecWidth ;
606+ int h264CodecHeight ;
607+ int64_t h264FramePts ;
608+ rfbBool h264ForceKeyframe ;
609+ rfbBool h264SentConfig ;
610+ int64_t h264BitRate ;
611+ #endif
612+
585613#ifdef LIBVNCSERVER_HAVE_LIBZ
586614 /* zlib encoding -- necessary compression state info per client */
587615
@@ -824,6 +852,12 @@ extern void rfbClientConnFailed(rfbClientPtr cl, const char *reason);
824852extern void rfbNewUDPConnection (rfbScreenInfoPtr rfbScreen ,rfbSocket sock );
825853extern void rfbProcessUDPInput (rfbScreenInfoPtr rfbScreen );
826854extern rfbBool rfbSendFramebufferUpdate (rfbClientPtr cl , sraRegionPtr updateRegion );
855+ #ifdef LIBVNCSERVER_HAVE_LIBAVCODEC
856+ extern rfbBool rfbSendRectEncodingH264 (rfbClientPtr cl , int x , int y , int w , int h );
857+ extern void rfbClientH264SetBitrate (rfbClientPtr cl , int64_t bitRate );
858+ void rfbClientH264ReleaseEncoder (rfbClientPtr cl );
859+ #endif
860+
827861extern rfbBool rfbSendRectEncodingRaw (rfbClientPtr cl , int x ,int y ,int w ,int h );
828862extern rfbBool rfbSendUpdateBuf (rfbClientPtr cl );
829863extern void rfbSendServerCutText (rfbScreenInfoPtr rfbScreen ,char * str , int len );
0 commit comments