Compile the qte video output with qtopia core 4.1.3

*nix specific usage questions
tyrone.yimin
New Cone
New Cone
Posts: 6
Joined: 31 Jul 2006 04:28

Compile the qte video output with qtopia core 4.1.3

Postby tyrone.yimin » 09 Aug 2006 10:55

i want test video output qte, using qtopia core 4.1.3, and i will use qvfb on my computer.

1.I modified the configure.ac file, as follows:
VLC_ADD_LDFLAGS([qte],[-L${with_qte}/lib -lQtCore -lQtGui -lQtSvg -ljpeg -lQt3Support])
VLC_ADD_CXXFLAGS([qte],[-I${with_qte}/include -DQT3_SUPPORT -fno-exceptions -fno-rtti])



2.my configure script:
./configure --prefix=/home/vlce --disable-x11 --enable-xvideo --disable-gtk --enable-sdl --enable-ffmpeg --with-ffmpeg-mp3lame --enable-mad --enable-libdvbpsi --enable-a52 --enable-dts --enable-libmpeg2 --enable-dvdnav --enable-faad --enable-vorbis --enable-ogg --enable-theora --enable-faac --enable-mkv --enable-freetype --enable-fribidi --enable-speex --enable-flac --enable-live555 --with-live555-tree=/home/yimin/project/live --with-ffmpeg-tree=/home/yimin/project/ffmpeg-20051126 --enable-caca --enable-skins --enable-skins2 --enable-alsa --disable-kde --disable-qt4 --disable-wxwidgets --enable-ncurses --enable-release --enable-dvdread --enable-qte --with-qte=/usr/local/Trolltech/QtopiaCore-4.1.3

3.when i compiled it , report follow error messages:
qte.cpp: In function ‘void Display(vout_thread_t*, picture_t*)’:
qte.cpp:341: 错误:对 ‘QDirectPainter::QDirectPainter(QWidget*&)’ 的调用没有匹配的函数
/usr/local/Trolltech/QtopiaCore-4.1.3/include/Qt/qdirectpainter_qws.h:37: 附注:备选为: QDirectPainter::QDirectPainter()
/usr/local/Trolltech/QtopiaCore-4.1.3/include/Qt/qdirectpainter_qws.h:37: 附注: QDirectPainter::QDirectPainter(const QDirectPainter&)
qte.cpp:342: 错误:‘class QDirectPainter’ 没有名为 ‘transformOrientation’ 的成员
qte.cpp:344: 错误:‘class QDirectPainter’ 没有名为 ‘lineStep’ 的成员
qte.cpp: In function ‘int OpenDisplay(vout_thread_t*)’:
qte.cpp:521: 错误:不能将 ‘QDesktopWidget*’ 转换为 ‘QWidget*’,在 initialization 中
qte.cpp: In function ‘void RunQtThread(event_thread_t*)’:
qte.cpp:626: 错误:不能将 ‘QDesktopWidget*’ 转换为 ‘QWidget*’,在 initialization 中
qte.cpp: At global scope:
qte.cpp:278: 警告:‘void Render(vout_thread_t*, picture_t*)’ 定义后未使用
qte.cpp:490: 警告:‘void ToggleFullScreen(vout_thread_t*)’ 定义后未使用
make[6]: *** [libqte_plugin_a-qte.o] 错误 1
make[6]: Leaving directory `/home/yimin/project/vlc-trunk/modules/video_output/qte'
make[5]: *** [all-modules] 错误 1
make[5]: Leaving directory `/home/yimin/project/vlc-trunk/modules/video_output/qte'
make[4]: *** [all-recursive] 错误 1
make[4]: Leaving directory `/home/yimin/project/vlc-trunk/modules/video_output'
make[3]: *** [all] 错误 2
make[3]: Leaving directory `/home/yimin/project/vlc-trunk/modules/video_output'
make[2]: *** [all-recursive] 错误 1
make[2]: Leaving directory `/home/yimin/project/vlc-trunk/modules'
make[1]: *** [all-recursive] 错误 1
make[1]: Leaving directory `/home/yimin/project/vlc-trunk'
make: *** [all] 错误 2

4.it seems that the function "Display" in qte.cpp has some error:
#ifndef USE_DIRECT_PAINTER
msg_Dbg(p_vout, "not using direct painter");
QPainter p(p_vout->p_sys->p_VideoWidget);

/* rotate frame */
int dd = QPixmap::defaultDepth();
int bytes = ( dd == 16 ) ? 2 : 4;
int rw = h, rh = w;

QImage rotatedFrame( rw, rh, bytes << 3 );

ushort* in = (ushort*)p_pic->p_sys->pQImage->bits();
ushort* out = (ushort*)rotatedFrame.bits();

