OpenVideo Documentation

   Main Page       Modules       Class Hierarchy       Alphabetical List       Compound List       File List       Compound Members       Related Pages   

openvideo::GL_TEXTURE_2D_Sink Class Reference
[Node Classes]

This node implements a 2d texture which is updated every time the node is traversed. More...

#include <GL_TEXTURE_2D_Sink.h>

Inherits openvideo::Node.

List of all members.

Public Member Functions

 GL_TEXTURE_2D_Sink ()
 ~GL_TEXTURE_2D_Sink ()
virtual void init ()
virtual void process ()
void acquire ()
void release ()
unsigned int get_video_texture_id ()
virtual void initPixelFormats ()

Public Attributes

float t_u0
float t_u1
float t_v0
float t_v1
bool isStarted

Protected Types

enum  { TEXTURE_WIDTH = 1024, TEXTURE_HEIGHT = 1024 }

Protected Attributes

ACE_Mutex * mutex
bool doubleBufferFlag
int buffer
unsigned int video_texture_id [1]
int width
int height
int format
int internalFormat
bool flip_h
bool flip_v


Detailed Description

This node implements a 2d texture which is updated every time the node is traversed.

GL_TEXTURE_2D_Sink takes the context of it's first registered parent node. The node can be used to integrate an OpenVideo sink into another programm. therefore it implements a way to lock and unlock the texture it updates.

Supported Pixel Formats:

Definition at line 54 of file GL_TEXTURE_2D_Sink.h.


Member Enumeration Documentation

anonymous enum [protected]
 

max.

texture size

Enumeration values:
TEXTURE_WIDTH 
TEXTURE_HEIGHT 

Definition at line 139 of file GL_TEXTURE_2D_Sink.h.


Constructor & Destructor Documentation

openvideo::GL_TEXTURE_2D_Sink::GL_TEXTURE_2D_Sink  ) 
 

constructor

Definition at line 61 of file GL_TEXTURE_2D_Sink.cxx.

References buffer, height, internalFormat, isStarted, mutex, openvideo::Node::name, openvideo::Node::typeName, video_texture_id, and width.

openvideo::GL_TEXTURE_2D_Sink::~GL_TEXTURE_2D_Sink  ) 
 

destructor

Definition at line 87 of file GL_TEXTURE_2D_Sink.cxx.

References mutex.


Member Function Documentation

void openvideo::GL_TEXTURE_2D_Sink::acquire  ) 
 

aquires the mutex

Definition at line 96 of file GL_TEXTURE_2D_Sink.cxx.

References mutex.

unsigned int openvideo::GL_TEXTURE_2D_Sink::get_video_texture_id  ) 
 

opengl's texture id.

Definition at line 54 of file GL_TEXTURE_2D_Sink.cxx.

References video_texture_id.

void openvideo::GL_TEXTURE_2D_Sink::init  )  [virtual]
 

creates the texture.

original gl spec.

Reimplemented from openvideo::Node.

Definition at line 112 of file GL_TEXTURE_2D_Sink.cxx.

References openvideo::Node::curPixelFormat, flip_h, flip_v, format, openvideo::FORMAT_B8G8R8, openvideo::FORMAT_B8G8R8X8, openvideo::FORMAT_L8, openvideo::FORMAT_R8G8B8, openvideo::FORMAT_R8G8B8X8, openvideo::PixelFormat::FormatToString(), openvideo::Manager::getInstance(), openvideo::State::height, height, openvideo::Node::inputs, internalFormat, isStarted, mutex, openvideo::Node::name, openvideo::Node::state, t_u0, t_u1, t_v0, t_v1, TEXTURE_HEIGHT, TEXTURE_WIDTH, video_texture_id, openvideo::State::width, and width.

Referenced by process().

void openvideo::GL_TEXTURE_2D_Sink::initPixelFormats  )  [virtual]
 

return value = the number of supported input formats.

the formats are stored in 'pixelFormats'.

Implements openvideo::Node.

Definition at line 73 of file GL_TEXTURE_2D_Sink.cxx.

References openvideo::FORMAT_B8G8R8, openvideo::FORMAT_B8G8R8X8, openvideo::FORMAT_L8, openvideo::FORMAT_R8G8B8, openvideo::FORMAT_R8G8B8X8, and openvideo::Node::pixelFormats.

void openvideo::GL_TEXTURE_2D_Sink::process  )  [virtual]
 

updates the texture with the video frame in it's context.

Reimplemented from openvideo::Node.

Definition at line 245 of file GL_TEXTURE_2D_Sink.cxx.

