.TH fame_register 3 "July 29, 2001" "libfame" "fame_register" .SH NAME fame_register \- register an object to the library .SH SYNOPSIS .nf .B #include .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_register enables 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 context is the context handle previously returned by .I fame_open .PP .I type is a type identifier to be associated with the object for further retrieval through .I fame_get_object. .PP .I object is 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" .PP MPEG-1 profile, uses "syntax/mpeg1", "encoder/mpeg" and "motion" .PP .I \fBfame_profile_t* \fR"profile/mpeg4","profile/mpeg4/simple" .PP MPEG-4 simple profile, uses "syntax/mpeg4", "encoder/mpeg" and "motion" .PP .I \fBfame_profile_t* \fR"profile/mpeg4/shape" .PP MPEG-4 shape profile, uses "syntax/mpeg4", "encoder/mpeg", "shape" and "motion" .PP .I \fBfame_syntax_t* \fR"syntax","syntax/mpeg1" .PP MPEG-1 bitstream syntax .PP .I \fBfame_syntax_t* \fR"syntax/mpeg4" .PP MPEG-4 bitstream syntax .PP .I \fBfame_encoder_t* \fR"encoder","encoder/mpeg" .PP MPEG encoder .PP .I \fBfame_motion_t* \fR"motion","motion/none" .PP null motion estimation .PP .I \fBfame_motion_t* \fR"motion","motion/fourstep" .PP four step motion estimation .PP .I \fBfame_motion_t* \fR"motion","motion/pmvfast" .PP pmvfast motion estimation .PP .I \fBfame_rate_t* \fR"rate" .PP simple rate control .PP .I \fBfame_shape_t* \fR"shape" .PP shape 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 .sp will 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_open and just before .I fame_init would effectively have libfame produce MPEG-4 output instead of default MPEG-1. .TP .sp .nf .in +2 .PP int 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 .sp will 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)