/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.6.2
 *
 * Copyright (c) 2022 Riverbank Computing Limited <info@riverbankcomputing.com>
 * 
 * This file is part of PyQt5.
 * 
 * This file may be used under the terms of the GNU General Public License
 * version 3.0 as published by the Free Software Foundation and appearing in
 * the file LICENSE included in the packaging of this file.  Please review the
 * following information to ensure the GNU General Public License version 3.0
 * requirements will be met: http://www.gnu.org/copyleft/gpl.html.
 * 
 * If you do not wish to use this file under the terms of the GPL version 3.0
 * then you may purchase a commercial license.  For more information contact
 * info@riverbankcomputing.com.
 * 
 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */

#include "sipAPIQtMultimedia.h"

#line 28 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtMultimedia/qabstractvideofilter.sip"
#include <qabstractvideofilter.h>
#line 29 "/build/pyqt5/src/PyQt5-5.15.7/build/QtMultimedia/sipQtMultimediaQVideoFilterRunnable.cpp"

#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtMultimedia/qvideoframe.sip"
#include <qvideoframe.h>
#line 33 "/build/pyqt5/src/PyQt5-5.15.7/build/QtMultimedia/sipQtMultimediaQVideoFilterRunnable.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtMultimedia/qvideosurfaceformat.sip"
#include <qvideosurfaceformat.h>
#line 36 "/build/pyqt5/src/PyQt5-5.15.7/build/QtMultimedia/sipQtMultimediaQVideoFilterRunnable.cpp"
#line 28 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtMultimedia/qabstractvideofilter.sip"
#include <qabstractvideofilter.h>
#line 39 "/build/pyqt5/src/PyQt5-5.15.7/build/QtMultimedia/sipQtMultimediaQVideoFilterRunnable.cpp"


class sipQVideoFilterRunnable : public  ::QVideoFilterRunnable
{
public:
    sipQVideoFilterRunnable();
    sipQVideoFilterRunnable(const  ::QVideoFilterRunnable&);
    virtual ~sipQVideoFilterRunnable();

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
     ::QVideoFrame run( ::QVideoFrame*,const  ::QVideoSurfaceFormat&, ::QVideoFilterRunnable::RunFlags) SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

private:
    sipQVideoFilterRunnable(const sipQVideoFilterRunnable &);
    sipQVideoFilterRunnable &operator = (const sipQVideoFilterRunnable &);

    char sipPyMethods[1];
};

sipQVideoFilterRunnable::sipQVideoFilterRunnable():  ::QVideoFilterRunnable(), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

sipQVideoFilterRunnable::sipQVideoFilterRunnable(const  ::QVideoFilterRunnable& a0):  ::QVideoFilterRunnable(a0), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

sipQVideoFilterRunnable::~sipQVideoFilterRunnable()
{
    sipInstanceDestroyedEx(&sipPySelf);
}

 ::QVideoFrame sipQVideoFilterRunnable::run( ::QVideoFrame*a0,const  ::QVideoSurfaceFormat& a1, ::QVideoFilterRunnable::RunFlags a2)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[0], &sipPySelf, sipName_QVideoFilterRunnable, sipName_run);

    if (!sipMeth)
        return  ::QVideoFrame();

    extern  ::QVideoFrame sipVH_QtMultimedia_4(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::QVideoFrame*,const  ::QVideoSurfaceFormat&, ::QVideoFilterRunnable::RunFlags);

    return sipVH_QtMultimedia_4(sipGILState, sipImportedVirtErrorHandlers_QtMultimedia_QtCore[0].iveh_handler, sipPySelf, sipMeth, a0, a1, a2);
}


PyDoc_STRVAR(doc_QVideoFilterRunnable_run, "run(self, QVideoFrame, QVideoSurfaceFormat, Union[QVideoFilterRunnable.RunFlags, QVideoFilterRunnable.RunFlag]) -> QVideoFrame");

extern "C" {static PyObject *meth_QVideoFilterRunnable_run(PyObject *, PyObject *);}
static PyObject *meth_QVideoFilterRunnable_run(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    PyObject *sipOrigSelf = sipSelf;

    {
         ::QVideoFrame* a0;
        const  ::QVideoSurfaceFormat* a1;
         ::QVideoFilterRunnable::RunFlags* a2;
        int a2State = 0;
         ::QVideoFilterRunnable *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ8J9J1", &sipSelf, sipType_QVideoFilterRunnable, &sipCpp, sipType_QVideoFrame, &a0, sipType_QVideoSurfaceFormat, &a1, sipType_QVideoFilterRunnable_RunFlags, &a2, &a2State))
        {
             ::QVideoFrame*sipRes;

            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_QVideoFilterRunnable, sipName_run);
                return SIP_NULLPTR;
            }

            Py_BEGIN_ALLOW_THREADS
            sipRes = new  ::QVideoFrame(sipCpp->run(a0,*a1,*a2));
            Py_END_ALLOW_THREADS
            sipReleaseType(a2, sipType_QVideoFilterRunnable_RunFlags, a2State);

            return sipConvertFromNewType(sipRes,sipType_QVideoFrame,SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_QVideoFilterRunnable, sipName_run, doc_QVideoFilterRunnable_run);

    return SIP_NULLPTR;
}


/* Call the instance's destructor. */
extern "C" {static void release_QVideoFilterRunnable(void *, int);}
static void release_QVideoFilterRunnable(void *sipCppV, int sipState)
{
    Py_BEGIN_ALLOW_THREADS

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipQVideoFilterRunnable *>(sipCppV);
    else
        delete reinterpret_cast< ::QVideoFilterRunnable *>(sipCppV);

    Py_END_ALLOW_THREADS
}


extern "C" {static void dealloc_QVideoFilterRunnable(sipSimpleWrapper *);}
static void dealloc_QVideoFilterRunnable(sipSimpleWrapper *sipSelf)
{
    if (sipIsDerivedClass(sipSelf))
        reinterpret_cast<sipQVideoFilterRunnable *>(sipGetAddress(sipSelf))->sipPySelf = SIP_NULLPTR;

    if (sipIsOwnedByPython(sipSelf))
    {
        release_QVideoFilterRunnable(sipGetAddress(sipSelf), sipIsDerivedClass(sipSelf));
    }
}


extern "C" {static void *init_type_QVideoFilterRunnable(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_type_QVideoFilterRunnable(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
{
    sipQVideoFilterRunnable *sipCpp = SIP_NULLPTR;

    {
        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, ""))
        {
            sipCpp = new sipQVideoFilterRunnable();

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const  ::QVideoFilterRunnable* a0;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "J9", sipType_QVideoFilterRunnable, &a0))
        {
            sipCpp = new sipQVideoFilterRunnable(*a0);

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


static PyMethodDef methods_QVideoFilterRunnable[] = {
    {sipName_run, meth_QVideoFilterRunnable_run, METH_VARARGS, doc_QVideoFilterRunnable_run}
};

static sipEnumMemberDef enummembers_QVideoFilterRunnable[] = {
    {sipName_LastInChain, static_cast<int>( ::QVideoFilterRunnable::LastInChain), 159},
};

PyDoc_STRVAR(doc_QVideoFilterRunnable, "\1QVideoFilterRunnable()\n"
"QVideoFilterRunnable(QVideoFilterRunnable)");


static pyqt5ClassPluginDef plugin_QVideoFilterRunnable = {
    SIP_NULLPTR,
    0,
    SIP_NULLPTR,
    SIP_NULLPTR
};


sipClassTypeDef sipTypeDef_QtMultimedia_QVideoFilterRunnable = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_ABSTRACT|SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QVideoFilterRunnable,
        SIP_NULLPTR,
        &plugin_QVideoFilterRunnable
    },
    {
        sipNameNr_QVideoFilterRunnable,
        {0, 0, 1},
        1, methods_QVideoFilterRunnable,
        1, enummembers_QVideoFilterRunnable,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_QVideoFilterRunnable,
    -1,
    sipNameNr_sip_simplewrapper,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_QVideoFilterRunnable,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QVideoFilterRunnable,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_QVideoFilterRunnable,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof ( ::QVideoFilterRunnable),
};
