KVIrc 5.2.6
Developer APIs
KviOggTheoraEncoder.h
Go to the documentation of this file.
1#ifndef _KVIOGGTHEORAENCODER_H_
2#define _KVIOGGTHEORAENCODER_H_
3//=============================================================================
4//
5// File : KviOggTheoraEncoder.h
6// Creation date : Wed Dec 29 2010 15:51:21 CEST by Elvio Basello
7//
8// This file is part of the KVIrc IRC client distribution
9// Copyright (C) 2010 Elvio Basello (hellvis69 at gmail dot com)
10//
11// This program is FREE software. You can redistribute it and/or
12// modify it under the terms of the GNU General Public License
13// as published by the Free Software Foundation; either version 2
14// of the License, or (at your option) any later version.
15//
16// This program is distributed in the HOPE that it will be USEFUL,
17// but WITHOUT ANY WARRANTY; without even the implied warranty of
18// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19// See the GNU General Public License for more details.
20//
21// You should have received a copy of the GNU General Public License
22// along with this program. If not, write to the Free Software Foundation,
23// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24//
25//=============================================================================
26
34
35#ifndef COMPILE_DISABLE_OGG_THEORA
36
37#include "kvi_settings.h"
39
40#include "theora/theoraenc.h"
41
42#include <QRgb>
43
44class KviDataBuffer;
45
49#define YUV444_BPP 3
50
56{
57public:
69 KviOggTheoraEncoder(KviDataBuffer * stream, int iWidth = 320, int iHeight = 240, int iFpsN = 5, int iFpsD = 1, int iParN = 4, int iParD = 3);
70
74 virtual ~KviOggTheoraEncoder();
75
76private:
79 quint8 * videoYuv;
80
81 ogg_int64_t text_sofar;
82
84 unsigned char * yuvframe[3];
85
90
91 ogg_stream_state zo;
92 ogg_stream_state to;
93 ogg_page og;
94 ogg_packet op;
95
96 th_enc_ctx * td;
97 th_info ti;
98 th_comment tc;
99
102public:
109 void addVideoFrame(QRgb * rgb32, int videoSize);
110
117 void addTextFrame(unsigned char * textPkt, int textSize);
118
119private:
124 int fetch_and_process_video(quint8 * videoYuv, ogg_page * videopage, ogg_stream_state * to, th_enc_ctx * td, int videoflag);
125
130 int fetch_and_process_video_packet(quint8 * videoYuv, th_enc_ctx * td, ogg_packet * op);
131
136 static int ilog(unsigned _v);
137};
138
139#endif // COMPILE_DISABLE_OGG_THEORA
140#endif // _KVIOGGTHEORAENCODER_H_
This file was originally part of KviTheoraDecoder.h.
Definition KviDataBuffer.h:31
static int ilog(unsigned _v)
Internal function used to calculate our granule shift.
Definition KviOggTheoraEncoder.cpp:360
int frame_state
Definition KviOggTheoraEncoder.h:83
ogg_page og
Definition KviOggTheoraEncoder.h:93
void addTextFrame(unsigned char *textPkt, int textSize)
Appends a text frame to the stream.
Definition KviOggTheoraEncoder.cpp:253
ogg_int64_t text_sofar
Definition KviOggTheoraEncoder.h:81
ogg_stream_state to
Definition KviOggTheoraEncoder.h:92
size_t y4m_aux_buf_read_sz
Definition KviOggTheoraEncoder.h:89
int videoflag
Definition KviOggTheoraEncoder.h:101
th_info ti
Definition KviOggTheoraEncoder.h:97
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.
Definition KviOggTheoraEncoder.cpp:339
KviOggTheoraGeometry geometry
Definition KviOggTheoraEncoder.h:77
int textflag
Definition KviOggTheoraEncoder.h:100
void addVideoFrame(QRgb *rgb32, int videoSize)
Appends a video frame to the stream.
Definition KviOggTheoraEncoder.cpp:222
size_t y4m_aux_buf_sz
Definition KviOggTheoraEncoder.h:88
ogg_stream_state zo
Definition KviOggTheoraEncoder.h:91
unsigned char * yuvframe[3]
Definition KviOggTheoraEncoder.h:84
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.
Definition KviOggTheoraEncoder.cpp:272
size_t y4m_dst_buf_sz
Definition KviOggTheoraEncoder.h:86
ogg_packet op
Definition KviOggTheoraEncoder.h:94
th_enc_ctx * td
Definition KviOggTheoraEncoder.h:96
size_t y4m_dst_buf_read_sz
Definition KviOggTheoraEncoder.h:87
quint8 * videoYuv
Definition KviOggTheoraEncoder.h:79
KviDataBuffer * m_pStream
Definition KviOggTheoraEncoder.h:78
th_comment tc
Definition KviOggTheoraEncoder.h:98
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.
Definition KviOggTheoraEncoder.cpp:55
This file contains compile time settings.
#define KVILIB_API
Definition kvi_settings.h:124
Definition KviOggTheoraGeometry.h:40