Open Inventor Release 2024.1.0
 
Loading...
Searching...
No Matches
SoMPEGNavRenderer Class Reference

VSG extension Generates MPEG output that tracks camera motion. More...

#include <Inventor/MPEG/SoMPEGNavRenderer.h>

+ Inheritance diagram for SoMPEGNavRenderer:

Public Member Functions

 SoMPEGNavRenderer (SoNode *node)
 Constructor.
 
virtual ~SoMPEGNavRenderer ()
 Destructor.
 
virtual void setSceneGraph (SoNode *node)
 Sets the scene graph used for generating frames in the MPEG output.
 
virtual void record ()
 Starts recording camera movements.
 
virtual void stop ()
 Stops recording camera movements.
 
void adjustNumFramesPerSecond (SbBool flag)
 Specifies whether the camera movements are adjusted to the number of frames per second.
 
SbBool isAdjustedNumFramesPerSecond () const
 Returns whether the camera movements are adjusted to the number of frames per second.
 
void setCamera (SoCamera *camera)
 Specifies the camera to be used by the MPEG renderer.
 
SoCameragetCamera ()
 Returns the camera currently used by the MPEG renderer.
 
- Public Member Functions inherited from SoMPEGRenderer
 SoMPEGRenderer ()
 Constructor.
 
virtual ~SoMPEGRenderer ()
 Destructor.
 
SbBool openFile (const char *filename, unsigned int numFrames=10000)
 Specifies the MPEG output file name.
 
void closeFile ()
 Closes the MPEG file previously opened with the openFile() method.
 
void setFilePointer (FILE *fp)
 Sets the file pointer for the MPEG output.
 
FILE * getFilePointer () const
 Gets the MPEG file pointer.
 
void setSize (const SbVec2s &size)
 Sets the frame pixel size.
 
SbVec2s getSize () const
 Gets the frame pixel size.
 
void setComponents (const Components components)
 Set the number of color components of the frames recorded.
 
SoMPEGRenderer::Components getComponents () const
 Returns the number of color components of the frames recorded.
 
SoNodegetSceneGraph () const
 Gets the scene graph used for generating frames in the MPEG output.
 
void setBackgroundColor (const SbColor &c)
 Sets the background color for rendering each frame.
 
SbColor getBackgroundColor () const
 Gets the background color for rendering each frame.
 
void setGLRenderAction (SoGLRenderAction *ra)
 Sets the GL Render action used to generate each frame.
 
SoGLRenderActiongetGLRenderAction () const
 Gets the GL Render action used to generate each frame.
 
void setCompressionRate (float value)
 Compression rate of the MPEG output.
 
float getCompressionRate () const
 Returns the compression rate.
 
void setBitPerSec (float mbps)
 This method allows the user to specify a fixed bit rate.
 
void setNumFramesPerSecond (float num)
 Sets the number of frames per second encoded in the MPEG output.
 
int getNumFramesPerSecond ()
 Gets the number of frames per second to be encoded in the MPEG output.
 
void addFrame (const unsigned char *frame)
 Low level method to add a new frame to the MPEG output from a buffer of unsigned characters.
 
void setShareContext (const SbGLShareContext shareCxt)
 Sets the OpenGL context to be shared by the SoMPEGRenderer.
 
const SbGLShareContext getShareContext () const
 Gets the OpenGL context shared by this object.
 
virtual void pause ()
 Pauses the recording.
 
SbBool isRecording () const
 Returns true if this renderer is recording.
 
void setViewerIsIdle (bool isIdle)
 Tells the recorder that the viewer is idle.
 
bool isViewerIdle () const
 

Additional Inherited Members

- Public Types inherited from SoMPEGRenderer
enum  Components {
  LUMINANCE = 1 ,
  LUMINANCE_TRANSPARENCY = 2 ,
  RGB = 3 ,
  RGB_TRANSPARENCY = 4
}
 Components. More...
 

Detailed Description

VSG extension Generates MPEG output that tracks camera motion.

This class generates MPEG output that tracks (i.e. follows) camera motion – specifically changes in the position, orientation, nearDistance, and farDistance fields. These are the fields that can be modified by mouse movements within a viewer.

After SoMPEGNavRenderer::record() is called, all camera movements are recorded until SoMPEGNavRenderer::stop() is called. At that time, frames corresponding to each camera movement are rendered and stored in the MPEG output.

See the parent class SoMPEGRenderer for methods to specify the file and recording parameters.

SEE ALSO

SoMPEGRenderer, SoMPEGFrameRenderer

Definition at line 62 of file SoMPEGNavRenderer.h.

Constructor & Destructor Documentation

◆ SoMPEGNavRenderer()

SoMPEGNavRenderer::SoMPEGNavRenderer ( SoNode node)

Constructor.

The method SoMPEGRenderer::setSceneGraph() is called with the given argument. The specified scene graph must contain a camera in order to produce correct results.

◆ ~SoMPEGNavRenderer()

virtual SoMPEGNavRenderer::~SoMPEGNavRenderer ( )
virtual

Destructor.

Member Function Documentation

◆ adjustNumFramesPerSecond()

void SoMPEGNavRenderer::adjustNumFramesPerSecond ( SbBool  flag)

Specifies whether the camera movements are adjusted to the number of frames per second.

Default is FALSE.

  • FALSE: Indicates that each camera movement corresponds to one frame in the MPEG output. The amount of time between two camera movements is not taken into consideration.
  • TRUE: The renderer takes into account the amount of time between two camera movements for generating frames. A new camera position could be associated with 0, 1, or several frames in the MPEG output depending on how long the camera stayed in that position during the recording period. When the MPEG is played, the camera movements will replay at the same speed as when they were originally recorded.

◆ getCamera()

SoCamera * SoMPEGNavRenderer::getCamera ( )

Returns the camera currently used by the MPEG renderer.

◆ isAdjustedNumFramesPerSecond()

SbBool SoMPEGNavRenderer::isAdjustedNumFramesPerSecond ( ) const

Returns whether the camera movements are adjusted to the number of frames per second.

◆ record()

virtual void SoMPEGNavRenderer::record ( )
virtual

Starts recording camera movements.

All camera movements are recorded until stop() is called.

Reimplemented from SoMPEGRenderer.

◆ setCamera()

void SoMPEGNavRenderer::setCamera ( SoCamera camera)

Specifies the camera to be used by the MPEG renderer.

Setting the camera is only needed if the first camera found in the scene isn't the one that should be used.

◆ setSceneGraph()

virtual void SoMPEGNavRenderer::setSceneGraph ( SoNode node)
virtual

Sets the scene graph used for generating frames in the MPEG output.

Reimplemented from SoMPEGRenderer.

◆ stop()

virtual void SoMPEGNavRenderer::stop ( )
virtual

Stops recording camera movements.

Each frame corresponding to a camera movement is rendered and added to the MPEG output file.

Reimplemented from SoMPEGRenderer.


The documentation for this class was generated from the following file: