![]() |
KVIrc 5.2.6
Developer APIs
|
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. | |
void | addVideoFrame (QRgb *rgb32, int videoSize) |
Appends a video frame to the stream. | |
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. | |
virtual | ~KviOggTheoraEncoder () |
Destroys the KviOggTheoraEncoder object. | |
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. | |
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. | |
Static Private Member Functions | |
static int | ilog (unsigned _v) |
Internal function used to calculate our granule shift. | |
Private Attributes | |
int | frame_state |
KviOggTheoraGeometry | geometry |
KviDataBuffer * | m_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 |
An ogg/theora+irct encoder class; accepts argb32 images and binary text, outputs an ogg stream.
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.
stream | the output stream object |
iWidth | width of the stream |
iHeight | height of the stream |
iFpsN | frames per second: numerator |
iFpsD | frames per second: denominator |
iParN | aspect ratio: numerator |
iParD | aspect ratio: denominator |
References frame_state, geometry, ilog(), KviOggIrcText::irct_encode_headerout(), KviOggIrcText::irct_encode_init(), m_pStream, og, op, tc, td, text_sofar, ti, to, videoflag, videoYuv, y4m_aux_buf_read_sz, y4m_aux_buf_sz, y4m_dst_buf_read_sz, y4m_dst_buf_sz, and zo.
|
virtual |
Destroys the KviOggTheoraEncoder object.
References KviOggIrcText::irct_encode_clear(), tc, td, and to.
void KviOggTheoraEncoder::addTextFrame | ( | unsigned char * | textPkt, |
int | textSize ) |
Appends a text frame to the stream.
textPkt | buffer containing the text |
textSize | size of the text buffer |
References KviOggIrcText::irct_encode_packetout(), m_pStream, op, text_sofar, textflag, and zo.
void KviOggTheoraEncoder::addVideoFrame | ( | QRgb * | rgb32, |
int | videoSize ) |
Appends a video frame to the stream.
rgb32 | video frame as a matrix of rgb32 pixels |
videoSize | size of the video frame |
References fetch_and_process_video(), geometry, m_pStream, rgb32toyuv444(), td, to, videoflag, videoYuv, and YUV444_BPP.
|
private |
Internal function that processes a video frame to create an ogg page.
References fetch_and_process_video_packet(), op, td, to, videoflag, and videoYuv.
Referenced by addVideoFrame().
|
private |
Internal function that processes a video frame to create an ogg packet.
References frame_state, geometry, op, td, videoYuv, y4m_aux_buf_read_sz, y4m_aux_buf_sz, y4m_dst_buf_read_sz, y4m_dst_buf_sz, and yuvframe.
Referenced by fetch_and_process_video().
|
staticprivate |
Internal function used to calculate our granule shift.
Referenced by KviOggTheoraEncoder().
|
private |
Internal flag used in video frame processing
Referenced by fetch_and_process_video_packet(), and KviOggTheoraEncoder().
|
private |
Stream geometry definition
Referenced by addVideoFrame(), fetch_and_process_video_packet(), and KviOggTheoraEncoder().
|
private |
Stream pointer
Referenced by addTextFrame(), addVideoFrame(), and KviOggTheoraEncoder().
|
private |
One Ogg bitstream page. Vorbis packets are inside
Referenced by KviOggTheoraEncoder().
|
private |
One raw packet of encoded data
Referenced by addTextFrame(), fetch_and_process_video(), fetch_and_process_video_packet(), and KviOggTheoraEncoder().
|
private |
Theora stream comments struct
Referenced by KviOggTheoraEncoder(), and ~KviOggTheoraEncoder().
|
private |
Theora stream encoding struct
Referenced by addVideoFrame(), fetch_and_process_video(), fetch_and_process_video_packet(), KviOggTheoraEncoder(), and ~KviOggTheoraEncoder().
|
private |
Number of transmitted text frames
Referenced by addTextFrame(), and KviOggTheoraEncoder().
|
private |
Internal flag used in text frame processing
Referenced by addTextFrame().
|
private |
Theora stream info struct
Referenced by KviOggTheoraEncoder().
|
private |
Take physical pages, weld into a logical stream of theora packets
Referenced by addVideoFrame(), fetch_and_process_video(), KviOggTheoraEncoder(), and ~KviOggTheoraEncoder().
|
private |
Internal flag used in video frame processing
Referenced by addVideoFrame(), fetch_and_process_video(), and KviOggTheoraEncoder().
|
private |
Yuv encoded surface pointer
Referenced by addVideoFrame(), fetch_and_process_video(), fetch_and_process_video_packet(), and KviOggTheoraEncoder().
|
private |
The amount to read into the auxiliary buffer
Referenced by fetch_and_process_video_packet(), and KviOggTheoraEncoder().
|
private |
The size of the auxiliary buffer
Referenced by fetch_and_process_video_packet(), and KviOggTheoraEncoder().
|
private |
The amount to read directly into the converted frame buffer
Referenced by fetch_and_process_video_packet(), and KviOggTheoraEncoder().
|
private |
The size of each converted frame buffer
Referenced by fetch_and_process_video_packet(), and KviOggTheoraEncoder().
|
private |
Internal struct used in video frame processing
Referenced by fetch_and_process_video_packet().
|
private |
Take physical pages, weld into a logical stream of irct packets
Referenced by addTextFrame(), and KviOggTheoraEncoder().