References buffer, openvideo::State::getCurrentBuffer(), openvideo::Buffer::getPixels(), openvideo::Manager::hasGLContext, height, init(), isStarted, openvideo::Buffer::lock(), mutex, openvideo::Node::state, openvideo::Buffer::unlock(), video_texture_id, and width.

void openvideo::GL_TEXTURE_2D_Sink::release  ) 
 

releases the mutex.

Definition at line 106 of file GL_TEXTURE_2D_Sink.cxx.

References mutex.


Member Data Documentation

int openvideo::GL_TEXTURE_2D_Sink::buffer [protected]
 

Definition at line 113 of file GL_TEXTURE_2D_Sink.h.

Referenced by GL_TEXTURE_2D_Sink(), and process().

bool openvideo::GL_TEXTURE_2D_Sink::doubleBufferFlag [protected]
 

Definition at line 111 of file GL_TEXTURE_2D_Sink.h.

bool openvideo::GL_TEXTURE_2D_Sink::flip_h [protected]
 

is the video fliped?

Definition at line 134 of file GL_TEXTURE_2D_Sink.h.

Referenced by init().

bool openvideo::GL_TEXTURE_2D_Sink::flip_v [protected]
 

is the video fliped?

Definition at line 134 of file GL_TEXTURE_2D_Sink.h.

Referenced by init().

int openvideo::GL_TEXTURE_2D_Sink::format [protected]
 

texture format.

Definition at line 124 of file GL_TEXTURE_2D_Sink.h.

Referenced by init().

int openvideo::GL_TEXTURE_2D_Sink::height [protected]
 

video widht & height.

Definition at line 119 of file GL_TEXTURE_2D_Sink.h.

Referenced by GL_TEXTURE_2D_Sink(), init(), and process().

int openvideo::GL_TEXTURE_2D_Sink::internalFormat [protected]
 

Internal texture format.

defines the number of color components in the texture. valid values = 1,2,3, or 4.

Definition at line 129 of file GL_TEXTURE_2D_Sink.h.

Referenced by GL_TEXTURE_2D_Sink(), and init().

bool openvideo::GL_TEXTURE_2D_Sink::isStarted
 

indicated whether the sink is started or not.

Definition at line 102 of file GL_TEXTURE_2D_Sink.h.

Referenced by GL_TEXTURE_2D_Sink(), init(), and process().

ACE_Mutex* openvideo::GL_TEXTURE_2D_Sink::mutex [protected]
 

mutext to lock the sink's data.

Definition at line 109 of file GL_TEXTURE_2D_Sink.h.

Referenced by acquire(), GL_TEXTURE_2D_Sink(), init(), process(), release(), and ~GL_TEXTURE_2D_Sink().

float openvideo::GL_TEXTURE_2D_Sink::t_u0
 

texture coordinates: two of them are 0 and the other two indicate the ratio between max.

texture size and the current video size. flip_h, flip_v indicate which two of them are going to be 0.

Definition at line 92 of file GL_TEXTURE_2D_Sink.h.

Referenced by init().

float openvideo::GL_TEXTURE_2D_Sink::t_u1
 

texture coordinates: two of them are 0 and the other two indicate the ratio between max.

texture size and the current video size. flip_h, flip_v indicate which two of them are going to be 0.

Definition at line 92 of file GL_TEXTURE_2D_Sink.h.

Referenced by init().

float openvideo::GL_TEXTURE_2D_Sink::t_v0
 

texture coordinates: two of them are 0 and the other two indicate the ratio between max.

texture size and the current video size. flip_h, flip_v indicate which two of them are going to be 0.

Definition at line 92 of file GL_TEXTURE_2D_Sink.h.

Referenced by init().

float openvideo::GL_TEXTURE_2D_Sink::t_v1
 

texture coordinates: two of them are 0 and the other two indicate the ratio between max.

texture size and the current video size. flip_h, flip_v indicate which two of them are going to be 0.

Definition at line 92 of file GL_TEXTURE_2D_Sink.h.

Referenced by init().

unsigned int openvideo::GL_TEXTURE_2D_Sink::video_texture_id[1] [protected]
 

Definition at line 115 of file GL_TEXTURE_2D_Sink.h.

Referenced by get_video_texture_id(), GL_TEXTURE_2D_Sink(), init(), and process().

int openvideo::GL_TEXTURE_2D_Sink::width [protected]
 

video widht & height.

Definition at line 119 of file GL_TEXTURE_2D_Sink.h.

Referenced by GL_TEXTURE_2D_Sink(), init(), and process().


The documentation for this class was generated from the following files:
 This page was generated at Wed May 31 13:04:18 2006 for OpenVideo by Doxygen.
 If you have any comments, please send a message to schmalstieg@icg.tu-graz.ac.at.
www.studierstube.org