KVIrc  4.9.2
DeveloperAPIs
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
KviOggTheoraEncoder Class Reference

An ogg/theora+irct encoder class; accepts argb32 images and binary text, outputs an ogg stream. More...

#include <KviOggTheoraEncoder.h>

Public Member Functions

void addTextFrame (unsigned char *textPkt, int textSize)
 Appends a text frame to the stream. More...
 
void addVideoFrame (QRgb *rgb32, int videoSize)
 Appends a video frame to the stream. More...
 
 KviOggTheoraEncoder (KviDataBuffer *stream, int iWidth=320, int iHeight=240, int iFpsN=5, int iFpsD=1, int iParN=4, int iParD=3)
 Constructs the KviOggTheoraEncoder object. More...
 
virtual ~KviOggTheoraEncoder ()
 Destroys the KviOggTheoraEncoder object. More...
 

Private Member Functions

int fetch_and_process_video (quint8 *videoYuv, ogg_page *videopage, ogg_stream_state *to, th_enc_ctx *td, int videoflag)
 Internal function that processes a video frame to create an ogg page. More...
 
int fetch_and_process_video_packet (quint8 *videoYuv, th_enc_ctx *td, ogg_packet *op)
 Internal function that processes a video frame to create an ogg packet. More...
 

Static Private Member Functions

static int ilog (unsigned _v)
 Internal function used to calculate our granule shift. More...
 

Private Attributes

int frame_state
 
KviOggTheoraGeometry geometry
 
KviDataBufferm_pStream
 
ogg_page og
 
ogg_packet op
 
th_comment tc
 
th_enc_ctx * td
 
ogg_int64_t text_sofar
 
int textflag
 
th_info ti
 
ogg_stream_state to
 
int videoflag
 
quint8 * videoYuv
 
size_t y4m_aux_buf_read_sz
 
size_t y4m_aux_buf_sz
 
size_t y4m_dst_buf_read_sz
 
size_t y4m_dst_buf_sz
 
unsigned char * yuvframe [3]
 
ogg_stream_state zo
 

Detailed Description

An ogg/theora+irct encoder class; accepts argb32 images and binary text, outputs an ogg stream.

Constructor & Destructor Documentation

KviOggTheoraEncoder::KviOggTheoraEncoder ( KviDataBuffer stream,
int  iWidth = 320,
int  iHeight = 240,
int  iFpsN = 5,
int  iFpsD = 1,
int  iParN = 4,
int  iParD = 3 
)

Constructs the KviOggTheoraEncoder object.

Parameters
streamthe output stream object
iWidthwidth of the stream
iHeightheight of the stream
iFpsNframes per second: numerator
iFpsDframes per second: denominator
iParNaspect ratio: numerator
iParDaspect ratio: denominator
Returns
KviOggTheoraEncoder

References KviOggIrcText::irct_encode_headerout(), KviOggIrcText::irct_encode_init(), and NULL.

KviOggTheoraEncoder::~KviOggTheoraEncoder ( )
virtual

Destroys the KviOggTheoraEncoder object.

References KviOggIrcText::irct_encode_clear().

Member Function Documentation

void KviOggTheoraEncoder::addTextFrame ( unsigned char *  textPkt,
int  textSize 
)

Appends a text frame to the stream.

Parameters
textPktbuffer containing the text
textSizesize of the text buffer
Returns
void

References KviOggIrcText::irct_encode_packetout().

Referenced by DccVideoTheoraCodec::encodeText().

void KviOggTheoraEncoder::addVideoFrame ( QRgb *  rgb32,
int  videoSize 
)

Appends a video frame to the stream.

Parameters
rgb32video frame as a matrix of rgb32 pixels
videoSizesize of the video frame
Returns
void

References rgb32toyuv444(), and YUV444_BPP.

Referenced by DccVideoTheoraCodec::encodeVideo().

int KviOggTheoraEncoder::fetch_and_process_video ( quint8 *  videoYuv,
ogg_page *  videopage,
ogg_stream_state *  to,
th_enc_ctx *  td,
int  videoflag 
)
private

Internal function that processes a video frame to create an ogg page.

Returns
int
int KviOggTheoraEncoder::fetch_and_process_video_packet ( quint8 *  videoYuv,
th_enc_ctx *  td,
ogg_packet *  op 
)
private

Internal function that processes a video frame to create an ogg packet.

Returns
int
int KviOggTheoraEncoder::ilog ( unsigned  _v)
staticprivate

Internal function used to calculate our granule shift.

Returns
int

Member Data Documentation

int KviOggTheoraEncoder::frame_state
private

Internal flag used in video frame processing

KviOggTheoraGeometry KviOggTheoraEncoder::geometry
private

Stream geometry definition

KviDataBuffer* KviOggTheoraEncoder::m_pStream
private

Stream pointer

ogg_page KviOggTheoraEncoder::og
private

One Ogg bitstream page. Vorbis packets are inside

ogg_packet KviOggTheoraEncoder::op
private

One raw packet of encoded data

th_comment KviOggTheoraEncoder::tc
private

Theora stream comments struct

th_enc_ctx* KviOggTheoraEncoder::td
private

Theora stream encoding struct

ogg_int64_t KviOggTheoraEncoder::text_sofar
private

Number of transmitted text frames

int KviOggTheoraEncoder::textflag
private

Internal flag used in text frame processing

th_info KviOggTheoraEncoder::ti
private

Theora stream info struct

ogg_stream_state KviOggTheoraEncoder::to
private

Take physical pages, weld into a logical stream of theora packets

int KviOggTheoraEncoder::videoflag
private

Internal flag used in video frame processing

quint8* KviOggTheoraEncoder::videoYuv
private

Yuv encoded surface pointer

size_t KviOggTheoraEncoder::y4m_aux_buf_read_sz
private

The amount to read into the auxiliary buffer

size_t KviOggTheoraEncoder::y4m_aux_buf_sz
private

The size of the auxiliary buffer

size_t KviOggTheoraEncoder::y4m_dst_buf_read_sz
private

The amount to read directly into the converted frame buffer

size_t KviOggTheoraEncoder::y4m_dst_buf_sz
private

The size of each converted frame buffer

unsigned char* KviOggTheoraEncoder::yuvframe[3]
private

Internal struct used in video frame processing

ogg_stream_state KviOggTheoraEncoder::zo
private

Take physical pages, weld into a logical stream of irct packets


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