Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

QMediaSessionBuilder Class Reference
[QtMediaModule]

The QMediaSessionBuilder class is a base class to be used by Media Engines which need to create sessions within the Media Server. More...

    #include <QMediaSessionBuilder>

This class is under development and is subject to change.

Public Types

Public Functions


Detailed Description

The QMediaSessionBuilder class is a base class to be used by Media Engines which need to create sessions within the Media Server.

A Media Engine should make available at least one QMediaSessionBuilder to be used in the construction of media sessions.

QMediaSessionBuilder is not instantiated directly, it should be inherited and its methods overridden to provide the required functionality.

    Example
    {
        class UrlSessionBuilder : public QMediaSessionBuilder
        {
        public:
            UriSessionBuilder()
            {
                // create m_attributes, perhaps from args
            }

            ~UriSessionBuilder() {}

            QString type() { return "com.trolltech.qtopia.uri"; }
            Attributes const& attributes() { return m_attributes; }

            QMediaServerSession* createSession(QMediaSessionRequest request)
            {
                QUrl    url;
                request >> url;
                // do something
                return session;
            }

            void destroySession(QMediaServerSession* session)
            {
                delete session;
            }

        private:
            Attributes      m_attributes;
        };
    }

See also QMediaEngine, QMediaSessionRequest, and QMediaServerSession.


Member Type Documentation

typedef QMediaSessionBuilder::Attributes

A QMap of QString to QVariant. Attributes are generic name value pairs for use in communicating static information about the builder.


Member Function Documentation

QMediaSessionBuilder::~QMediaSessionBuilder ()   [virtual]

Destruct a QMediaSessionBuilder.

Attributes const & QMediaSessionBuilder::attributes () const   [pure virtual]

Returns a QMap of Attribute Name and Value pairs. This may be used for communication of some builder type information to a builder type manager, or for custom builder types may just be information that is useful to be presented into the Qt Extended Value-space.

See also QValueSpaceItem.

QMediaServerSession * QMediaSessionBuilder::createSession ( QMediaSessionRequest sessionRequest )   [pure virtual]

This function should create a QMediaServerSession, if able, based upon the information in the session request. This function will be called if the type of the QMediaSessionRequest sessionRequest matches the type of the builder. Additionally, if the builder is one of the common builder types it will only be called if it matches extra criteria, as defined by the builder type, for example, the mime type of the content.

See also QMediaSessionRequest and QMediaServerSession.

void QMediaSessionBuilder::destroySession ( QMediaServerSession * serverSession )   [pure virtual]

This function is called when the session serverSession is no longer necessary. The builder will only be asked to destroy sessions that it created. The builder must destroy the session at this time.

QString QMediaSessionBuilder::type () const   [pure virtual]

Returns a string used as an identifier for the type of builder. The string should be of the form reverse-dns.local-type. Example: com.trolltech.qtopia.uri.


Copyright © 2009 Nokia Trademarks
Qt Extended 4.4.3