PDA

View Full Version : videoplayer problem in qmediaplayer



vinayaka
25th August 2011, 12:38
This is an ex: for videoplayer using Qmediaplayer in meego netbook sdk.But this doesn't work and errors are shown


//.pro file


#-------------------------------------------------
#
# Project created by QtCreator 2011-08-25T14:33:25
#
#-------------------------------------------------

QT += core gui
QT +=multimedia

TARGET = videoplayer
CONFIG += meegotouch
TEMPLATE = app
target.path=/usr/local/bin
INSTALLS=target


SOURCES += main.cpp \
videoplayer.cpp

HEADERS += \
videoplayer.h

FORMS += \
videoplayer.ui


//header file

#ifndef VIDEOPLAYER_H
#define VIDEOPLAYER_H

#include <QMainWindow>
#include <QtMultimediaKit/QMediaPlayer>
#include <QtMultimediaKit/QVideoWidget>
#include <QUrl>

namespace Ui {
class VIDEOPLAYER;
}

class VIDEOPLAYER : public QMainWindow
{
Q_OBJECT

public:
explicit VIDEOPLAYER(QWidget *parent = 0);
QMediaPlayer *player ;

QVideoWidget *widget;


/* videoWidget = new VideoWidget(this);
player->setVideoOutput(videoWidget); additional control*/



~VIDEOPLAYER();

private slots:
void on_pushButton_2_clicked();

void on_pushButton_clicked();

private:
Ui::VIDEOPLAYER *ui;
};

#endif // VIDEOPLAYER_H

//cpp file


#include "videoplayer.h"
#include "ui_videoplayer.h"
#include <QtMultimediaKit/QMediaPlayer>
#include <QtMultimediaKit/QVideoWidget>
#include <QUrl>
#include <QDebug>



VIDEOPLAYER::VIDEOPLAYER(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::VIDEOPLAYER)
{
ui->setupUi(this);
ui->pushButton_2->hide();
player = new QMediaPlayer(this);
player->setMedia(QUrl::fromLocalFile("test.avi"));
widget = new QVideoWidget(ui->frame);
widget->show();

player->setVideoOutput(widget);
player->play();







}

VIDEOPLAYER::~VIDEOPLAYER()
{
delete ui;


}

void VIDEOPLAYER::on_pushButton_2_clicked()
{
ui->pushButton->show();
ui->pushButton_2->hide();
player->pause();

}

void VIDEOPLAYER::on_pushButton_clicked()
{
player->play();
ui->pushButton->hide();
ui->pushButton_2->show();

}




error:
c:/meegosdk_1.2/madde/toolchains/meego-sdk-i586-toolchain-1.1-w32_i686/meego-toolchain/bin/../lib/gcc/i586-meego-linux/4.5.0/../../../../i586-meego-linux/bin/ld.exe: cannot find -lQtMultimedia
collect2: ld returned 1 exit status
make: *** [videoplayer] Error 1
The process "C:\meegosdk_1.2\madde\bin\make.exe" exited with code 2.
Error while building project videoplayer (target: MeeGo)
When executing build step 'Make'

high_flyer
25th August 2011, 12:56
cannot find -lQtMultimedia
It looks like your Qt is not configured with multimedia, the lib can't be found.

vinayaka
25th August 2011, 13:09
Can you please tell me how to configure qt for multimedia as i am really novice in this

high_flyer
25th August 2011, 13:44
run configure -help, you will see all the options then.
Then run configure with the options you want.
Build.