Visualizer Class Reference

The Visualizer Adaptor allows access to VideoRenderer IO graphical output, so from within an adaptor chain, the intermediate results can be displayed either on SDL, Qt, or X11 <short description="">. More...

#include <Visualizer.hpp>

Inheritance diagram for Visualizer:

VideoAdaptor Adaptor List of all members.

Public Types

enum  OutputMethod { Qt, SDL, X11 }

Public Member Functions

 Visualizer (const VideoESInfo *es, OutputMethod out, UncompressedVideoFrame::ColorSpace colorSpace)
void initialize ()
 Initialize internal data structures.
list< Frame * > adapt (Frame *frm)
 Accepts as input a frame, and checks if it can adapt the frame, If the frame is modified, a new Frame object is created and inserted into the return list.
Adaptorclone ()
 Create a shallow copy of the Adaptor.
list< Frame * > close ()
 Close and destroy an Adaptor.
u32 getTranscodingCosts () const
 returns adaptation costs (CPU only).

Detailed Description

The Visualizer Adaptor allows access to VideoRenderer IO graphical output, so from within an adaptor chain, the intermediate results can be displayed either on SDL, Qt, or X11 <short description="">.

Author:
Michael Kropfberger
Version:
Id
Visualizer.hpp,v 1.3 2005/01/20 09:47:52 mkropfbe Exp

Definition at line 69 of file Visualizer.hpp.


Member Function Documentation

list< Frame * > Visualizer::adapt Frame frm  )  [virtual]
 

Accepts as input a frame, and checks if it can adapt the frame, If the frame is modified, a new Frame object is created and inserted into the return list.

This new frame is returned only, if the size of the payload is larger than zero. If the frame was not modified, it is also inserted into the list. For more complex adaptors, it will happen, that the adaptor caches up one complete GOP and returns the full GOP in network order. A caching adaptor has to create deep-copies for each frames. Never directly modify the payload of the input frm, always create copies!!!

Parameters:
frm object to adapt. An Adaptor is never allowed to free the input frame. This has to be done in the caller.
Returns:
List of adapted Frame objects

Reimplemented from Adaptor.

Definition at line 119 of file Visualizer.cpp.

References Frame::getAU(), IO::getState(), VideoRenderer::getURL(), initialize(), VideoRenderer::open(), and VideoRenderer::writeFrame().

00119 { 00120 list < Frame * >f; 00121 if (!initialized) 00122 initialize(); 00123 00124 if (!(frm && frm->getAU() && frm->getAU()->payload)) 00125 return f; //don't forward frame 00126 00127 if (firstFrame) { 00128 if (!renderer->open()) { 00129 dprintf_err("Visualizer: FATAL: could not open outputIO %s\n",renderer->getURL()); 00130 } else 00131 firstFrame = false; 00132 } 00133 00134 if (renderer->writeFrame(frm) < 1) { //couldn't be displayed! 00135 //don't forward frame 00136 if (renderer->getState() == IO::STREAMERR) 00137 ::exit(0); 00138 } else 00139 f.push_front(frm); 00140 00141 00142 return f; 00143 }

Adaptor* Visualizer::clone  )  [inline, virtual]
 

Create a shallow copy of the Adaptor.

Creates an Adaptor with the same setup (without copying the current status).

Returns:
An Adaptor object.

Implements Adaptor.

Definition at line 80 of file Visualizer.hpp.

00080 { 00081 return new Visualizer(es, output, colorSpace); 00082 };

list< Frame * > Visualizer::close  )  [virtual]
 

Close and destroy an Adaptor.

Releases all internally buffered frame objects, and deallocate all allocated memory. The Adaptor must not be used after calling the close method!!!

Returns:
List of adapted Frame objects.

Reimplemented from Adaptor.

Definition at line 146 of file Visualizer.cpp.

00146 { 00147 list < Frame * >f; 00148 return f; 00149 }

u32 Visualizer::getTranscodingCosts  )  const [inline, virtual]
 

returns adaptation costs (CPU only).

Displaying costs are a 10th of decoding costs

Implements Adaptor.

Definition at line 91 of file Visualizer.hpp.

00091 { 00092 return (u32)(es->getWidth()*es->getHeight()*es->getFPS()/10); 00093 }

void Visualizer::initialize  )  [virtual]
 

Initialize internal data structures.

Implements Adaptor.

Definition at line 108 of file Visualizer.cpp.

Referenced by adapt().

00108 { 00109 firstFrame = true; 00110 00111 width = es->getWidth(); 00112 height = es->getHeight(); 00113 00114 initialized = true; 00115 dprintf_full("Visualizer initialized\n"); 00116 }


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