×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User
    Join Date
    Nov 2010
    Posts
    16

    Problems running simple phonon video player.

    I 'm trying to run a local video on the mass storage E drive of a Nokia N8 device using Phonon library (MediaObject, VideoWidget and VideoPlayer). Here you are the code I 'm using:
    Code:
    phononVideoPlayer = new Phonon::VideoPlayer(container) ;
    phononVideoPlayer->setGeometry(0 , 35 , 360 , 420);
    phononVideoPlayer->play(Phonon::MediaSource(QUrl::fromLocalFile("E:\\Video\\w-rain-day-01-n8.3gp")));
    and every time, the application crashes and gives me the following message:

    Executable file: 11155 2011-01-16T16:33:45 C:\NokiaQtSDK\Symbian\SDK\epoc32\release\gcce\udeb\TestVideoWithPhonon.exe
    Starting application...
    Application running with pid 920.
    Process 920, thread 921 stopped at 0x80443785: Thread 0x399 has panicked. Category: WSERV; Reason: 64
    Finished.


    I tried to use the MediaObject and VideoWidget classes, but I does not work too. Here you are the code I 'm using:

    Code:
    mediaObject = new Phonon::MediaObject(this);
    mediaObject->setCurrentSource(Phonon::MediaSource(QString("E:\\Video\\sample_mpeg4.mp4")));
    
    phononVideoWidget = new Phonon::VideoWidget(this);
    Phonon::createPath(mediaObject, phononVideoWidget);
    
    connect(mediaObject, SIGNAL(aboutToFinish()), this, SLOT(restartVideo()));
    mediaObject->play();
    The application crashes too with the following log dump:

    Executable file: 11080 2011-01-16T16:38:28 C:\NokiaQtSDK\Symbian\SDK\epoc32\release\gcce\udeb\TestVideoWithPhonon.exe
    Starting application...
    Application running with pid 942.
    [Qt Message] Starting the code
    ADEV 1295231871 0945 Setting callback granulatiry percentage to 40

    CORE 1295231871 0945 HXPlayer[0x5e5cc8]::OpenRequest(): file:///file:///E:/Video/sample_mpeg4.mp4

    CORE 1295231871 0945 HXFileSource::ExtendedSetup() this[0x5f1aa0] DisablePlusURLHandling:1

    Process 942, thread 943 stopped at 0x80443785: Thread 0x3af has panicked. Category: WSERV; Reason: 64
    CORE 1295231871 0945 ClientPrerollHelper::GetPreroll() header [0x5f61c8]: Preroll 1000 PostDecodeDelay 0 Total 1000

    CORE 1295231871 0945 HXBufferingState[audio/X-RN-MP4-RAWAU-0x5f7150]::OnStreamHeader()
    StreamNum=0 PreRoll=1000 PreData=0 PDSt
    art=0 PDSeek=0 PRStart=0 PRSeek=0 AvgBitRate=48000 MaxBitRate=0 mimeType=audio/X-RN-MP4-RAWAU

    Finished
    .

    I 'm using Qt 4.6.3 on windows 7 and testing the application on Nokia N8 device. does anyone have suggestions??
    Does the problem with the Qt framework installed on the device or something else?

  2. #2
    Regular Contributor
    Join Date
    Aug 2008
    Posts
    95

    Re: Problems running simple phonon video player.

    I had the same problem. Are you sure that you don't have any widget open below "container" widget?

  3. #3
    Registered User
    Join Date
    Nov 2010
    Posts
    16

    Re: Problems running simple phonon video player.

    Thanks for response. The main class is QMainWindow which contains:
    1) In case of the VideoPlayer, a container widget (QWidget) which I set as the parent of the VideoPlayer.
    Code:
     container = new QWidget(this) ;
                container->setGeometry(0 , 35 , 360 , 420) ;
                container->setWindowModality(Qt::WindowModal) ;
                phononVideoPlayer = new Phonon::VideoPlayer(container) ;
                    phononVideoPlayer->setGeometry(0 , 35 , 360 , 420);
                    phononVideoPlayer->play(Phonon::MediaSource(QUrl::fromLocalFile("E:\\Video\\filename.3gp)));
    2) In case of the MediaObject and the VideoWidget, the parent of the two objects is the QMainWindow itself.
    Code:
    mediaObject = new Phonon::MediaObject(this);
                mediaObject->setCurrentSource(Phonon::MediaSource(QString("E:\\Video\\sample_mpeg4.mp4")));
    
                phononVideoWidget = new Phonon::VideoWidget(this);
                phononVideoWidget->setGeometry(0 , 35 , 360 , 420);
                
                Phonon::createPath(mediaObject, phononVideoWidget);
                mediaObject->play();
    In both cases, the corresponding exceptions I mentioned in the previous post are shown. Have you found any solution to this problem. I 'm working on it for a week with no hope???

  4. #4
    Regular Contributor
    Join Date
    Aug 2008
    Posts
    95

    Re: Problems running simple phonon video player.

    If you use Phono::VideoPlayer or Phonon::VideoWidget is the same.

    Have you setted setCentralWidget of QMainWindow ?

    If you are trying with C7 or N8, have you installed Phonon fix plugin?
    http://wiki.forum.nokia.com/index.ph...an%5E3_devices

    Try this simple code. It works for me.


    #-------------------------------------------------
    #
    # Project created by QtCreator 2011-01-17T10:28:38
    #
    #-------------------------------------------------

    QT += core gui phonon

    TARGET = MyVideoPlayer
    TEMPLATE = app


    SOURCES += main.cpp\
    mainwindow.cpp

    HEADERS += mainwindow.h

    FORMS +=

    CONFIG += mobility
    MOBILITY =

    symbian {
    TARGET.UID3 = 0xef7dbcab
    # TARGET.CAPABILITY +=
    TARGET.EPOCSTACKSIZE = 0x14000
    TARGET.EPOCHEAPSIZE = 0x020000 0x800000
    }






    #ifndef MAINWINDOW_H
    #define MAINWINDOW_H

    #include <QMainWindow>


    class MainWindow : public QMainWindow
    {
    Q_OBJECT

    public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

    };

    #endif // MAINWINDOW_H




    #include <QtGui/QApplication>
    #include "mainwindow.h"

    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    MainWindow w;
    #if defined(Q_WS_S60)
    w.showMaximized();
    #else
    w.show();
    #endif

    return a.exec();
    }





    #include "mainwindow.h"
    #include <phonon/VideoPlayer>
    #include <QUrl>

    MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent)
    {
    QWidget *container = new QWidget(this) ;
    container->setGeometry(0 , 35 , 360 , 420) ;
    container->setWindowModality(Qt::WindowModal) ;
    Phonon::VideoPlayer *phononVideoPlayer = new Phonon::VideoPlayer(container) ;
    phononVideoPlayer->setGeometry(0 , 35 , 360 , 420);
    phononVideoPlayer->play(Phonon::MediaSource(QUrl::fromLocalFile("E:\\n97_verticale.3gp")));
    }

    MainWindow::~MainWindow()
    {
    }

  5. #5
    Registered User
    Join Date
    Nov 2010
    Posts
    16

    Re: Problems running simple phonon video player.

    Great ... Now your code runs without crashing while creating the videoPlayer, but the vidoe is not display and a white widget is displayed instead. This message is printed in the log:

    ADEV 1295220768 1611 Setting callback granulatiry percentage to 40

    [Qt Message] QVGPaintEngine::compositionModeChanged unsupported mode 2

    Is this a problem with the video encoding or something like that??

  6. #6
    Regular Contributor
    Join Date
    Aug 2008
    Posts
    95

    Re: Problems running simple phonon video player.

    This is a problem with video encoding.

    If you want to be sure, try to play the video with Nokia internal video player.

  7. #7
    Registered User
    Join Date
    Nov 2010
    Posts
    16

    Re: Problems running simple phonon video player.

    Negus ... You are my man . It's now playing the video. The problem was with some missing Dependency that was solved by the Smart Installer, but another problem rised ... the video sometimes plays and sometimes does not.

    If the video size is large ... may be 5MB ... may that be a problem that prevents the player displaying it?

    If the Nokia internal video player played the video, so the problem is not with the video encoding. Is n't it?

  8. #8
    Regular Contributor
    Join Date
    Aug 2008
    Posts
    95

    Re: Problems running simple phonon video player.

    Yes, exactly. If internal video player plays video correctly, video encoding is correct.

    So I'll analize your code, finding if you correctly setCentralWidget of QMainWindow.

  9. #9
    Registered User
    Join Date
    Nov 2010
    Posts
    16

    Re: Problems running simple phonon video player.

    Excuse me, but what do you mean by setCentralWidget?? Is that necessary for using Phonon::VideoPlayer to set it inside the central widget?

  10. #10
    Regular Contributor
    Join Date
    Aug 2008
    Posts
    95

    Re: Problems running simple phonon video player.

    QMainWindow has the method setCentralWidget to define current viewing widget (that will have child widgets, ecc.).

    I have tested that if you don't assign setCentralWidget, the behaviour of application could be impredictable (mostly when you are developing multimedia application).

  11. #11
    Registered User
    Join Date
    Nov 2010
    Posts
    16

    Re: Problems running simple phonon video player.

    It 's working perfectly. Many thanks negus. You saved me much time .

Similar Threads

  1. Can any one please provide me simple audio, video player
    By manojkumar.m in forum Symbian C++
    Replies: 2
    Last Post: 2008-10-31, 07:08

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •