📄 fame_register.3
字号:
.TH fame_register 3 "July 29, 2001" "libfame" "fame_register".SH NAMEfame_register \- register an object to the library.SH SYNOPSIS.nf.B #include <fame.h>.sp.BI "void fame_register(fame_context_t *" context ", char const *" type ", fame_object_t *" object ");".fi.SH DESCRIPTION.B fame_register()is used to register an object to the library and associate a type with it.Upon initialisation with.I fame_init, libfame looks for the fame_profile_t object associated with the "profile" type and calls its 'init' function. Then this object may get other objects through.I fame_get_object, and so on.Thus, .I fame_registerenables the use of objects from the application inside the library, and can be used to change or extend the default behaviour of the library..PP.I contextis the context handle previously returned by .I fame_open.PP.I typeis a type identifier to be associated with the object for further retrieval through .I fame_get_object..PP.I objectis the object to associate with.I type.SH "BUILTIN OBJECTS"Currently the built-in objects and their default associations are:.PP.I \fBfame_profile_t* \fR"profile","profile/mpeg1".PPMPEG-1 profile, uses "syntax/mpeg1", "encoder/mpeg" and "motion".PP.I \fBfame_profile_t* \fR"profile/mpeg4","profile/mpeg4/simple".PPMPEG-4 simple profile, uses "syntax/mpeg4", "encoder/mpeg" and "motion".PP.I \fBfame_profile_t* \fR"profile/mpeg4/shape".PPMPEG-4 shape profile, uses "syntax/mpeg4", "encoder/mpeg", "shape" and "motion".PP.I \fBfame_syntax_t* \fR"syntax","syntax/mpeg1".PPMPEG-1 bitstream syntax.PP.I \fBfame_syntax_t* \fR"syntax/mpeg4".PPMPEG-4 bitstream syntax.PP.I \fBfame_encoder_t* \fR"encoder","encoder/mpeg".PPMPEG encoder.PP.I \fBfame_motion_t* \fR"motion","motion/none".PPnull motion estimation.PP.I \fBfame_motion_t* \fR"motion","motion/fourstep".PPfour step motion estimation.PP.I \fBfame_motion_t* \fR"motion","motion/pmvfast".PPpmvfast motion estimation.PP.I \fBfame_rate_t* \fR"rate".PPsimple rate control.PP.I \fBfame_shape_t* \fR"shape".PPshape coder.PP.SH "EXAMPLES".TP.sp.nf.in +2.PP{ fame_object_t *object; object = fame_get_object(fc, "profile/mpeg4/simple"); if(object) fame_register(fc, "profile", object);}.in -2.fi.PP.spwill try to get the object associated with "profile/mpeg4/simple" and register it for the "profile" type as well. This piece of code, called just after.I fame_openand just before.I fame_initwould effectively have libfame produce MPEG-4 output instead of default MPEG-1..TP.sp.nf.in +2.PPint my_encode(fame_profile_t *profile, fame_yuv_t *yuv, unsigned char *shape){ printf("Hello world!");}{ fame_profile_t *my_profile; my_profile = FAME_PROFILE(fame_get_object(fc, "profile")); my_profile->encode = my_encode;}.in -2.fi.PP.spwill overide the default profile 'encode' function with this one printing "Hello world!" :).SH "SEE ALSO".BR fame_open(3).BR fame_init(3).BR fame_unregister(3).BR fame_get_object(3)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -