<commit_before>/*
    Copyright (C) 2012 Openismus GmbH
      @author <NAME> <<EMAIL>>

    This library is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published
    by the Free Software Foundation; either version 2.1 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QGST_DISCOVERER_H
#define QGST_DISCOVERER_H

#include <QGst/ClockTime>
#include <QGst/Fraction>
#include <QGst/MiniObject>
#include <QGst/Object>
#include <QGst/Structure>
#include <QGst/TagList>

#include <QtCore/QUrl>

#include "global.h"

namespace QGst {

class QTGSTREAMER_EXPORT DiscovererStreamInfo : public QGst::MiniObject
{
    QGST_WRAPPER(DiscovererStreamInfo)

public:
    DiscovererStreamInfoPtr previous() const;
    DiscovererStreamInfoPtr next() const;
    QString streamTypeNick() const;
    CapsPtr caps() const;
    TagList tags() const;
    Structure misc() const;
};

class QTGSTREAMER_EXPORT DiscovererContainerInfo : public DiscovererStreamInfo
{
    QGST_WRAPPER(DiscovererContainerInfo)

public:
    QList<DiscovererStreamInfoPtr> streams() const;
};

class QTGSTREAMER_EXPORT DiscovererAudioInfo : public DiscovererStreamInfo
{
    QGST_WRAPPER(DiscovererAudioInfo)

public:
    uint channels() const;
    uint sampleRate() const;
    uint depth() const;
    uint bitrate() const;
    uint maxBitrate() const;
    QString language() const;
};

class QTGSTREAMER_EXPORT DiscovererVideoInfo : public DiscovererStreamInfo
{
    QGST_WRAPPER(DiscovererVideoInfo)

public:
    uint width() const;
    uint height() const;
    uint depth() const;
    Fraction framerate() const;
    Fraction pixelAspectRatio() const;
    uint bitrate() const;
    uint maxBitrate() const;
    bool isInterlaced() const;
    bool isImage() const;
};

class QTGSTREAMER_EXPORT DiscovererSubtitleInfo : public DiscovererStreamInfo
{
    QGST_WRAPPER(DiscovererSubtitleInfo)

public:
    QString language() const;
};

class QTGSTREAMER_EXPORT DiscovererInfo : public QGst::MiniObject
{
    QGST_WRAPPER(DiscovererInfo)

public:
    QUrl uri() const;
    DiscovererResult result() const;

    ClockTime duration() const;
    bool seekable() const;
    Structure misc() const;
    TagList tags() const;

    DiscovererStreamInfoPtr streamInfo() const;
    QList<DiscovererStreamInfoPtr> streams() const;
    QList<DiscovererStreamInfoPtr> streams(QGlib::Type streamType) const;
    QList<DiscovererStreamInfoPtr> audioStreams() const;
    QList<DiscovererStreamInfoPtr> videoStreams() const;
    QList<DiscovererStreamInfoPtr> subtitleStreams() const;
    QList<DiscovererStreamInfoPtr> containerStreams() const;
};

class QTGSTREAMER_EXPORT Discoverer : public QGlib::Object
{
    QGST_WRAPPER(Discoverer)

public:
    /*! Creates a new discoverer with the provided timeout.
     * \throws QGlib::Error when there was a problem creating the discoverer
     */
    static DiscovererPtr create(ClockTime timeout);

    /*! Allow asynchronous discovering of URIs to take place. An event loop must be
     * available for QGst::Discoverer to properly work in asynchronous mode.
     * \ingroup async
     */
    void start();<commit_msg>discoverer: Document the requirement of a glib event loop for the async API<commit_after>/*
    Copyright (C) 2012 Openismus GmbH
      @author <NAME> <<EMAIL>>

    This library is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published
    by the Free Software Foundation; either version 2.1 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QGST_DISCOVERER_H
#define QGST_DISCOVERER_H

#include <QGst/ClockTime>
#include <QGst/Fraction>
#include <QGst/MiniObject>
#include <QGst/Object>
#include <QGst/Structure>
#include <QGst/TagList>

#include <QtCore/QUrl>

#include "global.h"

namespace QGst {

class QTGSTREAMER_EXPORT DiscovererStreamInfo : public QGst::MiniObject
{
    QGST_WRAPPER(DiscovererStreamInfo)

public:
    DiscovererStreamInfoPtr previous() const;
    DiscovererStreamInfoPtr next() const;
    QString streamTypeNick() const;
    CapsPtr caps() const;
    TagList tags() const;
    Structure misc() const;
};

class QTGSTREAMER_EXPORT DiscovererContainerInfo : public DiscovererStreamInfo
{
    QGST_WRAPPER(DiscovererContainerInfo)

public:
    QList<DiscovererStreamInfoPtr> streams() const;
};

class QTGSTREAMER_EXPORT DiscovererAudioInfo : public DiscovererStreamInfo
{
    QGST_WRAPPER(DiscovererAudioInfo)

public:
    uint channels() const;
    uint sampleRate() const;
    uint depth() const;
    uint bitrate() const;
    uint maxBitrate() const;
    QString language() const;
};

class QTGSTREAMER_EXPORT DiscovererVideoInfo : public DiscovererStreamInfo
{
    QGST_WRAPPER(DiscovererVideoInfo)

public:
    uint width() const;
    uint height() const;
    uint depth() const;
    Fraction framerate() const;
    Fraction pixelAspectRatio() const;
    uint bitrate() const;
    uint maxBitrate() const;
    bool isInterlaced() const;
    bool isImage() const;
};

class QTGSTREAMER_EXPORT DiscovererSubtitleInfo : public DiscovererStreamInfo
{
    QGST_WRAPPER(DiscovererSubtitleInfo)

public:
    QString language() const;
};

class QTGSTREAMER_EXPORT DiscovererInfo : public QGst::MiniObject
{
    QGST_WRAPPER(DiscovererInfo)

public:
    QUrl uri() const;
    DiscovererResult result() const;

    ClockTime duration() const;
    bool seekable() const;
    Structure misc() const;
    TagList tags() const;

    DiscovererStreamInfoPtr streamInfo() const;
    QList<DiscovererStreamInfoPtr> streams() const;
    QList<DiscovererStreamInfoPtr> streams(QGlib::Type streamType) const;
    QList<DiscovererStreamInfoPtr> audioStreams() const;
    QList<DiscovererStreamInfoPtr> videoStreams() const;
    QList<DiscovererStreamInfoPtr> subtitleStreams() const;
    QList<DiscovererStreamInfoPtr> containerStreams() const;
};

class QTGSTREAMER_EXPORT Discoverer : public QGlib::Object
{
    QGST_WRAPPER(Discoverer)

public:
    /*! Creates a new discoverer with the provided timeout.
     * \throws QGlib::Error when there was a problem creating the discoverer
     */
    static DiscovererPtr create(ClockTime timeout);

    /*! Allow asynchronous discovering of URIs to take place.
     * \note A GLib event loop must be available for QGst::Discoverer to work
     * properly in asynchronous mode. This feature might not be available on all
     * platforms supported by Qt.
     * \ingroup async
     */
    void start();
{'fraction_non_alphanumeric': 0.07666214382632293, 'fraction_numerical': 0.0016282225237449117, 'mean_word_length': 4.201834862385321, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5275745', 'n_tokens_mistral': 2304, 'n_tokens_neox': 2233, 'n_words': 703}