/* The method invocations on ISVCEncoder are different for C and C++, as
ISVCEncoder is a true class in C++, but an emulated one in C */ #ifdef __cplusplus /* compiling with g++ */ #define ENC_GET_DEFAULT_PARAMS(obj, pParam) (obj)->GetDefaultParams(pParam) #define ENC_INITIALIZE_EXT(obj, pParam) (obj)->InitializeExt(pParam) #define ENC_ENCODE_FRAME(obj, kpSrcPic, pBsInfo) \
(obj)->EncodeFrame(kpSrcPic, pBsInfo) #else #define ENC_GET_DEFAULT_PARAMS(obj, pParam) (*obj)->GetDefaultParams(obj, pParam) #define ENC_INITIALIZE_EXT(obj, pParam) (*obj)->InitializeExt(obj, pParam) #define ENC_ENCODE_FRAME(obj, kpSrcPic, pBsInfo) \
(*obj)->EncodeFrame(obj, kpSrcPic, pBsInfo) #endif
/*****************************************************************************/ int
xrdp_encoder_openh264_delete(void *handle)
{ struct openh264_global *og; struct openh264_encoder *oe; int index;
if (handle == NULL)
{ return0;
}
og = (struct openh264_global *) handle; for (index = 0; index < 16; index++)
{
oe = &(og->encoders[index]); if (oe->openh264_enc_han != NULL)
{
WelsDestroySVCEncoder(oe->openh264_enc_han);
}
g_free(oe->yuvdata);
}
g_free(og); return0;
}
/*****************************************************************************/ int
xrdp_encoder_openh264_encode(void *handle, int session, int left, int top, int width, int height, int twidth, int theight, int format, constchar *data, short *crects, int num_crects, char *cdata, int *cdata_bytes, int connection_type, int *flags_ptr)
{ struct openh264_global *og; struct openh264_encoder *oe; constchar *src8; constchar *src8a; char *dst8; char *dst8a; char *dst8b; char *dst8c; int index; int jndex; int flags; int x; int y; int cx; int cy; int ct; /* connection_type */
SSourcePicture pic1;
SFrameBSInfo info;
SLayerBSInfo *layer;
SEncParamExt encParamExt;
SSpatialLayerConfig *slc; int status; int layer_position; char *write_location; unsignedchar *payload; int size; int lcdata_bytes;
/*****************************************************************************/ int
xrdp_encoder_openh264_install_ok(void)
{ int rv;
// Declare something with maximal alignment we can take the address // of to pass to WelsCreateSVCEncoder. This object is not directly // accessed. // // Note we can't use the ISVCEncoder type directly, as in C++ this // is an abstract class. longdouble dummy;
ISVCEncoder *p = (ISVCEncoder *)&dummy;
// The real OpenH264 library will ALWAYS change the value of the // passed-in pointer // The noopenh264 library will NEVER change the value of the passed-in // pointer // For both libraries, the relevant source is in // codec/encoder/plus/src/welsEncoderExt.cpp
WelsCreateSVCEncoder(&p);
rv = (p != (ISVCEncoder *)&dummy); // Did the passed-in value change // If p is &dummy or NULL, this call does nothing, otherwise resources // are deallocated.
WelsDestroySVCEncoder(p);
return rv;
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-07-10)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.