Beispiel #1
0
        void MediaObject::loadingFinished(MediaGraph *mg)
        {
            if (mg == currentGraph()) {
#ifndef QT_NO_PHONON_MEDIACONTROLLER
                //Title interface
                m_currentTitle = 0;
                setTitles(currentGraph()->titles());
#endif //QT_NO_PHONON_MEDIACONTROLLER

                HRESULT hr = mg->renderResult();

                if (catchComError(hr)) {
                    return;
                }

                if (m_oldHasVideo != currentGraph()->hasVideo()) {
                    emit hasVideoChanged(currentGraph()->hasVideo());
                }

#ifndef QT_NO_PHONON_VIDEO
                if (currentGraph()->hasVideo()) {
                    updateVideoGeometry();
                }
#endif //QT_NO_PHONON_VIDEO

                emit metaDataChanged(currentGraph()->metadata());
                emit totalTimeChanged(totalTime());

                //let's put the next state
                switch(m_nextState)
                {
                case Phonon::PausedState:
                    pause();
                    break;
                case Phonon::PlayingState:
                    play();
                    break;
                case Phonon::ErrorState:
                    setState(Phonon::ErrorState);
                    break;
                case Phonon::StoppedState:
                default:
                    stop();
                    break;
                }
            }
        }
Beispiel #2
0
void MediaObject::handleEvents(Graph graph, long eventCode, long param1)
{
    QString eventDescription;
    switch (eventCode)
    {
    case EC_BUFFERING_DATA:
        if (graph == currentGraph()->graph()) {
            m_buffering = param1;
            emit stateChanged(state(), m_state);
        }
        break;
    case EC_LENGTH_CHANGED:
        if (graph == currentGraph()->graph()) {
            emit totalTimeChanged( totalTime() );
        }
        break;

    case EC_COMPLETE:
        handleComplete(graph);
        break;

#ifndef QT_NO_PHONON_VIDEO
    case EC_VIDEO_SIZE_CHANGED:
        if (graph == currentGraph()->graph()) {
            updateVideoGeometry();
        }
        break;
#endif //QT_NO_PHONON_VIDEO

#ifdef GRAPH_DEBUG
    case EC_ACTIVATE:
        qDebug() << "EC_ACTIVATE: A video window is being " << (param1 ? "ACTIVATED" : "DEACTIVATED");
        break;
    case EC_BUILT:
        qDebug() << "EC_BUILT: Send by the Video Control when a graph has been built. Not forwarded to applications.";
        break;
    case EC_CLOCK_CHANGED:
        qDebug() << "EC_CLOCK_CHANGED";
        break;
    case EC_CLOCK_UNSET:
        qDebug() << "EC_CLOCK_UNSET: The clock provider was disconnected.";
        break;
    case EC_CODECAPI_EVENT:
        qDebug() << "EC_CODECAPI_EVENT: Sent by an encoder to signal an encoding event.";
        break;
    case EC_DEVICE_LOST:
        qDebug() << "EC_DEVICE_LOST: A Plug and Play device was removed or has become available again.";
        break;
    case EC_DISPLAY_CHANGED:
        qDebug() << "EC_DISPLAY_CHANGED: The display mode has changed.";
        break;
    case EC_END_OF_SEGMENT:
        qDebug() << "EC_END_OF_SEGMENT: The end of a segment has been reached.";
        break;
    case EC_ERROR_STILLPLAYING:
        qDebug() << "EC_ERROR_STILLPLAYING: An asynchronous command to run the graph has failed.";
        break;
    case EC_ERRORABORT:
        qDebug() << "EC_ERRORABORT: An operation was aborted because of an error.";
        break;
    case EC_EXTDEVICE_MODE_CHANGE:
        qDebug() << "EC_EXTDEVICE_MODE_CHANGE: Not supported.";
        break;
    case EC_FULLSCREEN_LOST:
        qDebug() << "EC_FULLSCREEN_LOST: The video renderer is switching out of full-screen mode.";
        break;
    case EC_GRAPH_CHANGED:
        qDebug() << "EC_GRAPH_CHANGED: The filter graph has changed.";
        break;
    case EC_NEED_RESTART:
        qDebug() << "EC_NEED_RESTART: A filter is requesting that the graph be restarted.";
        break;
    case EC_NOTIFY_WINDOW:
        qDebug() << "EC_NOTIFY_WINDOW: Notifies a filter of the video renderer's window.";
        break;
    case EC_OLE_EVENT:
        qDebug() << "EC_OLE_EVENT: A filter is passing a text string to the application.";
        break;
    case EC_OPENING_FILE:
        qDebug() << "EC_OPENING_FILE: The graph is opening a file, or has finished opening a file.";
        break;
    case EC_PALETTE_CHANGED:
        qDebug() << "EC_PALETTE_CHANGED: The video palette has changed.";
        break;
    case EC_PAUSED:
        qDebug() << "EC_PAUSED: A pause request has completed.";
        break;
    case EC_PREPROCESS_COMPLETE:
        qDebug() << "EC_PREPROCESS_COMPLETE: Sent by the WM ASF Writer filter when it completes the pre-processing for multipass encoding.";
        break;
    case EC_QUALITY_CHANGE:
        qDebug() << "EC_QUALITY_CHANGE: The graph is dropping samples, for quality control.";
        break;
    case EC_REPAINT:
        qDebug() << "EC_REPAINT: A video renderer requires a repaint.";
        break;
    case EC_SEGMENT_STARTED:
        qDebug() << "EC_SEGMENT_STARTED: A new segment has started.";
        break;
    case EC_SHUTTING_DOWN:
        qDebug() << "EC_SHUTTING_DOWN: The filter graph is shutting down, prior to being destroyed.";
        break;
    case EC_SNDDEV_IN_ERROR:
        qDebug() << "EC_SNDDEV_IN_ERROR: A device error has occurred in an audio capture filter.";
        break;
    case EC_SNDDEV_OUT_ERROR:
        qDebug() << "EC_SNDDEV_OUT_ERROR: A device error has occurred in an audio renderer filter.";
        break;
    case EC_STARVATION:
        qDebug() << "EC_STARVATION: A filter is not receiving enough data.";
        break;
    case EC_STATE_CHANGE:
        qDebug() << "EC_STATE_CHANGE: The filter graph has changed state.";
        break;
    case EC_STEP_COMPLETE:
        qDebug() << "EC_STEP_COMPLETE: A filter performing frame stepping has stepped the specified number of frames.";
        break;
    case EC_STREAM_CONTROL_STARTED:
        qDebug() << "EC_STREAM_CONTROL_STARTED: A stream-control start command has taken effect.";
        break;
    case EC_STREAM_CONTROL_STOPPED:
        qDebug() << "EC_STREAM_CONTROL_STOPPED: A stream-control stop command has taken effect.";
        break;
    case EC_STREAM_ERROR_STILLPLAYING:
        qDebug() << "EC_STREAM_ERROR_STILLPLAYING: An error has occurred in a stream. The stream is still playing.";
        break;
    case EC_STREAM_ERROR_STOPPED:
        qDebug() << "EC_STREAM_ERROR_STOPPED: A stream has stopped because of an error.";
        break;
    case EC_TIMECODE_AVAILABLE:
        qDebug() << "EC_TIMECODE_AVAILABLE: Not supported.";
        break;
    case EC_UNBUILT:
        qDebug() << "Sent by the Video Control when a graph has been torn down. Not forwarded to applications.";
        break;
    case EC_USERABORT:
        qDebug() << "EC_USERABORT: Send by the Video Control when a graph has been torn down. Not forwarded to applications.";
        break;
    case EC_VMR_RECONNECTION_FAILED:
        qDebug() << "EC_VMR_RECONNECTION_FAILED: Sent by the VMR-7 and the VMR-9 when it was unable to accept a dynamic format change request from the upstream decoder.";
        break;
    case EC_VMR_RENDERDEVICE_SET:
        qDebug() << "EC_VMR_RENDERDEVICE_SET: Sent when the VMR has selected its rendering mechanism.";
        break;
    case EC_VMR_SURFACE_FLIPPED:
        qDebug() << "EC_VMR_SURFACE_FLIPPED: Sent when the VMR-7's allocator presenter has called the DirectDraw Flip method on the surface being presented.";
        break;
    case EC_WINDOW_DESTROYED:
        qDebug() << "EC_WINDOW_DESTROYED: The video renderer was destroyed or removed from the graph";
        break;
    case EC_WMT_EVENT:
        qDebug() << "EC_WMT_EVENT: Sent by the Windows Media Format SDK when an application uses the ASF Reader filter to play ASF files protected by digital rights management (DRM).";
        break;
    case EC_WMT_INDEX_EVENT:
        qDebug() << "EC_WMT_INDEX_EVENT: Sent by the Windows Media Format SDK when an application uses the ASF Writer to index Windows Media Video files.";
        break;

    //documented by Microsoft but not supported in the Platform SDK
    //              case EC_BANDWIDTHCHANGE : qDebug() << "EC_BANDWIDTHCHANGE: not supported"; break;
    //              case EC_CONTENTPROPERTY_CHANGED: qDebug() << "EC_CONTENTPROPERTY_CHANGED: not supported."; break;
    //              case EC_EOS_SOON: qDebug() << "EC_EOS_SOON: not supported"; break;
    //              case EC_ERRORABORTEX: qDebug() << "EC_ERRORABORTEX: An operation was aborted because of an error."; break;
    //              case EC_FILE_CLOSED: qDebug() << "EC_FILE_CLOSED: The source file was closed because of an unexpected event."; break;
    //              case EC_LOADSTATUS: qDebug() << "EC_LOADSTATUS: Notifies the application of progress when opening a network file."; break;
    //              case EC_MARKER_HIT: qDebug() << "EC_MARKER_HIT: not supported."; break;
    //              case EC_NEW_PIN: qDebug() << "EC_NEW_PIN: not supported."; break;
    //              case EC_PLEASE_REOPEN: qDebug() << "EC_PLEASE_REOPEN: The source file has changed."; break;
    //              case EC_PROCESSING_LATENCY: qDebug() << "EC_PROCESSING_LATENCY: Indicates the amount of time that a component is taking to process each sample."; break;
    //              case EC_RENDER_FINISHED: qDebug() << "EC_RENDER_FINISHED: Not supported."; break;
    //              case EC_SAMPLE_LATENCY: qDebug() << "EC_SAMPLE_LATENCY: Specifies how far behind schedule a component is for processing samples."; break;
    //              case EC_SAMPLE_NEEDED: qDebug() << "EC_SAMPLE_NEEDED: Requests a new input sample from the Enhanced Video Renderer (EVR) filter."; break;
    //              case EC_SCRUB_TIME: qDebug() << "EC_SCRUB_TIME: Specifies the time stamp for the most recent frame step."; break;
    //              case EC_STATUS: qDebug() << "EC_STATUS: Contains two arbitrary status strings."; break;
    //              case EC_VIDEOFRAMEREADY: qDebug() << "EC_VIDEOFRAMEREADY: A video frame is ready for display."; break;

    default:
        qDebug() << "Unknown event" << eventCode << "(" << param1 << ")";
        break;
#else
    default:
        break;
#endif
    }
}