int spl = rotatedFrame.bytesPerLine() / bytes;
for (int x=0; x<h; x++)
{
if ( bytes == 2 )
{
ushort* lout = out++ + (w - 1)*spl;
for (int y=0; y<w; y++)
{
*lout=*in++;
lout-=spl;
}
}
else
{
ulong* lout = ((ulong *)out)++ + (w - 1)*spl;
for (int y=0; y<w; y++)
{
*lout=*((ulong*)in)++;
lout-=spl;
}
}
}

p.drawImage( x, y, rotatedFrame, 0, 0, rw, rh );
#else
QDirectPainter p(p_vout->p_sys->p_VideoWidget);
p.transformOrientation();
// just copy the image to the frame buffer...
memcpy(p.frameBuffer(), (p_pic->p_sys->pQImage->jumpTable())[0], h *p.lineStep());
#endif

tyrone.yimin
New Cone
New Cone
Posts: 6
Joined: 31 Jul 2006 04:28

addition

Postby tyrone.yimin » 09 Aug 2006 11:09

#ifdef Q_WS_QWS
# define USE_DIRECT_PAINTER
# include <Qt/qdirectpainter_qws.h>
# include <Qt/qgfxraster_qws.h> //this include file is not in qtopia core 4
#endif

#else
QDirectPainter p(p_vout->p_sys->p_VideoWidget); //does not has this constructor
p.transformOrientation(); //does not has this member function
// just copy the image to the frame buffer...
memcpy(p.frameBuffer(), (p_pic->p_sys->pQImage->jumpTable())[0], h *p.lineStep());
//does not has lineStep()
#endif

it seems that QScreen has "transformOrientation()" and "lineStep()" member function.

any idea is welcomed.

tyrone.yimin
New Cone
New Cone
Posts: 6
Joined: 31 Jul 2006 04:28

addition 1

Postby tyrone.yimin » 10 Aug 2006 11:41

i changed the "Display" method as follow, and i can compile and run vlc, but when i run vlc using ./vlc --vout qte --qte-guiserver --intf hotkeys -vvvv dvd:///dev/dvd-hdc, i get nothing in qvfb window.

static void Display( vout_thread_t *p_vout, picture_t *p_pic )
{
unsigned int x, y, w, h;

msg_Dbg( p_vout, "Entering Display ..." );

vout_PlacePicture( p_vout, p_vout->output.i_width, p_vout->output.i_height,
&x, &y, &w, &h );

#if 1
msg_Dbg(p_vout, "+qte::Display( p_vout, i_width=%d, i_height=%d, x=%u, y=%u, w=%u, h=%u",
p_vout->output.i_width, p_vout->output.i_height, x, y, w, h );
#endif

if(p_vout->p_sys->p_VideoWidget)
{
// shameless borrowed from opie mediaplayer....
//#ifndef USE_DIRECT_PAINTER
msg_Dbg(p_vout, "not using direct painter");
QPainter p(p_vout->p_sys->p_VideoWidget);

// msg_Dbg(p_vout, "test drawText");
if (p.isActive())
{
// p.drawText(5,5, QString("test vlc for qte"));
/* rotate frame */

int dd = QPixmap::defaultDepth();
int bytes = ( dd == 16 ) ? 2 : 4;


msg_Dbg(p_vout, "bytes=%d", bytes);

int rw = h, rh = w;

QImage rotatedFrame( rw, rh, bytes << 3 );

ushort* in = (ushort*)p_pic->p_sys->pQImage->bits();
ushort* out = (ushort*)rotatedFrame.bits();

int spl = rotatedFrame.bytesPerLine() / bytes;
for (int i=0; i<h; i++)
{
if ( bytes == 2 )
{
ushort* lout = out++ + (w - 1)*spl;
for (int j=0; j<w; j++)
{
*lout=*in++;
lout-=spl;
}
}
else
{
// ulong* lout = ((ulong *)out)++ + (w - 1)*spl;
ulong* lout = (ulong *)out;
lout++;
lout = lout + (w - 1)*spl;
for (int j=0; j<w; j++)
{
ulong* ultemp = (ulong*)in;
ultemp++;
*lout= *ultemp;//TODO:test
lout-=spl;
}
}
}

p.drawImage( x, y, rotatedFrame, 0, 0, rw, rh );
//p.end();

}
//p_vout->p_sys->p_VideoWidget->update();

/*
#else

QDirectPainter p(p_vout->p_sys->p_VideoWidget);
p.transformOrientation();
// just copy the image to the frame buffer...
memcpy(p.frameBuffer(), (p_pic->p_sys->pQImage->jumpTable())[0], h *p.lineStep());

#endif
*/
}
}

tyrone.yimin
New Cone
New Cone
Posts: 6
Joined: 31 Jul 2006 04:28

addition 2

Postby tyrone.yimin » 10 Aug 2006 11:46

It seems that QDirectPainter class is very different between qt/e 2/3 and qtopia core 4.1.3.
in qt/e 2/3, QDirectPainter class is inherited from QPainter, but in qtopia core 4.1.3, QDirectPainter is inherited directly from QObject. How can i port the code ?


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: No registered users and 6 guests