pfVideoChannel(3pf) OpenGL Performer 3.2.2 libpr C Reference Pages
NAME
pfNewVChan, pfGetVChanClassType, pfVChanAreaScale, pfVChanCallig,
pfVChanFullRect, pfVChanId, pfVChanOutputOrigin, pfVChanOutputSize,
pfVChanScale, pfVChanMinScale, pfVChanMaxScale, pfVChanMode,
pfVChanScreen, pfVChanWSWindow, pfGetVChanAreaScale, pfGetVChanCallig,
pfGetVChanId, pfGetVChanInfo, pfGetVChanOutputOrigin,
pfGetVChanOutputSize, pfGetVChanScale, pfGetVChanMinScale,
pfGetVChanMaxScale, pfGetVChanMinDeltas, pfGetVChanMode,
pfGetVChanOrigin, pfGetVChanSize, pfGetVChanScreen, pfGetVChanWSWindow,
pfApplyVChan, pfBindVChan, pfSelectVChan, pfUnbindVChan, pfIsVChanBound,
pfIsVChanActive, pfGetCurVChan - Create, modify and query video channel
state
FUNCTION SPECIFICATION
#include <Performer/pr.h>
pfVideoChannel * pfNewVChan(void *arena);
pfType * pfGetVChanClassType(void);
void pfVChanAreaScale(pfVideoChannel* vchan, float s);
void -
pfVChanCallig(pfVideoChannel* vchan pfCalligraphic* callig);
void pfVChanFullRect(pfVideoChannel* vchan);
void pfVChanId(pfVideoChannel* vchan, int index);
void pfVChanOutputOrigin(pfVideoChannel* vchan, int xo,
int yo);
void pfVChanOutputSize(pfVideoChannel* vchan, int xs,
int ys);
void pfVChanScale(pfVideoChannel* vchan, float xs,
float ys);
void pfVChanMinScale(pfVideoChannel* vchan, float xs,
float ys);
void pfVChanMaxScale(pfVideoChannel* vchan, float xs,
float ys);
void pfVChanMode(pfVideoChannel* vchan, int mode, int val);
void pfVChanScreen(pfVideoChannel* vchan, int screen);
void pfVChanWSWindow(pfVideoChannel* vchan,
pfWSWindow wsWin);
Page 1
pfVideoChannel(3pf) OpenGL Performer 3.2.2 libpr C Reference Pages
float pfGetVChanAreaScale(pfVideoChannel* vchan);
pfCalligraphic* pfGetVChanCallig(const pfVideoChannel* vchan);
int pfGetVChanId(pfVideoChannel* vchan);
pfWSVideoChannelInfo
pfGetVChanInfo(pfVideoChannel* vchan);
void pfGetVChanOutputOrigin(const pfVideoChannel* vchan,
int *xo, int *yo);
void pfGetVChanOutputSize(const pfVideoChannel* vchan,
int *xs, int *ys);
void pfGetVChanScale(const pfVideoChannel* vchan, float *xs,
float *ys);
void pfGetVChanMinScale(const pfVideoChannel* vchan,
float *xs, float *ys);
void pfGetVChanMaxScale(const pfVideoChannel* vchan,
float *xs, float *ys);
void pfGetVChanMinDeltas(const pfVideoChannel* vchan,
int *dx, int *dy);
int pfGetVChanMode(pfVideoChannel* vchan, int _mode);
void pfGetVChanOrigin(pfVideoChannel* vchan, int *xo,
int *yo);
void pfGetVChanSize(pfVideoChannel* vchan, int *xs,
int *ys);
int pfGetVChanScreen(const pfVideoChannel* vchan);
pfWSWindow pfGetVChanWSWindow(const pfVideoChannel* vchan);
void pfApplyVChan(pfVideoChannel* vchan);
void pfBindVChan(pfVideoChannel* vchan);
void pfSelectVChan(pfVideoChannel* vchan);
void pfUnbindVChan(pfVideoChannel* vchan);
int pfIsVChanBound(const pfVideoChannel* vchan);
int pfIsVChanActive(const pfVideoChannel* vchan);
Page 2
pfVideoChannel(3pf) OpenGL Performer 3.2.2 libpr C Reference Pages
pfVideoChannel * pfGetCurVChan(void);
/* typedef of X-based Performer Types */
typedef XSGIvcChannelInfo *pfWSVideoChannelInfo;
PARENT CLASS FUNCTIONS
The OpenGL Performer class pfVideoChannel is derived from the parent
class pfObject, so each of these member functions of class pfObject are
also directly usable with objects of class pfVideoChannel. Casting an
object of class pfVideoChannel to an object of class pfObject is taken
care of automatically. This is also true for casts to objects of
ancestor classes of class pfObject.
void pfUserDataSlot(pfObject *obj, int slot, void *data);
void pfUserData(pfObject *obj, void *data);
void* pfGetUserDataSlot(pfObject *obj, int slot);
void* pfGetUserData(pfObject *obj);
int pfGetNumUserData(pfObject *obj);
int pfGetNamedUserDataSlot(const char *name);
const char* pfGetUserDataSlotName(int slot);
int pfGetNumNamedUserDataSlots(void);
int pfGetGLHandle(pfObject *obj);
int pfDeleteGLHandle(pfObject *obj);
Since the class pfObject is itself derived from the parent class
pfMemory, objects of class pfVideoChannel can also be used with these
functions designed for objects of class pfMemory.
pfType * pfGetType(const void *ptr);
int pfIsOfType(const void *ptr, pfType *type);
int pfIsExactType(const void *ptr, pfType *type);
const char * pfGetTypeName(const void *ptr);
int pfRef(void *ptr);
int pfUnref(void *ptr);
int pfUnrefDelete(void *ptr);
int pfUnrefGetRef(void *ptr);
int pfGetRef(const void *ptr);
int pfCopy(void *dst, void *src);
int pfDelete(void *ptr);
int pfIsFluxed(void *ptr);
int pfCompare(const void *ptr1, const void *ptr2);
void pfPrint(const void *ptr, uint which, uint verbose,
FILE *file);
void * pfGetArena(void *ptr);
Page 3
pfVideoChannel(3pf) OpenGL Performer 3.2.2 libpr C Reference Pages
PARAMETERS
vchan identifies a pfVideoChannel
DESCRIPTION
The pfVideoChannel capability is used to query and control the state and
output area of a hardware video channel. This support is done through
the XSGIvc video control X extension for SGI platforms. See the XSGIvc
man page for more information on this library. The pfVideoChannel only
accesses video hardware in the action routines of pfApplyVChan,
pfBindVChan, and pfUnbindVChan. All parameters set on the pfVideoChannel
take effect turning these actions. These actions require that a
pfWSWindow be set on the pfVideoChannel via pfVChanWSWindow.
pfNewVChan creates and returns a handle to a pfVideoChannel. arena
specifies a malloc arena out of which the pfVideoChannel is allocated or
NULL for allocation off the process heap. pfVideoChannel can be deleted
with pfDelete.
pfVChanMode sets a given mode to val where mode may be one of the
following:
PFVCHAN_SYNC
sets the video boundary upon which changes to the video channel
origin and size should take effect: PFVCHAN_SYNC_SWAP for
swapbuffers (the default) and PFVCHAN_SYNC_FIELD for a field,
or vertical retrace, boundary. For resizing for load
management, the default swapbuffers boundary is usually
appropriate. Allowing changes to the origin and size take
effect on the following field boundary allows the panning of
video output from the visible color buffer asynchronous to
drawing and so should be used in conjunction with the
PFVCHAN_AUTO_APPLY mode and doing a pfSelectVChan on the
pfVideoChannel.
PFVCHAN_AUTO_APPLY
accepts a boolean value indicating if changes to vchan should
be applied automatically, as opposed to waiting for an explicit
call to pfApplyVChan. This is done if vchan has been selected
via pfSelectVChan to be the current active pfVideoChannel. The
changes are not applied by the set routines because those
routines may be called from an asynchronous process. On
InfiniteReality changes to the video channel must be applied by
the draw process so these are applied internally by the
rendering portion of OpenGL Performer.
pfGetVChanMode will return the value of the specified mode for vchan.
pfVChanFullRect will cause the output area of the video channel to be
reset to its full size.
pfVChanId will cause the pfVideoChannel to refer to the hardware video
channel indicated by index. This is the same index used by the XSGIvc
routines.
Page 4
pfVideoChannel(3pf) OpenGL Performer 3.2.2 libpr C Reference Pages
pfVChanOutputOrigin will set the origin of the output area of the video
channel to be the lower-left channel relative coordinates of xo, yo. The
actual screen origin of the video channel can be gotten with
pfGetVChanOrigin.
pfVChanOutputSize will set the size of the output area of the video
channel to be that specified by xs, ys. The size of the video channel
can not be set larger than its full size which can be queried with
pfGetVChanSize.
pfVChanAreaScale will scale the X and Y dimensions of the output area of
the video channel to achieve a scaling of the drawing area by s. The
implementation is to scale both X and Y by the square root of s, so that
compound effect on area is s. For example a 1000-pixel square display
area scaled by 0.5 would result in a 707-pixel square render area, since
707*707 is 0.5*1000*1000 (the actual X and Y resolutions are subject to
hardware constrains as well). The maximum scale allowed is 1.0 which
will reset the channel output area to its full size.
pfVChanScale will scale the size of the X and Y dimensions output area of
the video channel by specified by xs, ys. The minimum and and maximum
scaling allowed is that set by pfVChanMinScale and pfVChanMaxScale. The
minimum and maximum scale bounds default to 0.25 and 1.0, respectively.
pfVChanMinScale will set the lower bound on the allowable pixel scale
values for the X and Y dimensions of the pfVideoChannel.
pfVChanMaxScale will set the upper bound on the allowable pixel scale
values for the X and Y dimensions of the pfVideoChannel.
pfVChanWSWindow sets the WSWindow for vchan to be wsWin. This window
should be the WSDrawable that is connected to the main GL context being
displayed into that video channel. This can be gotten from a pfWindow or
pfPipeWindow with pfGetWinWSDrawable or pfGetPWinWSDrawable,
respectively. Video channel resize operations will be triggered by the
swapping of the display buffers for that GL context. If wsWin is NULL,
it will cause an unbind of the video channel from its current WSWindow
upon the next call to pfApplyVChan. If wsWin is not null, the screen of
the pfVideoChannel will be set to that of wsWin.
pfGetVChanId will return the video channel index of the pfVideoChannel.
pfGetVChanInfo will return the XSGIvcChannelInfo handle, useful for doing
XSGIvc queries directly.
pfGetVChanMinDeltas will return the minimum resolution of resize for X
and Y that the video channel size can be changed in dx and dy,
respectively.
pfGetVChanOutputOrigin will return the origin of the output area of the
video channel in xo, yo.
Page 5
pfVideoChannel(3pf) OpenGL Performer 3.2.2 libpr C Reference Pages
pfGetVChanOutputSize will return the size of the output area of the video
channel in xs and ys.
pfGetVChanScale will return the area scale the video channel. This value
represents the ratio of drawn to displayed area in pixels. For example a
1000-pixel square display scaled to 707-pixels would return an area scale
value of to 0.5, since 707*707 is 0.5*1000*1000.
pfGetVChanScale will return the scale of the X and Y dimensions output
area of the video channel in xs and ys.
pfGetVChanMinScale will return the lower bound on pixel scale of the X
and Y dimensions in xs and ys. The default pixel scale lower bound is
0.25.
pfGetVChanMaxScale will return the upper bound on pixel scale of the X
and Y dimensions in xs and ys. The default pixel scale upper bound is
1.0.
pfVChanScreen sets the screen number of vchan to screen and
pfGetVChanScreen returns the screen number of vchan.
pfGetVChanSize will return the full size of the video channel in xs and
ys.
pfBindVChan forces a bind of the video channel to the WSWindow set with
pfVChanWSWindow.
pfUnbindVChan forces an unbind of the video from its current WSWindow.
This will also cause the video channel to reset its output area to the
configuration it had before the channel was bound.
pfIsVChanBound returns a boolean value indicating whether or not the
vchan is currently bound to a window and able to be resized.
pfIsVChanActive returns a boolean value indicating whether or not the
vchan is currently active and able to produce video output.
pfSelectPVChan makes vchan the current pfVideoChannel in the process.
This should be done in a rendering process if the purpose is for using
the PFVCHAN_AUTO_APPLY mode.
pfGetCurVChan will return a pointer to the current pfVideoChannel.
pfApplyVChan will apply the current origin and size parameters to the
currently selected video channel. A bind of the video channel to the
specified WSWindow will be automatically done if necessary.
pfVChanCallig set the callig to use with this pfVideoChannel. If a
light-point board (see pfCalligraphic) has been initialized before
pfConfig, then each pfVideoChannel automatically create a pfCalligraphic
with its screen as the Light Point Board id, and its display id as the
Page 6
pfVideoChannel(3pf) OpenGL Performer 3.2.2 libpr C Reference Pages
channel to use on the Light Point Board.
pfGetVChanCallig returns the pfCalligraphic in use with this
pfVideoChannel, or NULL if none are used (so only Raster Light Points are
available).
NOTES
pfVideoChannel functionality is not currently supported under Linux.
An XSGIvc video channel may only be bound to a single window at a time on
the system. Only a single pfVideoChannel may bind a hardware video
channel.
On InfiniteReality, changes to video channel origin and size require an
active graphics context and so should be made in a rendering process to
avoid a graphics context change which can be expensive.
See the sample program
/usr/share/Performer/src/pguide/libpr/C/queryvchan.c for an example of
how to query general video channel attributes. See the sample program
/usr/share/Performer/src/pguide/libpr/C/vchan.c for a basic resizing
example using pfVideoChannels.
SEE ALSO
pfDelete, pfDispList, pfGetNumScreenVChans, pfState, pfWindow, XSGIvc,
glXSGIvcQueryChannelInfo, glXBindChannelToWindowSGIX.
Page 7