Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
9 edited
5 copied

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/3rdparty/phonon/ds9/backendnode.cpp

    r561 r846  
    6868                    HRESULT hr = info.pGraph->RemoveFilter(filter);
    6969
    70                     if (hr == VFW_E_NOT_STOPPED && m_mediaObject) {
     70                    if (FAILED(hr) && m_mediaObject) {
    7171                        m_mediaObject->ensureStopped();
    7272
  • trunk/src/3rdparty/phonon/ds9/iodevicereader.cpp

    r561 r846  
    129129                  while (m_buffer.size() < int(length)) {
    130130                      needData();
    131                       if (m_mediaGraph->isStopping()) {
    132                           return VFW_E_WRONG_STATE;
    133                       }
    134131
    135132                      if (oldSize == m_buffer.size()) {
  • trunk/src/3rdparty/phonon/ds9/mediagraph.cpp

    r561 r846  
    380380            filter->QueryFilterInfo(&info);
    381381#ifdef GRAPH_DEBUG
    382             qDebug() << "removeFilter" << QString::fromUtf16(info.achName);
     382            qDebug() << "removeFilter" << QString((const QChar *)info.achName);
    383383#endif
    384384            if (info.pGraph) {
     
    876876                FILTER_INFO info;
    877877                filter->QueryFilterInfo(&info);
    878                 qDebug() << Q_FUNC_INFO << QString::fromUtf16(info.achName);
     878                qDebug() << Q_FUNC_INFO << QString((const QChar *)info.achName);
    879879                if (info.pGraph) {
    880880                    info.pGraph->Release();
     
    922922                FILTER_INFO info;
    923923                filter->QueryFilterInfo(&info);
    924                 qDebug() << "found a decoder filter" << QString::fromUtf16(info.achName);
     924                qDebug() << "found a decoder filter" << QString((const QChar *)info.achName);
    925925                if (info.pGraph) {
    926926                    info.pGraph->Release();
     
    938938                FILTER_INFO info;
    939939                filter->QueryFilterInfo(&info);
    940                 qDebug() << Q_FUNC_INFO << QString::fromUtf16(info.achName);
     940                qDebug() << Q_FUNC_INFO << QString((const QChar *)info.achName);
    941941                if (info.pGraph) {
    942942                    info.pGraph->Release();
     
    957957                FILTER_INFO info;
    958958                filter->QueryFilterInfo(&info);
    959                 qDebug() << Q_FUNC_INFO << QString::fromUtf16(info.achName);
     959                qDebug() << Q_FUNC_INFO << QString((const QChar *)info.achName);
    960960                if (info.pGraph) {
    961961                    info.pGraph->Release();
     
    991991                FILTER_INFO info;
    992992                filter->QueryFilterInfo(&info);
    993                 qDebug() << "found a demuxer filter" << QString::fromUtf16(info.achName);
     993                qDebug() << "found a demuxer filter" << QString((const QChar *)info.achName);
    994994                if (info.pGraph) {
    995995                    info.pGraph->Release();
  • trunk/src/3rdparty/phonon/ds9/mediaobject.cpp

    r561 r846  
    2828#include <initguid.h>
    2929#include <qnetwork.h>
     30#ifdef Q_CC_MSVC
     31# include <comdef.h>
     32#endif
    3033#include <evcode.h>
    3134
  • trunk/src/3rdparty/phonon/ds9/videorenderer_soft.cpp

    r561 r846  
    4646
    4747#ifndef QT_NO_OPENGL
    48 #include <gl/gl.h>
     48#include <GL/gl.h>
    4949#ifndef GL_FRAGMENT_PROGRAM_ARB
    5050#define GL_FRAGMENT_PROGRAM_ARB           0x8804
  • trunk/src/3rdparty/phonon/ds9/videorenderer_vmr9.cpp

    r561 r846  
    2323#include <QtGui/QWidget>
    2424#include <QtGui/QPainter>
    25 #include <QtCore/QTimerEvent>
    26 
    27 #ifndef Q_OS_WINCE
     25
    2826#include <d3d9.h>
    2927#include <vmr9.h>
    30 #else
    31 #include <uuids.h>
    32 #endif
    3328
    3429QT_BEGIN_NAMESPACE
     
    4944
    5045
    51 #ifdef Q_OS_WINCE
    52         VideoRendererVMR9::VideoRendererVMR9(QWidget *target) : m_target(target)
    53         {
    54             m_target->setAttribute(Qt::WA_PaintOnScreen, true);
    55             m_filter = Filter(CLSID_VideoRenderer, IID_IBaseFilter);
    56         }
    57 
    58         QSize VideoRendererVMR9::videoSize() const
    59         {
    60             LONG w = 0,
    61                 h = 0;
    62             ComPointer<IBasicVideo> basic(m_filter, IID_IBasicVideo);
    63             if (basic) {
    64                 basic->GetVideoSize( &w, &h);
    65             }
    66             return QSize(w, h);
    67         }
    68 
    69         void VideoRendererVMR9::repaintCurrentFrame(QWidget * /*target*/, const QRect & /*rect*/)
    70         {
    71             //nothing to do here: the renderer paints everything
    72         }
    73 
    74         void VideoRendererVMR9::notifyResize(const QSize &size, Phonon::VideoWidget::AspectRatio aspectRatio,
    75             Phonon::VideoWidget::ScaleMode scaleMode)
    76         {
    77             if (!isActive()) {
    78                 ComPointer<IBasicVideo> basic(m_filter, IID_IBasicVideo);
    79                 if (basic) {
    80                     basic->SetDestinationPosition(0, 0, 0, 0);
    81                 }
    82                 return;
    83             }
    84 
    85             ComPointer<IVideoWindow> video(m_filter, IID_IVideoWindow);
    86 
    87             OAHWND owner;
    88             HRESULT hr = video->get_Owner(&owner);
    89             if (FAILED(hr)) {
    90                 return;
    91             }
    92 
    93             const OAHWND newOwner = reinterpret_cast<OAHWND>(m_target->winId());
    94             if (owner != newOwner) {
    95                 video->put_Owner(newOwner);
    96                 video->put_MessageDrain(newOwner);
    97                 video->put_WindowStyle(WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
    98             }
    99 
    100             //make sure the widget takes the whole size of the parent
    101             video->SetWindowPosition(0, 0, size.width(), size.height());
    102 
    103             const QSize vsize = videoSize();
    104             internalNotifyResize(size, vsize, aspectRatio, scaleMode);
    105 
    106             ComPointer<IBasicVideo> basic(m_filter, IID_IBasicVideo);
    107             if (basic) {
    108                 basic->SetDestinationPosition(m_dstX, m_dstY, m_dstWidth, m_dstHeight);
    109             }
    110         }
    111 
    112         void VideoRendererVMR9::applyMixerSettings(qreal /*brightness*/, qreal /*contrast*/, qreal /*m_hue*/, qreal /*saturation*/)
    113         {
    114             //this can't be supported for WinCE
    115         }
    116 
    117         QImage VideoRendererVMR9::snapshot() const
    118         {
    119             ComPointer<IBasicVideo> basic(m_filter, IID_IBasicVideo);
    120             if (basic) {
    121                 LONG bufferSize = 0;
    122                 //1st we get the buffer size
    123                 basic->GetCurrentImage(&bufferSize, 0);
    124 
    125                 QByteArray buffer;
    126                 buffer.resize(bufferSize);
    127                 HRESULT hr = basic->GetCurrentImage(&bufferSize, reinterpret_cast<long*>(buffer.data()));
    128 
    129                 if (SUCCEEDED(hr)) {
    130 
    131                     const BITMAPINFOHEADER  *bmi = reinterpret_cast<const BITMAPINFOHEADER*>(buffer.constData());
    132 
    133                     const int w = qAbs(bmi->biWidth),
    134                         h = qAbs(bmi->biHeight);
    135 
    136                     // Create image and copy data into image.
    137                     QImage ret(w, h, QImage::Format_RGB32);
    138 
    139                     if (!ret.isNull()) {
    140                         const char *data = buffer.constData() + bmi->biSize;
    141                         const int bytes_per_line = w * sizeof(QRgb);
    142                         for (int y = h - 1; y >= 0; --y) {
    143                             qMemCopy(ret.scanLine(y), //destination
    144                                 data,     //source
    145                                 bytes_per_line);
    146                             data += bytes_per_line;
    147                         }
    148                     }
    149                     return ret;
    150                 }
    151             }
    152             return QImage();
    153         }
    154 
    155 #else
    15646        VideoRendererVMR9::VideoRendererVMR9(QWidget *target) : m_target(target)
    15747        {
    15848            m_filter = Filter(CLSID_VideoMixingRenderer9, IID_IBaseFilter);
    15949            if (!m_filter) {
    160                 qWarning("the video widget could not be initialized correctly");
    16150                return;
    16251            }
     
    326215            mixer->SetProcAmpControl(0, &ctrl);
    327216        }
    328 #endif
    329217    }
    330218}
  • trunk/src/3rdparty/phonon/ds9/videorenderer_vmr9.h

    r2 r846  
    2020
    2121#include "abstractvideorenderer.h"
    22 #include "compointer.h"
    2322
    2423QT_BEGIN_NAMESPACE
  • trunk/src/3rdparty/phonon/ds9/videowidget.cpp

    r769 r846  
    2525#include "mediaobject.h"
    2626
     27#ifndef Q_OS_WINCE
     28#include "videorenderer_evr.h"
    2729#include "videorenderer_vmr9.h"
     30#else
     31#include "videorenderer_default.h"
     32#endif
    2833#include "videorenderer_soft.h"
    2934
     
    353358            if (m_renderers[index] == 0 && autoCreate) {
    354359                AbstractVideoRenderer *renderer = 0;
    355                                 if (type == Native) {
    356                     renderer = new VideoRendererVMR9(m_widget);
     360                if (type == Native) {
     361#ifndef Q_OS_WINCE
     362                    renderer = new VideoRendererEVR(m_widget);
    357363                    if (renderer->getFilter() == 0) {
    358                         //instanciating the renderer might fail with error VFW_E_DDRAW_CAPS_NOT_SUITABLE (0x80040273)
     364                        delete renderer;
     365                        //EVR not present, let's try VMR
     366                        renderer = new VideoRendererVMR9(m_widget);
     367                        if (renderer->getFilter() == 0) {
     368                            //instanciating the renderer might fail
     369                            m_noNativeRendererSupported = true;
     370                            delete renderer;
     371                            renderer = 0;
     372                        }
     373                    }
     374#else
     375                    renderer = new VideoRendererDefault(m_widget);
     376                    if (renderer->getFilter() == 0) {
     377                        //instanciating the renderer might fail
    359378                        m_noNativeRendererSupported = true;
    360379                        delete renderer;
    361380                        renderer = 0;
    362381                    }
     382#endif
    363383                }
    364384
Note: See TracChangeset for help on using the changeset viewer.