// WARNING: Please don't edit this file. It was generated by Python/WinRT v1.0.0-beta.9

#include "pybase.h"
#include "py.Windows.Media.Capture.Frames.h"


namespace py::cpp::Windows::Media::Capture::Frames
{
    struct module_state
    {
        PyObject* type_MediaFrameReaderAcquisitionMode;
        PyObject* type_MediaFrameReaderStartStatus;
        PyObject* type_MediaFrameSourceGetPropertyStatus;
        PyObject* type_MediaFrameSourceKind;
        PyObject* type_MediaFrameSourceSetPropertyStatus;
        PyObject* type_MultiSourceMediaFrameReaderStartStatus;
        PyTypeObject* type_AudioMediaFrame;
        PyTypeObject* type_BufferMediaFrame;
        PyTypeObject* type_DepthMediaFrame;
        PyTypeObject* type_DepthMediaFrameFormat;
        PyTypeObject* type_InfraredMediaFrame;
        PyTypeObject* type_MediaFrameArrivedEventArgs;
        PyTypeObject* type_MediaFrameFormat;
        PyTypeObject* type_MediaFrameReader;
        PyTypeObject* type_MediaFrameReference;
        PyTypeObject* type_MediaFrameSource;
        PyTypeObject* type_MediaFrameSourceController;
        PyTypeObject* type_MediaFrameSourceGetPropertyResult;
        PyTypeObject* type_MediaFrameSourceGroup;
        PyTypeObject* type_MediaFrameSourceInfo;
        PyTypeObject* type_MultiSourceMediaFrameArrivedEventArgs;
        PyTypeObject* type_MultiSourceMediaFrameReader;
        PyTypeObject* type_MultiSourceMediaFrameReference;
        PyTypeObject* type_VideoMediaFrame;
        PyTypeObject* type_VideoMediaFrameFormat;
    };

    static PyObject* register_MediaFrameReaderAcquisitionMode(PyObject* module, PyObject* type) noexcept
    {
        auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
        assert(state);

        if (state->type_MediaFrameReaderAcquisitionMode)
        {
            PyErr_SetString(PyExc_RuntimeError, "type has already been registered");
            return nullptr;
        }

        if (!PyType_Check(type))
        {
            PyErr_SetString(PyExc_TypeError, "argument is not a type");
            return nullptr;
        }

        state->type_MediaFrameReaderAcquisitionMode = type;
        Py_INCREF(state->type_MediaFrameReaderAcquisitionMode);


        Py_RETURN_NONE;
    }

    static PyObject* register_MediaFrameReaderStartStatus(PyObject* module, PyObject* type) noexcept
    {
        auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
        assert(state);

        if (state->type_MediaFrameReaderStartStatus)
        {
            PyErr_SetString(PyExc_RuntimeError, "type has already been registered");
            return nullptr;
        }

        if (!PyType_Check(type))
        {
            PyErr_SetString(PyExc_TypeError, "argument is not a type");
            return nullptr;
        }

        state->type_MediaFrameReaderStartStatus = type;
        Py_INCREF(state->type_MediaFrameReaderStartStatus);


        Py_RETURN_NONE;
    }

    static PyObject* register_MediaFrameSourceGetPropertyStatus(PyObject* module, PyObject* type) noexcept
    {
        auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
        assert(state);

        if (state->type_MediaFrameSourceGetPropertyStatus)
        {
            PyErr_SetString(PyExc_RuntimeError, "type has already been registered");
            return nullptr;
        }

        if (!PyType_Check(type))
        {
            PyErr_SetString(PyExc_TypeError, "argument is not a type");
            return nullptr;
        }

        state->type_MediaFrameSourceGetPropertyStatus = type;
        Py_INCREF(state->type_MediaFrameSourceGetPropertyStatus);


        Py_RETURN_NONE;
    }

    static PyObject* register_MediaFrameSourceKind(PyObject* module, PyObject* type) noexcept
    {
        auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
        assert(state);

        if (state->type_MediaFrameSourceKind)
        {
            PyErr_SetString(PyExc_RuntimeError, "type has already been registered");
            return nullptr;
        }

        if (!PyType_Check(type))
        {
            PyErr_SetString(PyExc_TypeError, "argument is not a type");
            return nullptr;
        }

        state->type_MediaFrameSourceKind = type;
        Py_INCREF(state->type_MediaFrameSourceKind);


        Py_RETURN_NONE;
    }

    static PyObject* register_MediaFrameSourceSetPropertyStatus(PyObject* module, PyObject* type) noexcept
    {
        auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
        assert(state);

        if (state->type_MediaFrameSourceSetPropertyStatus)
        {
            PyErr_SetString(PyExc_RuntimeError, "type has already been registered");
            return nullptr;
        }

        if (!PyType_Check(type))
        {
            PyErr_SetString(PyExc_TypeError, "argument is not a type");
            return nullptr;
        }

        state->type_MediaFrameSourceSetPropertyStatus = type;
        Py_INCREF(state->type_MediaFrameSourceSetPropertyStatus);


        Py_RETURN_NONE;
    }

    static PyObject* register_MultiSourceMediaFrameReaderStartStatus(PyObject* module, PyObject* type) noexcept
    {
        auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
        assert(state);

        if (state->type_MultiSourceMediaFrameReaderStartStatus)
        {
            PyErr_SetString(PyExc_RuntimeError, "type has already been registered");
            return nullptr;
        }

        if (!PyType_Check(type))
        {
            PyErr_SetString(PyExc_TypeError, "argument is not a type");
            return nullptr;
        }

        state->type_MultiSourceMediaFrameReaderStartStatus = type;
        Py_INCREF(state->type_MultiSourceMediaFrameReaderStartStatus);


        Py_RETURN_NONE;
    }

    // ----- AudioMediaFrame class --------------------
    static constexpr const char* const type_name_AudioMediaFrame = "AudioMediaFrame";

    static PyObject* _new_AudioMediaFrame(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_AudioMediaFrame);
        return nullptr;
    }

    static void _dealloc_AudioMediaFrame(py::wrapper::Windows::Media::Capture::Frames::AudioMediaFrame* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* AudioMediaFrame_GetAudioFrame(py::wrapper::Windows::Media::Capture::Frames::AudioMediaFrame* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.Capture.Frames.AudioMediaFrame", L"GetAudioFrame", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(self->obj.GetAudioFrame());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* AudioMediaFrame_get_AudioEncodingProperties(py::wrapper::Windows::Media::Capture::Frames::AudioMediaFrame* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.AudioMediaFrame", L"AudioEncodingProperties"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.AudioEncodingProperties());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* AudioMediaFrame_get_FrameReference(py::wrapper::Windows::Media::Capture::Frames::AudioMediaFrame* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.AudioMediaFrame", L"FrameReference"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.FrameReference());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _assign_array_AudioMediaFrame(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Media::Capture::Frames::AudioMediaFrame>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_AudioMediaFrame(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Media::Capture::Frames::AudioMediaFrame>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_AudioMediaFrame[] = {
        { "get_audio_frame", reinterpret_cast<PyCFunction>(AudioMediaFrame_GetAudioFrame), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_AudioMediaFrame, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_AudioMediaFrame), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_AudioMediaFrame[] = {
        { "audio_encoding_properties", reinterpret_cast<getter>(AudioMediaFrame_get_AudioEncodingProperties), nullptr, nullptr, nullptr },
        { "frame_reference", reinterpret_cast<getter>(AudioMediaFrame_get_FrameReference), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_AudioMediaFrame[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_AudioMediaFrame) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_AudioMediaFrame) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_AudioMediaFrame) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_AudioMediaFrame) },
        { },
    };

    static PyType_Spec type_spec_AudioMediaFrame =
    {
        "_winsdk_Windows_Media_Capture_Frames.AudioMediaFrame",
        sizeof(py::wrapper::Windows::Media::Capture::Frames::AudioMediaFrame),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_AudioMediaFrame
    };

    // ----- BufferMediaFrame class --------------------
    static constexpr const char* const type_name_BufferMediaFrame = "BufferMediaFrame";

    static PyObject* _new_BufferMediaFrame(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_BufferMediaFrame);
        return nullptr;
    }

    static void _dealloc_BufferMediaFrame(py::wrapper::Windows::Media::Capture::Frames::BufferMediaFrame* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* BufferMediaFrame_get_Buffer(py::wrapper::Windows::Media::Capture::Frames::BufferMediaFrame* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.BufferMediaFrame", L"Buffer"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.Buffer());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* BufferMediaFrame_get_FrameReference(py::wrapper::Windows::Media::Capture::Frames::BufferMediaFrame* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.BufferMediaFrame", L"FrameReference"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.FrameReference());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _assign_array_BufferMediaFrame(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Media::Capture::Frames::BufferMediaFrame>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_BufferMediaFrame(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Media::Capture::Frames::BufferMediaFrame>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_BufferMediaFrame[] = {
        { "_assign_array_", _assign_array_BufferMediaFrame, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_BufferMediaFrame), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_BufferMediaFrame[] = {
        { "buffer", reinterpret_cast<getter>(BufferMediaFrame_get_Buffer), nullptr, nullptr, nullptr },
        { "frame_reference", reinterpret_cast<getter>(BufferMediaFrame_get_FrameReference), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_BufferMediaFrame[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_BufferMediaFrame) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_BufferMediaFrame) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_BufferMediaFrame) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_BufferMediaFrame) },
        { },
    };

    static PyType_Spec type_spec_BufferMediaFrame =
    {
        "_winsdk_Windows_Media_Capture_Frames.BufferMediaFrame",
        sizeof(py::wrapper::Windows::Media::Capture::Frames::BufferMediaFrame),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_BufferMediaFrame
    };

    // ----- DepthMediaFrame class --------------------
    static constexpr const char* const type_name_DepthMediaFrame = "DepthMediaFrame";

    static PyObject* _new_DepthMediaFrame(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_DepthMediaFrame);
        return nullptr;
    }

    static void _dealloc_DepthMediaFrame(py::wrapper::Windows::Media::Capture::Frames::DepthMediaFrame* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* DepthMediaFrame_TryCreateCoordinateMapper(py::wrapper::Windows::Media::Capture::Frames::DepthMediaFrame* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 2)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.Capture.Frames.DepthMediaFrame", L"TryCreateCoordinateMapper", 2))
            {
                py::set_arg_count_version_error(2);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Media::Devices::Core::CameraIntrinsics>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Perception::Spatial::SpatialCoordinateSystem>(args, 1);

                return py::convert(self->obj.TryCreateCoordinateMapper(param0, param1));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* DepthMediaFrame_get_DepthFormat(py::wrapper::Windows::Media::Capture::Frames::DepthMediaFrame* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.DepthMediaFrame", L"DepthFormat"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.DepthFormat());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DepthMediaFrame_get_FrameReference(py::wrapper::Windows::Media::Capture::Frames::DepthMediaFrame* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.DepthMediaFrame", L"FrameReference"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.FrameReference());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DepthMediaFrame_get_VideoMediaFrame(py::wrapper::Windows::Media::Capture::Frames::DepthMediaFrame* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.DepthMediaFrame", L"VideoMediaFrame"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.VideoMediaFrame());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DepthMediaFrame_get_MaxReliableDepth(py::wrapper::Windows::Media::Capture::Frames::DepthMediaFrame* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.DepthMediaFrame", L"MaxReliableDepth"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.MaxReliableDepth());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DepthMediaFrame_get_MinReliableDepth(py::wrapper::Windows::Media::Capture::Frames::DepthMediaFrame* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.DepthMediaFrame", L"MinReliableDepth"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.MinReliableDepth());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _assign_array_DepthMediaFrame(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Media::Capture::Frames::DepthMediaFrame>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_DepthMediaFrame(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Media::Capture::Frames::DepthMediaFrame>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_DepthMediaFrame[] = {
        { "try_create_coordinate_mapper", reinterpret_cast<PyCFunction>(DepthMediaFrame_TryCreateCoordinateMapper), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_DepthMediaFrame, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_DepthMediaFrame), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_DepthMediaFrame[] = {
        { "depth_format", reinterpret_cast<getter>(DepthMediaFrame_get_DepthFormat), nullptr, nullptr, nullptr },
        { "frame_reference", reinterpret_cast<getter>(DepthMediaFrame_get_FrameReference), nullptr, nullptr, nullptr },
        { "video_media_frame", reinterpret_cast<getter>(DepthMediaFrame_get_VideoMediaFrame), nullptr, nullptr, nullptr },
        { "max_reliable_depth", reinterpret_cast<getter>(DepthMediaFrame_get_MaxReliableDepth), nullptr, nullptr, nullptr },
        { "min_reliable_depth", reinterpret_cast<getter>(DepthMediaFrame_get_MinReliableDepth), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_DepthMediaFrame[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_DepthMediaFrame) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_DepthMediaFrame) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_DepthMediaFrame) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_DepthMediaFrame) },
        { },
    };

    static PyType_Spec type_spec_DepthMediaFrame =
    {
        "_winsdk_Windows_Media_Capture_Frames.DepthMediaFrame",
        sizeof(py::wrapper::Windows::Media::Capture::Frames::DepthMediaFrame),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_DepthMediaFrame
    };

    // ----- DepthMediaFrameFormat class --------------------
    static constexpr const char* const type_name_DepthMediaFrameFormat = "DepthMediaFrameFormat";

    static PyObject* _new_DepthMediaFrameFormat(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_DepthMediaFrameFormat);
        return nullptr;
    }

    static void _dealloc_DepthMediaFrameFormat(py::wrapper::Windows::Media::Capture::Frames::DepthMediaFrameFormat* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* DepthMediaFrameFormat_get_DepthScaleInMeters(py::wrapper::Windows::Media::Capture::Frames::DepthMediaFrameFormat* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.DepthMediaFrameFormat", L"DepthScaleInMeters"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.DepthScaleInMeters());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DepthMediaFrameFormat_get_VideoFormat(py::wrapper::Windows::Media::Capture::Frames::DepthMediaFrameFormat* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.DepthMediaFrameFormat", L"VideoFormat"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.VideoFormat());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _assign_array_DepthMediaFrameFormat(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Media::Capture::Frames::DepthMediaFrameFormat>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_DepthMediaFrameFormat(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Media::Capture::Frames::DepthMediaFrameFormat>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_DepthMediaFrameFormat[] = {
        { "_assign_array_", _assign_array_DepthMediaFrameFormat, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_DepthMediaFrameFormat), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_DepthMediaFrameFormat[] = {
        { "depth_scale_in_meters", reinterpret_cast<getter>(DepthMediaFrameFormat_get_DepthScaleInMeters), nullptr, nullptr, nullptr },
        { "video_format", reinterpret_cast<getter>(DepthMediaFrameFormat_get_VideoFormat), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_DepthMediaFrameFormat[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_DepthMediaFrameFormat) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_DepthMediaFrameFormat) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_DepthMediaFrameFormat) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_DepthMediaFrameFormat) },
        { },
    };

    static PyType_Spec type_spec_DepthMediaFrameFormat =
    {
        "_winsdk_Windows_Media_Capture_Frames.DepthMediaFrameFormat",
        sizeof(py::wrapper::Windows::Media::Capture::Frames::DepthMediaFrameFormat),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_DepthMediaFrameFormat
    };

    // ----- InfraredMediaFrame class --------------------
    static constexpr const char* const type_name_InfraredMediaFrame = "InfraredMediaFrame";

    static PyObject* _new_InfraredMediaFrame(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_InfraredMediaFrame);
        return nullptr;
    }

    static void _dealloc_InfraredMediaFrame(py::wrapper::Windows::Media::Capture::Frames::InfraredMediaFrame* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* InfraredMediaFrame_get_FrameReference(py::wrapper::Windows::Media::Capture::Frames::InfraredMediaFrame* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.InfraredMediaFrame", L"FrameReference"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.FrameReference());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* InfraredMediaFrame_get_IsIlluminated(py::wrapper::Windows::Media::Capture::Frames::InfraredMediaFrame* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.InfraredMediaFrame", L"IsIlluminated"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.IsIlluminated());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* InfraredMediaFrame_get_VideoMediaFrame(py::wrapper::Windows::Media::Capture::Frames::InfraredMediaFrame* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.InfraredMediaFrame", L"VideoMediaFrame"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.VideoMediaFrame());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _assign_array_InfraredMediaFrame(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Media::Capture::Frames::InfraredMediaFrame>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_InfraredMediaFrame(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Media::Capture::Frames::InfraredMediaFrame>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_InfraredMediaFrame[] = {
        { "_assign_array_", _assign_array_InfraredMediaFrame, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_InfraredMediaFrame), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_InfraredMediaFrame[] = {
        { "frame_reference", reinterpret_cast<getter>(InfraredMediaFrame_get_FrameReference), nullptr, nullptr, nullptr },
        { "is_illuminated", reinterpret_cast<getter>(InfraredMediaFrame_get_IsIlluminated), nullptr, nullptr, nullptr },
        { "video_media_frame", reinterpret_cast<getter>(InfraredMediaFrame_get_VideoMediaFrame), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_InfraredMediaFrame[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_InfraredMediaFrame) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_InfraredMediaFrame) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_InfraredMediaFrame) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_InfraredMediaFrame) },
        { },
    };

    static PyType_Spec type_spec_InfraredMediaFrame =
    {
        "_winsdk_Windows_Media_Capture_Frames.InfraredMediaFrame",
        sizeof(py::wrapper::Windows::Media::Capture::Frames::InfraredMediaFrame),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_InfraredMediaFrame
    };

    // ----- MediaFrameArrivedEventArgs class --------------------
    static constexpr const char* const type_name_MediaFrameArrivedEventArgs = "MediaFrameArrivedEventArgs";

    static PyObject* _new_MediaFrameArrivedEventArgs(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_MediaFrameArrivedEventArgs);
        return nullptr;
    }

    static void _dealloc_MediaFrameArrivedEventArgs(py::wrapper::Windows::Media::Capture::Frames::MediaFrameArrivedEventArgs* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* _assign_array_MediaFrameArrivedEventArgs(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Media::Capture::Frames::MediaFrameArrivedEventArgs>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_MediaFrameArrivedEventArgs(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Media::Capture::Frames::MediaFrameArrivedEventArgs>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_MediaFrameArrivedEventArgs[] = {
        { "_assign_array_", _assign_array_MediaFrameArrivedEventArgs, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_MediaFrameArrivedEventArgs), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_MediaFrameArrivedEventArgs[] = {
        { }
    };

    static PyType_Slot _type_slots_MediaFrameArrivedEventArgs[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_MediaFrameArrivedEventArgs) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_MediaFrameArrivedEventArgs) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_MediaFrameArrivedEventArgs) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_MediaFrameArrivedEventArgs) },
        { },
    };

    static PyType_Spec type_spec_MediaFrameArrivedEventArgs =
    {
        "_winsdk_Windows_Media_Capture_Frames.MediaFrameArrivedEventArgs",
        sizeof(py::wrapper::Windows::Media::Capture::Frames::MediaFrameArrivedEventArgs),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_MediaFrameArrivedEventArgs
    };

    // ----- MediaFrameFormat class --------------------
    static constexpr const char* const type_name_MediaFrameFormat = "MediaFrameFormat";

    static PyObject* _new_MediaFrameFormat(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_MediaFrameFormat);
        return nullptr;
    }

    static void _dealloc_MediaFrameFormat(py::wrapper::Windows::Media::Capture::Frames::MediaFrameFormat* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* MediaFrameFormat_get_FrameRate(py::wrapper::Windows::Media::Capture::Frames::MediaFrameFormat* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameFormat", L"FrameRate"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.FrameRate());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaFrameFormat_get_MajorType(py::wrapper::Windows::Media::Capture::Frames::MediaFrameFormat* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameFormat", L"MajorType"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.MajorType());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaFrameFormat_get_Properties(py::wrapper::Windows::Media::Capture::Frames::MediaFrameFormat* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameFormat", L"Properties"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.Properties());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaFrameFormat_get_Subtype(py::wrapper::Windows::Media::Capture::Frames::MediaFrameFormat* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameFormat", L"Subtype"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.Subtype());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaFrameFormat_get_VideoFormat(py::wrapper::Windows::Media::Capture::Frames::MediaFrameFormat* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameFormat", L"VideoFormat"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.VideoFormat());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaFrameFormat_get_AudioEncodingProperties(py::wrapper::Windows::Media::Capture::Frames::MediaFrameFormat* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameFormat", L"AudioEncodingProperties"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.AudioEncodingProperties());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _assign_array_MediaFrameFormat(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Media::Capture::Frames::MediaFrameFormat>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_MediaFrameFormat(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Media::Capture::Frames::MediaFrameFormat>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_MediaFrameFormat[] = {
        { "_assign_array_", _assign_array_MediaFrameFormat, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_MediaFrameFormat), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_MediaFrameFormat[] = {
        { "frame_rate", reinterpret_cast<getter>(MediaFrameFormat_get_FrameRate), nullptr, nullptr, nullptr },
        { "major_type", reinterpret_cast<getter>(MediaFrameFormat_get_MajorType), nullptr, nullptr, nullptr },
        { "properties", reinterpret_cast<getter>(MediaFrameFormat_get_Properties), nullptr, nullptr, nullptr },
        { "subtype", reinterpret_cast<getter>(MediaFrameFormat_get_Subtype), nullptr, nullptr, nullptr },
        { "video_format", reinterpret_cast<getter>(MediaFrameFormat_get_VideoFormat), nullptr, nullptr, nullptr },
        { "audio_encoding_properties", reinterpret_cast<getter>(MediaFrameFormat_get_AudioEncodingProperties), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_MediaFrameFormat[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_MediaFrameFormat) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_MediaFrameFormat) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_MediaFrameFormat) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_MediaFrameFormat) },
        { },
    };

    static PyType_Spec type_spec_MediaFrameFormat =
    {
        "_winsdk_Windows_Media_Capture_Frames.MediaFrameFormat",
        sizeof(py::wrapper::Windows::Media::Capture::Frames::MediaFrameFormat),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_MediaFrameFormat
    };

    // ----- MediaFrameReader class --------------------
    static constexpr const char* const type_name_MediaFrameReader = "MediaFrameReader";

    static PyObject* _new_MediaFrameReader(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_MediaFrameReader);
        return nullptr;
    }

    static void _dealloc_MediaFrameReader(py::wrapper::Windows::Media::Capture::Frames::MediaFrameReader* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* MediaFrameReader_Close(py::wrapper::Windows::Media::Capture::Frames::MediaFrameReader* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.Capture.Frames.MediaFrameReader", L"Close", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                self->obj.Close();
                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MediaFrameReader_StartAsync(py::wrapper::Windows::Media::Capture::Frames::MediaFrameReader* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.Capture.Frames.MediaFrameReader", L"StartAsync", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(self->obj.StartAsync());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MediaFrameReader_StopAsync(py::wrapper::Windows::Media::Capture::Frames::MediaFrameReader* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.Capture.Frames.MediaFrameReader", L"StopAsync", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(self->obj.StopAsync());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MediaFrameReader_TryAcquireLatestFrame(py::wrapper::Windows::Media::Capture::Frames::MediaFrameReader* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.Capture.Frames.MediaFrameReader", L"TryAcquireLatestFrame", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(self->obj.TryAcquireLatestFrame());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MediaFrameReader_get_AcquisitionMode(py::wrapper::Windows::Media::Capture::Frames::MediaFrameReader* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameReader", L"AcquisitionMode"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.AcquisitionMode());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int MediaFrameReader_put_AcquisitionMode(py::wrapper::Windows::Media::Capture::Frames::MediaFrameReader* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameReader", L"AcquisitionMode"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return -1;
        }

        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Media::Capture::Frames::MediaFrameReaderAcquisitionMode>(arg);

            self->obj.AcquisitionMode(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* MediaFrameReader_add_FrameArrived(py::wrapper::Windows::Media::Capture::Frames::MediaFrameReader* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Media.Capture.Frames.MediaFrameReader", L"FrameArrived"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Media::Capture::Frames::MediaFrameReader, winrt::Windows::Media::Capture::Frames::MediaFrameArrivedEventArgs>>(arg);

            return py::convert(self->obj.FrameArrived(param0));
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaFrameReader_remove_FrameArrived(py::wrapper::Windows::Media::Capture::Frames::MediaFrameReader* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Media.Capture.Frames.MediaFrameReader", L"FrameArrived"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            auto param0 = py::convert_to<winrt::event_token>(arg);

            self->obj.FrameArrived(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _assign_array_MediaFrameReader(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Media::Capture::Frames::MediaFrameReader>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_MediaFrameReader(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Media::Capture::Frames::MediaFrameReader>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _enter_MediaFrameReader(py::wrapper::Windows::Media::Capture::Frames::MediaFrameReader* self) noexcept
    {
        Py_INCREF(self);
        return reinterpret_cast<PyObject*>(self);
    }

    static PyObject* _exit_MediaFrameReader(py::wrapper::Windows::Media::Capture::Frames::MediaFrameReader* self) noexcept
    {
        try
        {
            self->obj.Close();
            Py_RETURN_FALSE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_MediaFrameReader[] = {
        { "close", reinterpret_cast<PyCFunction>(MediaFrameReader_Close), METH_VARARGS, nullptr },
        { "start_async", reinterpret_cast<PyCFunction>(MediaFrameReader_StartAsync), METH_VARARGS, nullptr },
        { "stop_async", reinterpret_cast<PyCFunction>(MediaFrameReader_StopAsync), METH_VARARGS, nullptr },
        { "try_acquire_latest_frame", reinterpret_cast<PyCFunction>(MediaFrameReader_TryAcquireLatestFrame), METH_VARARGS, nullptr },
        { "add_frame_arrived", reinterpret_cast<PyCFunction>(MediaFrameReader_add_FrameArrived), METH_O, nullptr },
        { "remove_frame_arrived", reinterpret_cast<PyCFunction>(MediaFrameReader_remove_FrameArrived), METH_O, nullptr },
        { "_assign_array_", _assign_array_MediaFrameReader, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_MediaFrameReader), METH_O | METH_STATIC, nullptr },
        { "__enter__", reinterpret_cast<PyCFunction>(_enter_MediaFrameReader), METH_NOARGS, nullptr },
        { "__exit__",  reinterpret_cast<PyCFunction>(_exit_MediaFrameReader), METH_VARARGS, nullptr },
        { }
    };

    static PyGetSetDef _getset_MediaFrameReader[] = {
        { "acquisition_mode", reinterpret_cast<getter>(MediaFrameReader_get_AcquisitionMode), reinterpret_cast<setter>(MediaFrameReader_put_AcquisitionMode), nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_MediaFrameReader[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_MediaFrameReader) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_MediaFrameReader) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_MediaFrameReader) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_MediaFrameReader) },
        { },
    };

    static PyType_Spec type_spec_MediaFrameReader =
    {
        "_winsdk_Windows_Media_Capture_Frames.MediaFrameReader",
        sizeof(py::wrapper::Windows::Media::Capture::Frames::MediaFrameReader),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_MediaFrameReader
    };

    // ----- MediaFrameReference class --------------------
    static constexpr const char* const type_name_MediaFrameReference = "MediaFrameReference";

    static PyObject* _new_MediaFrameReference(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_MediaFrameReference);
        return nullptr;
    }

    static void _dealloc_MediaFrameReference(py::wrapper::Windows::Media::Capture::Frames::MediaFrameReference* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* MediaFrameReference_Close(py::wrapper::Windows::Media::Capture::Frames::MediaFrameReference* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.Capture.Frames.MediaFrameReference", L"Close", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                self->obj.Close();
                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MediaFrameReference_get_BufferMediaFrame(py::wrapper::Windows::Media::Capture::Frames::MediaFrameReference* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameReference", L"BufferMediaFrame"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.BufferMediaFrame());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaFrameReference_get_CoordinateSystem(py::wrapper::Windows::Media::Capture::Frames::MediaFrameReference* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameReference", L"CoordinateSystem"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.CoordinateSystem());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaFrameReference_get_Duration(py::wrapper::Windows::Media::Capture::Frames::MediaFrameReference* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameReference", L"Duration"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.Duration());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaFrameReference_get_Format(py::wrapper::Windows::Media::Capture::Frames::MediaFrameReference* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameReference", L"Format"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.Format());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaFrameReference_get_Properties(py::wrapper::Windows::Media::Capture::Frames::MediaFrameReference* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameReference", L"Properties"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.Properties());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaFrameReference_get_SourceKind(py::wrapper::Windows::Media::Capture::Frames::MediaFrameReference* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameReference", L"SourceKind"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.SourceKind());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaFrameReference_get_SystemRelativeTime(py::wrapper::Windows::Media::Capture::Frames::MediaFrameReference* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameReference", L"SystemRelativeTime"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.SystemRelativeTime());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaFrameReference_get_VideoMediaFrame(py::wrapper::Windows::Media::Capture::Frames::MediaFrameReference* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameReference", L"VideoMediaFrame"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.VideoMediaFrame());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaFrameReference_get_AudioMediaFrame(py::wrapper::Windows::Media::Capture::Frames::MediaFrameReference* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameReference", L"AudioMediaFrame"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.AudioMediaFrame());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _assign_array_MediaFrameReference(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Media::Capture::Frames::MediaFrameReference>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_MediaFrameReference(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Media::Capture::Frames::MediaFrameReference>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _enter_MediaFrameReference(py::wrapper::Windows::Media::Capture::Frames::MediaFrameReference* self) noexcept
    {
        Py_INCREF(self);
        return reinterpret_cast<PyObject*>(self);
    }

    static PyObject* _exit_MediaFrameReference(py::wrapper::Windows::Media::Capture::Frames::MediaFrameReference* self) noexcept
    {
        try
        {
            self->obj.Close();
            Py_RETURN_FALSE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_MediaFrameReference[] = {
        { "close", reinterpret_cast<PyCFunction>(MediaFrameReference_Close), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_MediaFrameReference, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_MediaFrameReference), METH_O | METH_STATIC, nullptr },
        { "__enter__", reinterpret_cast<PyCFunction>(_enter_MediaFrameReference), METH_NOARGS, nullptr },
        { "__exit__",  reinterpret_cast<PyCFunction>(_exit_MediaFrameReference), METH_VARARGS, nullptr },
        { }
    };

    static PyGetSetDef _getset_MediaFrameReference[] = {
        { "buffer_media_frame", reinterpret_cast<getter>(MediaFrameReference_get_BufferMediaFrame), nullptr, nullptr, nullptr },
        { "coordinate_system", reinterpret_cast<getter>(MediaFrameReference_get_CoordinateSystem), nullptr, nullptr, nullptr },
        { "duration", reinterpret_cast<getter>(MediaFrameReference_get_Duration), nullptr, nullptr, nullptr },
        { "format", reinterpret_cast<getter>(MediaFrameReference_get_Format), nullptr, nullptr, nullptr },
        { "properties", reinterpret_cast<getter>(MediaFrameReference_get_Properties), nullptr, nullptr, nullptr },
        { "source_kind", reinterpret_cast<getter>(MediaFrameReference_get_SourceKind), nullptr, nullptr, nullptr },
        { "system_relative_time", reinterpret_cast<getter>(MediaFrameReference_get_SystemRelativeTime), nullptr, nullptr, nullptr },
        { "video_media_frame", reinterpret_cast<getter>(MediaFrameReference_get_VideoMediaFrame), nullptr, nullptr, nullptr },
        { "audio_media_frame", reinterpret_cast<getter>(MediaFrameReference_get_AudioMediaFrame), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_MediaFrameReference[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_MediaFrameReference) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_MediaFrameReference) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_MediaFrameReference) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_MediaFrameReference) },
        { },
    };

    static PyType_Spec type_spec_MediaFrameReference =
    {
        "_winsdk_Windows_Media_Capture_Frames.MediaFrameReference",
        sizeof(py::wrapper::Windows::Media::Capture::Frames::MediaFrameReference),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_MediaFrameReference
    };

    // ----- MediaFrameSource class --------------------
    static constexpr const char* const type_name_MediaFrameSource = "MediaFrameSource";

    static PyObject* _new_MediaFrameSource(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_MediaFrameSource);
        return nullptr;
    }

    static void _dealloc_MediaFrameSource(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSource* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* MediaFrameSource_SetFormatAsync(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSource* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.Capture.Frames.MediaFrameSource", L"SetFormatAsync", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Media::Capture::Frames::MediaFrameFormat>(args, 0);

                return py::convert(self->obj.SetFormatAsync(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MediaFrameSource_TryGetCameraIntrinsics(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSource* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.Capture.Frames.MediaFrameSource", L"TryGetCameraIntrinsics", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Media::Capture::Frames::MediaFrameFormat>(args, 0);

                return py::convert(self->obj.TryGetCameraIntrinsics(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MediaFrameSource_get_Controller(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSource* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameSource", L"Controller"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.Controller());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaFrameSource_get_CurrentFormat(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSource* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameSource", L"CurrentFormat"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.CurrentFormat());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaFrameSource_get_Info(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSource* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameSource", L"Info"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.Info());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaFrameSource_get_SupportedFormats(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSource* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameSource", L"SupportedFormats"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.SupportedFormats());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaFrameSource_add_FormatChanged(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSource* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Media.Capture.Frames.MediaFrameSource", L"FormatChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Media::Capture::Frames::MediaFrameSource, winrt::Windows::Foundation::IInspectable>>(arg);

            return py::convert(self->obj.FormatChanged(param0));
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaFrameSource_remove_FormatChanged(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSource* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Media.Capture.Frames.MediaFrameSource", L"FormatChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            auto param0 = py::convert_to<winrt::event_token>(arg);

            self->obj.FormatChanged(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _assign_array_MediaFrameSource(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Media::Capture::Frames::MediaFrameSource>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_MediaFrameSource(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Media::Capture::Frames::MediaFrameSource>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_MediaFrameSource[] = {
        { "set_format_async", reinterpret_cast<PyCFunction>(MediaFrameSource_SetFormatAsync), METH_VARARGS, nullptr },
        { "try_get_camera_intrinsics", reinterpret_cast<PyCFunction>(MediaFrameSource_TryGetCameraIntrinsics), METH_VARARGS, nullptr },
        { "add_format_changed", reinterpret_cast<PyCFunction>(MediaFrameSource_add_FormatChanged), METH_O, nullptr },
        { "remove_format_changed", reinterpret_cast<PyCFunction>(MediaFrameSource_remove_FormatChanged), METH_O, nullptr },
        { "_assign_array_", _assign_array_MediaFrameSource, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_MediaFrameSource), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_MediaFrameSource[] = {
        { "controller", reinterpret_cast<getter>(MediaFrameSource_get_Controller), nullptr, nullptr, nullptr },
        { "current_format", reinterpret_cast<getter>(MediaFrameSource_get_CurrentFormat), nullptr, nullptr, nullptr },
        { "info", reinterpret_cast<getter>(MediaFrameSource_get_Info), nullptr, nullptr, nullptr },
        { "supported_formats", reinterpret_cast<getter>(MediaFrameSource_get_SupportedFormats), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_MediaFrameSource[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_MediaFrameSource) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_MediaFrameSource) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_MediaFrameSource) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_MediaFrameSource) },
        { },
    };

    static PyType_Spec type_spec_MediaFrameSource =
    {
        "_winsdk_Windows_Media_Capture_Frames.MediaFrameSource",
        sizeof(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSource),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_MediaFrameSource
    };

    // ----- MediaFrameSourceController class --------------------
    static constexpr const char* const type_name_MediaFrameSourceController = "MediaFrameSourceController";

    static PyObject* _new_MediaFrameSourceController(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_MediaFrameSourceController);
        return nullptr;
    }

    static void _dealloc_MediaFrameSourceController(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSourceController* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* MediaFrameSourceController_GetPropertyAsync(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSourceController* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.Capture.Frames.MediaFrameSourceController", L"GetPropertyAsync", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::hstring>(args, 0);

                return py::convert(self->obj.GetPropertyAsync(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MediaFrameSourceController_GetPropertyByExtendedIdAsync(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSourceController* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 2)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.Capture.Frames.MediaFrameSourceController", L"GetPropertyByExtendedIdAsync", 2))
            {
                py::set_arg_count_version_error(2);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<py::pybuf_view<uint8_t, false>>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Foundation::IReference<uint32_t>>(args, 1);

                return py::convert(self->obj.GetPropertyByExtendedIdAsync(param0, param1));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MediaFrameSourceController_SetPropertyAsync(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSourceController* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 2)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.Capture.Frames.MediaFrameSourceController", L"SetPropertyAsync", 2))
            {
                py::set_arg_count_version_error(2);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::hstring>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Foundation::IInspectable>(args, 1);

                return py::convert(self->obj.SetPropertyAsync(param0, param1));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MediaFrameSourceController_SetPropertyByExtendedIdAsync(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSourceController* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 2)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.Capture.Frames.MediaFrameSourceController", L"SetPropertyByExtendedIdAsync", 2))
            {
                py::set_arg_count_version_error(2);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<py::pybuf_view<uint8_t, false>>(args, 0);
                auto param1 = py::convert_to<py::pybuf_view<uint8_t, false>>(args, 1);

                return py::convert(self->obj.SetPropertyByExtendedIdAsync(param0, param1));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MediaFrameSourceController_get_VideoDeviceController(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSourceController* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameSourceController", L"VideoDeviceController"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.VideoDeviceController());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaFrameSourceController_get_AudioDeviceController(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSourceController* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameSourceController", L"AudioDeviceController"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.AudioDeviceController());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _assign_array_MediaFrameSourceController(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Media::Capture::Frames::MediaFrameSourceController>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_MediaFrameSourceController(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Media::Capture::Frames::MediaFrameSourceController>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_MediaFrameSourceController[] = {
        { "get_property_async", reinterpret_cast<PyCFunction>(MediaFrameSourceController_GetPropertyAsync), METH_VARARGS, nullptr },
        { "get_property_by_extended_id_async", reinterpret_cast<PyCFunction>(MediaFrameSourceController_GetPropertyByExtendedIdAsync), METH_VARARGS, nullptr },
        { "set_property_async", reinterpret_cast<PyCFunction>(MediaFrameSourceController_SetPropertyAsync), METH_VARARGS, nullptr },
        { "set_property_by_extended_id_async", reinterpret_cast<PyCFunction>(MediaFrameSourceController_SetPropertyByExtendedIdAsync), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_MediaFrameSourceController, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_MediaFrameSourceController), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_MediaFrameSourceController[] = {
        { "video_device_controller", reinterpret_cast<getter>(MediaFrameSourceController_get_VideoDeviceController), nullptr, nullptr, nullptr },
        { "audio_device_controller", reinterpret_cast<getter>(MediaFrameSourceController_get_AudioDeviceController), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_MediaFrameSourceController[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_MediaFrameSourceController) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_MediaFrameSourceController) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_MediaFrameSourceController) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_MediaFrameSourceController) },
        { },
    };

    static PyType_Spec type_spec_MediaFrameSourceController =
    {
        "_winsdk_Windows_Media_Capture_Frames.MediaFrameSourceController",
        sizeof(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSourceController),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_MediaFrameSourceController
    };

    // ----- MediaFrameSourceGetPropertyResult class --------------------
    static constexpr const char* const type_name_MediaFrameSourceGetPropertyResult = "MediaFrameSourceGetPropertyResult";

    static PyObject* _new_MediaFrameSourceGetPropertyResult(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_MediaFrameSourceGetPropertyResult);
        return nullptr;
    }

    static void _dealloc_MediaFrameSourceGetPropertyResult(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSourceGetPropertyResult* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* MediaFrameSourceGetPropertyResult_get_Status(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSourceGetPropertyResult* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameSourceGetPropertyResult", L"Status"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.Status());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaFrameSourceGetPropertyResult_get_Value(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSourceGetPropertyResult* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameSourceGetPropertyResult", L"Value"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.Value());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _assign_array_MediaFrameSourceGetPropertyResult(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Media::Capture::Frames::MediaFrameSourceGetPropertyResult>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_MediaFrameSourceGetPropertyResult(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Media::Capture::Frames::MediaFrameSourceGetPropertyResult>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_MediaFrameSourceGetPropertyResult[] = {
        { "_assign_array_", _assign_array_MediaFrameSourceGetPropertyResult, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_MediaFrameSourceGetPropertyResult), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_MediaFrameSourceGetPropertyResult[] = {
        { "status", reinterpret_cast<getter>(MediaFrameSourceGetPropertyResult_get_Status), nullptr, nullptr, nullptr },
        { "value", reinterpret_cast<getter>(MediaFrameSourceGetPropertyResult_get_Value), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_MediaFrameSourceGetPropertyResult[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_MediaFrameSourceGetPropertyResult) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_MediaFrameSourceGetPropertyResult) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_MediaFrameSourceGetPropertyResult) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_MediaFrameSourceGetPropertyResult) },
        { },
    };

    static PyType_Spec type_spec_MediaFrameSourceGetPropertyResult =
    {
        "_winsdk_Windows_Media_Capture_Frames.MediaFrameSourceGetPropertyResult",
        sizeof(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSourceGetPropertyResult),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_MediaFrameSourceGetPropertyResult
    };

    // ----- MediaFrameSourceGroup class --------------------
    static constexpr const char* const type_name_MediaFrameSourceGroup = "MediaFrameSourceGroup";

    static PyObject* _new_MediaFrameSourceGroup(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_MediaFrameSourceGroup);
        return nullptr;
    }

    static void _dealloc_MediaFrameSourceGroup(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSourceGroup* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* MediaFrameSourceGroup_FindAllAsync(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.Capture.Frames.MediaFrameSourceGroup", L"FindAllAsync", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(winrt::Windows::Media::Capture::Frames::MediaFrameSourceGroup::FindAllAsync());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MediaFrameSourceGroup_FromIdAsync(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.Capture.Frames.MediaFrameSourceGroup", L"FromIdAsync", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::hstring>(args, 0);

                return py::convert(winrt::Windows::Media::Capture::Frames::MediaFrameSourceGroup::FromIdAsync(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MediaFrameSourceGroup_GetDeviceSelector(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.Capture.Frames.MediaFrameSourceGroup", L"GetDeviceSelector", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(winrt::Windows::Media::Capture::Frames::MediaFrameSourceGroup::GetDeviceSelector());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MediaFrameSourceGroup_get_DisplayName(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSourceGroup* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameSourceGroup", L"DisplayName"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.DisplayName());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaFrameSourceGroup_get_Id(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSourceGroup* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameSourceGroup", L"Id"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.Id());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaFrameSourceGroup_get_SourceInfos(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSourceGroup* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameSourceGroup", L"SourceInfos"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.SourceInfos());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _assign_array_MediaFrameSourceGroup(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Media::Capture::Frames::MediaFrameSourceGroup>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_MediaFrameSourceGroup(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Media::Capture::Frames::MediaFrameSourceGroup>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_MediaFrameSourceGroup[] = {
        { "find_all_async", reinterpret_cast<PyCFunction>(MediaFrameSourceGroup_FindAllAsync), METH_VARARGS | METH_STATIC, nullptr },
        { "from_id_async", reinterpret_cast<PyCFunction>(MediaFrameSourceGroup_FromIdAsync), METH_VARARGS | METH_STATIC, nullptr },
        { "get_device_selector", reinterpret_cast<PyCFunction>(MediaFrameSourceGroup_GetDeviceSelector), METH_VARARGS | METH_STATIC, nullptr },
        { "_assign_array_", _assign_array_MediaFrameSourceGroup, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_MediaFrameSourceGroup), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_MediaFrameSourceGroup[] = {
        { "display_name", reinterpret_cast<getter>(MediaFrameSourceGroup_get_DisplayName), nullptr, nullptr, nullptr },
        { "id", reinterpret_cast<getter>(MediaFrameSourceGroup_get_Id), nullptr, nullptr, nullptr },
        { "source_infos", reinterpret_cast<getter>(MediaFrameSourceGroup_get_SourceInfos), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_MediaFrameSourceGroup[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_MediaFrameSourceGroup) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_MediaFrameSourceGroup) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_MediaFrameSourceGroup) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_MediaFrameSourceGroup) },
        { },
    };

    static PyType_Spec type_spec_MediaFrameSourceGroup =
    {
        "_winsdk_Windows_Media_Capture_Frames.MediaFrameSourceGroup",
        sizeof(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSourceGroup),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_MediaFrameSourceGroup
    };

    // ----- MediaFrameSourceInfo class --------------------
    static constexpr const char* const type_name_MediaFrameSourceInfo = "MediaFrameSourceInfo";

    static PyObject* _new_MediaFrameSourceInfo(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_MediaFrameSourceInfo);
        return nullptr;
    }

    static void _dealloc_MediaFrameSourceInfo(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSourceInfo* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* MediaFrameSourceInfo_GetRelativePanel(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSourceInfo* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.Capture.Frames.MediaFrameSourceInfo", L"GetRelativePanel", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::UI::WindowManagement::DisplayRegion>(args, 0);

                return py::convert(self->obj.GetRelativePanel(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MediaFrameSourceInfo_get_CoordinateSystem(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSourceInfo* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameSourceInfo", L"CoordinateSystem"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.CoordinateSystem());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaFrameSourceInfo_get_DeviceInformation(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSourceInfo* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameSourceInfo", L"DeviceInformation"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.DeviceInformation());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaFrameSourceInfo_get_Id(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSourceInfo* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameSourceInfo", L"Id"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.Id());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaFrameSourceInfo_get_MediaStreamType(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSourceInfo* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameSourceInfo", L"MediaStreamType"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.MediaStreamType());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaFrameSourceInfo_get_Properties(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSourceInfo* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameSourceInfo", L"Properties"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.Properties());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaFrameSourceInfo_get_SourceGroup(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSourceInfo* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameSourceInfo", L"SourceGroup"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.SourceGroup());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaFrameSourceInfo_get_SourceKind(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSourceInfo* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameSourceInfo", L"SourceKind"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.SourceKind());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaFrameSourceInfo_get_ProfileId(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSourceInfo* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameSourceInfo", L"ProfileId"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.ProfileId());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaFrameSourceInfo_get_VideoProfileMediaDescription(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSourceInfo* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameSourceInfo", L"VideoProfileMediaDescription"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.VideoProfileMediaDescription());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaFrameSourceInfo_get_IsShareable(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSourceInfo* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MediaFrameSourceInfo", L"IsShareable"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.IsShareable());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _assign_array_MediaFrameSourceInfo(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Media::Capture::Frames::MediaFrameSourceInfo>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_MediaFrameSourceInfo(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Media::Capture::Frames::MediaFrameSourceInfo>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_MediaFrameSourceInfo[] = {
        { "get_relative_panel", reinterpret_cast<PyCFunction>(MediaFrameSourceInfo_GetRelativePanel), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_MediaFrameSourceInfo, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_MediaFrameSourceInfo), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_MediaFrameSourceInfo[] = {
        { "coordinate_system", reinterpret_cast<getter>(MediaFrameSourceInfo_get_CoordinateSystem), nullptr, nullptr, nullptr },
        { "device_information", reinterpret_cast<getter>(MediaFrameSourceInfo_get_DeviceInformation), nullptr, nullptr, nullptr },
        { "id", reinterpret_cast<getter>(MediaFrameSourceInfo_get_Id), nullptr, nullptr, nullptr },
        { "media_stream_type", reinterpret_cast<getter>(MediaFrameSourceInfo_get_MediaStreamType), nullptr, nullptr, nullptr },
        { "properties", reinterpret_cast<getter>(MediaFrameSourceInfo_get_Properties), nullptr, nullptr, nullptr },
        { "source_group", reinterpret_cast<getter>(MediaFrameSourceInfo_get_SourceGroup), nullptr, nullptr, nullptr },
        { "source_kind", reinterpret_cast<getter>(MediaFrameSourceInfo_get_SourceKind), nullptr, nullptr, nullptr },
        { "profile_id", reinterpret_cast<getter>(MediaFrameSourceInfo_get_ProfileId), nullptr, nullptr, nullptr },
        { "video_profile_media_description", reinterpret_cast<getter>(MediaFrameSourceInfo_get_VideoProfileMediaDescription), nullptr, nullptr, nullptr },
        { "is_shareable", reinterpret_cast<getter>(MediaFrameSourceInfo_get_IsShareable), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_MediaFrameSourceInfo[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_MediaFrameSourceInfo) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_MediaFrameSourceInfo) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_MediaFrameSourceInfo) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_MediaFrameSourceInfo) },
        { },
    };

    static PyType_Spec type_spec_MediaFrameSourceInfo =
    {
        "_winsdk_Windows_Media_Capture_Frames.MediaFrameSourceInfo",
        sizeof(py::wrapper::Windows::Media::Capture::Frames::MediaFrameSourceInfo),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_MediaFrameSourceInfo
    };

    // ----- MultiSourceMediaFrameArrivedEventArgs class --------------------
    static constexpr const char* const type_name_MultiSourceMediaFrameArrivedEventArgs = "MultiSourceMediaFrameArrivedEventArgs";

    static PyObject* _new_MultiSourceMediaFrameArrivedEventArgs(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_MultiSourceMediaFrameArrivedEventArgs);
        return nullptr;
    }

    static void _dealloc_MultiSourceMediaFrameArrivedEventArgs(py::wrapper::Windows::Media::Capture::Frames::MultiSourceMediaFrameArrivedEventArgs* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* _assign_array_MultiSourceMediaFrameArrivedEventArgs(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Media::Capture::Frames::MultiSourceMediaFrameArrivedEventArgs>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_MultiSourceMediaFrameArrivedEventArgs(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Media::Capture::Frames::MultiSourceMediaFrameArrivedEventArgs>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_MultiSourceMediaFrameArrivedEventArgs[] = {
        { "_assign_array_", _assign_array_MultiSourceMediaFrameArrivedEventArgs, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_MultiSourceMediaFrameArrivedEventArgs), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_MultiSourceMediaFrameArrivedEventArgs[] = {
        { }
    };

    static PyType_Slot _type_slots_MultiSourceMediaFrameArrivedEventArgs[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_MultiSourceMediaFrameArrivedEventArgs) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_MultiSourceMediaFrameArrivedEventArgs) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_MultiSourceMediaFrameArrivedEventArgs) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_MultiSourceMediaFrameArrivedEventArgs) },
        { },
    };

    static PyType_Spec type_spec_MultiSourceMediaFrameArrivedEventArgs =
    {
        "_winsdk_Windows_Media_Capture_Frames.MultiSourceMediaFrameArrivedEventArgs",
        sizeof(py::wrapper::Windows::Media::Capture::Frames::MultiSourceMediaFrameArrivedEventArgs),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_MultiSourceMediaFrameArrivedEventArgs
    };

    // ----- MultiSourceMediaFrameReader class --------------------
    static constexpr const char* const type_name_MultiSourceMediaFrameReader = "MultiSourceMediaFrameReader";

    static PyObject* _new_MultiSourceMediaFrameReader(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_MultiSourceMediaFrameReader);
        return nullptr;
    }

    static void _dealloc_MultiSourceMediaFrameReader(py::wrapper::Windows::Media::Capture::Frames::MultiSourceMediaFrameReader* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* MultiSourceMediaFrameReader_Close(py::wrapper::Windows::Media::Capture::Frames::MultiSourceMediaFrameReader* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.Capture.Frames.MultiSourceMediaFrameReader", L"Close", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                self->obj.Close();
                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MultiSourceMediaFrameReader_StartAsync(py::wrapper::Windows::Media::Capture::Frames::MultiSourceMediaFrameReader* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.Capture.Frames.MultiSourceMediaFrameReader", L"StartAsync", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(self->obj.StartAsync());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MultiSourceMediaFrameReader_StopAsync(py::wrapper::Windows::Media::Capture::Frames::MultiSourceMediaFrameReader* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.Capture.Frames.MultiSourceMediaFrameReader", L"StopAsync", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(self->obj.StopAsync());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MultiSourceMediaFrameReader_TryAcquireLatestFrame(py::wrapper::Windows::Media::Capture::Frames::MultiSourceMediaFrameReader* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.Capture.Frames.MultiSourceMediaFrameReader", L"TryAcquireLatestFrame", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(self->obj.TryAcquireLatestFrame());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MultiSourceMediaFrameReader_get_AcquisitionMode(py::wrapper::Windows::Media::Capture::Frames::MultiSourceMediaFrameReader* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MultiSourceMediaFrameReader", L"AcquisitionMode"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.AcquisitionMode());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int MultiSourceMediaFrameReader_put_AcquisitionMode(py::wrapper::Windows::Media::Capture::Frames::MultiSourceMediaFrameReader* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.MultiSourceMediaFrameReader", L"AcquisitionMode"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return -1;
        }

        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Media::Capture::Frames::MediaFrameReaderAcquisitionMode>(arg);

            self->obj.AcquisitionMode(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* MultiSourceMediaFrameReader_add_FrameArrived(py::wrapper::Windows::Media::Capture::Frames::MultiSourceMediaFrameReader* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Media.Capture.Frames.MultiSourceMediaFrameReader", L"FrameArrived"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Media::Capture::Frames::MultiSourceMediaFrameReader, winrt::Windows::Media::Capture::Frames::MultiSourceMediaFrameArrivedEventArgs>>(arg);

            return py::convert(self->obj.FrameArrived(param0));
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MultiSourceMediaFrameReader_remove_FrameArrived(py::wrapper::Windows::Media::Capture::Frames::MultiSourceMediaFrameReader* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Media.Capture.Frames.MultiSourceMediaFrameReader", L"FrameArrived"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            auto param0 = py::convert_to<winrt::event_token>(arg);

            self->obj.FrameArrived(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _assign_array_MultiSourceMediaFrameReader(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Media::Capture::Frames::MultiSourceMediaFrameReader>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_MultiSourceMediaFrameReader(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Media::Capture::Frames::MultiSourceMediaFrameReader>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _enter_MultiSourceMediaFrameReader(py::wrapper::Windows::Media::Capture::Frames::MultiSourceMediaFrameReader* self) noexcept
    {
        Py_INCREF(self);
        return reinterpret_cast<PyObject*>(self);
    }

    static PyObject* _exit_MultiSourceMediaFrameReader(py::wrapper::Windows::Media::Capture::Frames::MultiSourceMediaFrameReader* self) noexcept
    {
        try
        {
            self->obj.Close();
            Py_RETURN_FALSE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_MultiSourceMediaFrameReader[] = {
        { "close", reinterpret_cast<PyCFunction>(MultiSourceMediaFrameReader_Close), METH_VARARGS, nullptr },
        { "start_async", reinterpret_cast<PyCFunction>(MultiSourceMediaFrameReader_StartAsync), METH_VARARGS, nullptr },
        { "stop_async", reinterpret_cast<PyCFunction>(MultiSourceMediaFrameReader_StopAsync), METH_VARARGS, nullptr },
        { "try_acquire_latest_frame", reinterpret_cast<PyCFunction>(MultiSourceMediaFrameReader_TryAcquireLatestFrame), METH_VARARGS, nullptr },
        { "add_frame_arrived", reinterpret_cast<PyCFunction>(MultiSourceMediaFrameReader_add_FrameArrived), METH_O, nullptr },
        { "remove_frame_arrived", reinterpret_cast<PyCFunction>(MultiSourceMediaFrameReader_remove_FrameArrived), METH_O, nullptr },
        { "_assign_array_", _assign_array_MultiSourceMediaFrameReader, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_MultiSourceMediaFrameReader), METH_O | METH_STATIC, nullptr },
        { "__enter__", reinterpret_cast<PyCFunction>(_enter_MultiSourceMediaFrameReader), METH_NOARGS, nullptr },
        { "__exit__",  reinterpret_cast<PyCFunction>(_exit_MultiSourceMediaFrameReader), METH_VARARGS, nullptr },
        { }
    };

    static PyGetSetDef _getset_MultiSourceMediaFrameReader[] = {
        { "acquisition_mode", reinterpret_cast<getter>(MultiSourceMediaFrameReader_get_AcquisitionMode), reinterpret_cast<setter>(MultiSourceMediaFrameReader_put_AcquisitionMode), nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_MultiSourceMediaFrameReader[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_MultiSourceMediaFrameReader) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_MultiSourceMediaFrameReader) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_MultiSourceMediaFrameReader) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_MultiSourceMediaFrameReader) },
        { },
    };

    static PyType_Spec type_spec_MultiSourceMediaFrameReader =
    {
        "_winsdk_Windows_Media_Capture_Frames.MultiSourceMediaFrameReader",
        sizeof(py::wrapper::Windows::Media::Capture::Frames::MultiSourceMediaFrameReader),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_MultiSourceMediaFrameReader
    };

    // ----- MultiSourceMediaFrameReference class --------------------
    static constexpr const char* const type_name_MultiSourceMediaFrameReference = "MultiSourceMediaFrameReference";

    static PyObject* _new_MultiSourceMediaFrameReference(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_MultiSourceMediaFrameReference);
        return nullptr;
    }

    static void _dealloc_MultiSourceMediaFrameReference(py::wrapper::Windows::Media::Capture::Frames::MultiSourceMediaFrameReference* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* MultiSourceMediaFrameReference_Close(py::wrapper::Windows::Media::Capture::Frames::MultiSourceMediaFrameReference* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.Capture.Frames.MultiSourceMediaFrameReference", L"Close", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                self->obj.Close();
                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* MultiSourceMediaFrameReference_TryGetFrameReferenceBySourceId(py::wrapper::Windows::Media::Capture::Frames::MultiSourceMediaFrameReference* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.Capture.Frames.MultiSourceMediaFrameReference", L"TryGetFrameReferenceBySourceId", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::hstring>(args, 0);

                return py::convert(self->obj.TryGetFrameReferenceBySourceId(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* _assign_array_MultiSourceMediaFrameReference(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Media::Capture::Frames::MultiSourceMediaFrameReference>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_MultiSourceMediaFrameReference(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Media::Capture::Frames::MultiSourceMediaFrameReference>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _enter_MultiSourceMediaFrameReference(py::wrapper::Windows::Media::Capture::Frames::MultiSourceMediaFrameReference* self) noexcept
    {
        Py_INCREF(self);
        return reinterpret_cast<PyObject*>(self);
    }

    static PyObject* _exit_MultiSourceMediaFrameReference(py::wrapper::Windows::Media::Capture::Frames::MultiSourceMediaFrameReference* self) noexcept
    {
        try
        {
            self->obj.Close();
            Py_RETURN_FALSE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_MultiSourceMediaFrameReference[] = {
        { "close", reinterpret_cast<PyCFunction>(MultiSourceMediaFrameReference_Close), METH_VARARGS, nullptr },
        { "try_get_frame_reference_by_source_id", reinterpret_cast<PyCFunction>(MultiSourceMediaFrameReference_TryGetFrameReferenceBySourceId), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_MultiSourceMediaFrameReference, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_MultiSourceMediaFrameReference), METH_O | METH_STATIC, nullptr },
        { "__enter__", reinterpret_cast<PyCFunction>(_enter_MultiSourceMediaFrameReference), METH_NOARGS, nullptr },
        { "__exit__",  reinterpret_cast<PyCFunction>(_exit_MultiSourceMediaFrameReference), METH_VARARGS, nullptr },
        { }
    };

    static PyGetSetDef _getset_MultiSourceMediaFrameReference[] = {
        { }
    };

    static PyType_Slot _type_slots_MultiSourceMediaFrameReference[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_MultiSourceMediaFrameReference) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_MultiSourceMediaFrameReference) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_MultiSourceMediaFrameReference) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_MultiSourceMediaFrameReference) },
        { },
    };

    static PyType_Spec type_spec_MultiSourceMediaFrameReference =
    {
        "_winsdk_Windows_Media_Capture_Frames.MultiSourceMediaFrameReference",
        sizeof(py::wrapper::Windows::Media::Capture::Frames::MultiSourceMediaFrameReference),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_MultiSourceMediaFrameReference
    };

    // ----- VideoMediaFrame class --------------------
    static constexpr const char* const type_name_VideoMediaFrame = "VideoMediaFrame";

    static PyObject* _new_VideoMediaFrame(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_VideoMediaFrame);
        return nullptr;
    }

    static void _dealloc_VideoMediaFrame(py::wrapper::Windows::Media::Capture::Frames::VideoMediaFrame* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* VideoMediaFrame_GetVideoFrame(py::wrapper::Windows::Media::Capture::Frames::VideoMediaFrame* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.Capture.Frames.VideoMediaFrame", L"GetVideoFrame", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(self->obj.GetVideoFrame());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* VideoMediaFrame_get_CameraIntrinsics(py::wrapper::Windows::Media::Capture::Frames::VideoMediaFrame* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.VideoMediaFrame", L"CameraIntrinsics"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.CameraIntrinsics());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* VideoMediaFrame_get_DepthMediaFrame(py::wrapper::Windows::Media::Capture::Frames::VideoMediaFrame* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.VideoMediaFrame", L"DepthMediaFrame"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.DepthMediaFrame());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* VideoMediaFrame_get_Direct3DSurface(py::wrapper::Windows::Media::Capture::Frames::VideoMediaFrame* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.VideoMediaFrame", L"Direct3DSurface"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.Direct3DSurface());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* VideoMediaFrame_get_FrameReference(py::wrapper::Windows::Media::Capture::Frames::VideoMediaFrame* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.VideoMediaFrame", L"FrameReference"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.FrameReference());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* VideoMediaFrame_get_InfraredMediaFrame(py::wrapper::Windows::Media::Capture::Frames::VideoMediaFrame* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.VideoMediaFrame", L"InfraredMediaFrame"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.InfraredMediaFrame());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* VideoMediaFrame_get_SoftwareBitmap(py::wrapper::Windows::Media::Capture::Frames::VideoMediaFrame* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.VideoMediaFrame", L"SoftwareBitmap"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.SoftwareBitmap());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* VideoMediaFrame_get_VideoFormat(py::wrapper::Windows::Media::Capture::Frames::VideoMediaFrame* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.VideoMediaFrame", L"VideoFormat"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.VideoFormat());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _assign_array_VideoMediaFrame(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Media::Capture::Frames::VideoMediaFrame>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_VideoMediaFrame(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Media::Capture::Frames::VideoMediaFrame>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_VideoMediaFrame[] = {
        { "get_video_frame", reinterpret_cast<PyCFunction>(VideoMediaFrame_GetVideoFrame), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_VideoMediaFrame, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_VideoMediaFrame), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_VideoMediaFrame[] = {
        { "camera_intrinsics", reinterpret_cast<getter>(VideoMediaFrame_get_CameraIntrinsics), nullptr, nullptr, nullptr },
        { "depth_media_frame", reinterpret_cast<getter>(VideoMediaFrame_get_DepthMediaFrame), nullptr, nullptr, nullptr },
        { "direct3_d_surface", reinterpret_cast<getter>(VideoMediaFrame_get_Direct3DSurface), nullptr, nullptr, nullptr },
        { "frame_reference", reinterpret_cast<getter>(VideoMediaFrame_get_FrameReference), nullptr, nullptr, nullptr },
        { "infrared_media_frame", reinterpret_cast<getter>(VideoMediaFrame_get_InfraredMediaFrame), nullptr, nullptr, nullptr },
        { "software_bitmap", reinterpret_cast<getter>(VideoMediaFrame_get_SoftwareBitmap), nullptr, nullptr, nullptr },
        { "video_format", reinterpret_cast<getter>(VideoMediaFrame_get_VideoFormat), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_VideoMediaFrame[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_VideoMediaFrame) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_VideoMediaFrame) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_VideoMediaFrame) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_VideoMediaFrame) },
        { },
    };

    static PyType_Spec type_spec_VideoMediaFrame =
    {
        "_winsdk_Windows_Media_Capture_Frames.VideoMediaFrame",
        sizeof(py::wrapper::Windows::Media::Capture::Frames::VideoMediaFrame),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_VideoMediaFrame
    };

    // ----- VideoMediaFrameFormat class --------------------
    static constexpr const char* const type_name_VideoMediaFrameFormat = "VideoMediaFrameFormat";

    static PyObject* _new_VideoMediaFrameFormat(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_VideoMediaFrameFormat);
        return nullptr;
    }

    static void _dealloc_VideoMediaFrameFormat(py::wrapper::Windows::Media::Capture::Frames::VideoMediaFrameFormat* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* VideoMediaFrameFormat_get_DepthFormat(py::wrapper::Windows::Media::Capture::Frames::VideoMediaFrameFormat* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.VideoMediaFrameFormat", L"DepthFormat"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.DepthFormat());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* VideoMediaFrameFormat_get_Height(py::wrapper::Windows::Media::Capture::Frames::VideoMediaFrameFormat* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.VideoMediaFrameFormat", L"Height"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.Height());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* VideoMediaFrameFormat_get_MediaFrameFormat(py::wrapper::Windows::Media::Capture::Frames::VideoMediaFrameFormat* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.VideoMediaFrameFormat", L"MediaFrameFormat"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.MediaFrameFormat());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* VideoMediaFrameFormat_get_Width(py::wrapper::Windows::Media::Capture::Frames::VideoMediaFrameFormat* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Frames.VideoMediaFrameFormat", L"Width"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(self->obj.Width());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _assign_array_VideoMediaFrameFormat(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Media::Capture::Frames::VideoMediaFrameFormat>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_VideoMediaFrameFormat(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Media::Capture::Frames::VideoMediaFrameFormat>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_VideoMediaFrameFormat[] = {
        { "_assign_array_", _assign_array_VideoMediaFrameFormat, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_VideoMediaFrameFormat), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_VideoMediaFrameFormat[] = {
        { "depth_format", reinterpret_cast<getter>(VideoMediaFrameFormat_get_DepthFormat), nullptr, nullptr, nullptr },
        { "height", reinterpret_cast<getter>(VideoMediaFrameFormat_get_Height), nullptr, nullptr, nullptr },
        { "media_frame_format", reinterpret_cast<getter>(VideoMediaFrameFormat_get_MediaFrameFormat), nullptr, nullptr, nullptr },
        { "width", reinterpret_cast<getter>(VideoMediaFrameFormat_get_Width), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_VideoMediaFrameFormat[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_VideoMediaFrameFormat) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_VideoMediaFrameFormat) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_VideoMediaFrameFormat) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_VideoMediaFrameFormat) },
        { },
    };

    static PyType_Spec type_spec_VideoMediaFrameFormat =
    {
        "_winsdk_Windows_Media_Capture_Frames.VideoMediaFrameFormat",
        sizeof(py::wrapper::Windows::Media::Capture::Frames::VideoMediaFrameFormat),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_VideoMediaFrameFormat
    };

    // ----- Windows.Media.Capture.Frames Initialization --------------------
    PyDoc_STRVAR(module_doc, "Windows::Media::Capture::Frames");

    static PyMethodDef module_methods[] = {
        {"_register_MediaFrameReaderAcquisitionMode", register_MediaFrameReaderAcquisitionMode, METH_O, "registers type"},
        {"_register_MediaFrameReaderStartStatus", register_MediaFrameReaderStartStatus, METH_O, "registers type"},
        {"_register_MediaFrameSourceGetPropertyStatus", register_MediaFrameSourceGetPropertyStatus, METH_O, "registers type"},
        {"_register_MediaFrameSourceKind", register_MediaFrameSourceKind, METH_O, "registers type"},
        {"_register_MediaFrameSourceSetPropertyStatus", register_MediaFrameSourceSetPropertyStatus, METH_O, "registers type"},
        {"_register_MultiSourceMediaFrameReaderStartStatus", register_MultiSourceMediaFrameReaderStartStatus, METH_O, "registers type"},
        {}};


    static int module_traverse(PyObject* module, visitproc visit, void* arg) noexcept
    {
        auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));

        if (!state)
        {
            return 0;
        }

        Py_VISIT(state->type_MediaFrameReaderAcquisitionMode);
        Py_VISIT(state->type_MediaFrameReaderStartStatus);
        Py_VISIT(state->type_MediaFrameSourceGetPropertyStatus);
        Py_VISIT(state->type_MediaFrameSourceKind);
        Py_VISIT(state->type_MediaFrameSourceSetPropertyStatus);
        Py_VISIT(state->type_MultiSourceMediaFrameReaderStartStatus);
        Py_VISIT(state->type_AudioMediaFrame);
        Py_VISIT(state->type_BufferMediaFrame);
        Py_VISIT(state->type_DepthMediaFrame);
        Py_VISIT(state->type_DepthMediaFrameFormat);
        Py_VISIT(state->type_InfraredMediaFrame);
        Py_VISIT(state->type_MediaFrameArrivedEventArgs);
        Py_VISIT(state->type_MediaFrameFormat);
        Py_VISIT(state->type_MediaFrameReader);
        Py_VISIT(state->type_MediaFrameReference);
        Py_VISIT(state->type_MediaFrameSource);
        Py_VISIT(state->type_MediaFrameSourceController);
        Py_VISIT(state->type_MediaFrameSourceGetPropertyResult);
        Py_VISIT(state->type_MediaFrameSourceGroup);
        Py_VISIT(state->type_MediaFrameSourceInfo);
        Py_VISIT(state->type_MultiSourceMediaFrameArrivedEventArgs);
        Py_VISIT(state->type_MultiSourceMediaFrameReader);
        Py_VISIT(state->type_MultiSourceMediaFrameReference);
        Py_VISIT(state->type_VideoMediaFrame);
        Py_VISIT(state->type_VideoMediaFrameFormat);

        return 0;
    }

    static int module_clear(PyObject* module) noexcept
    {
        auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));

        if (!state)
        {
            return 0;
        }

        Py_CLEAR(state->type_MediaFrameReaderAcquisitionMode);
        Py_CLEAR(state->type_MediaFrameReaderStartStatus);
        Py_CLEAR(state->type_MediaFrameSourceGetPropertyStatus);
        Py_CLEAR(state->type_MediaFrameSourceKind);
        Py_CLEAR(state->type_MediaFrameSourceSetPropertyStatus);
        Py_CLEAR(state->type_MultiSourceMediaFrameReaderStartStatus);
        Py_CLEAR(state->type_AudioMediaFrame);
        Py_CLEAR(state->type_BufferMediaFrame);
        Py_CLEAR(state->type_DepthMediaFrame);
        Py_CLEAR(state->type_DepthMediaFrameFormat);
        Py_CLEAR(state->type_InfraredMediaFrame);
        Py_CLEAR(state->type_MediaFrameArrivedEventArgs);
        Py_CLEAR(state->type_MediaFrameFormat);
        Py_CLEAR(state->type_MediaFrameReader);
        Py_CLEAR(state->type_MediaFrameReference);
        Py_CLEAR(state->type_MediaFrameSource);
        Py_CLEAR(state->type_MediaFrameSourceController);
        Py_CLEAR(state->type_MediaFrameSourceGetPropertyResult);
        Py_CLEAR(state->type_MediaFrameSourceGroup);
        Py_CLEAR(state->type_MediaFrameSourceInfo);
        Py_CLEAR(state->type_MultiSourceMediaFrameArrivedEventArgs);
        Py_CLEAR(state->type_MultiSourceMediaFrameReader);
        Py_CLEAR(state->type_MultiSourceMediaFrameReference);
        Py_CLEAR(state->type_VideoMediaFrame);
        Py_CLEAR(state->type_VideoMediaFrameFormat);

        return 0;
    }


    static PyModuleDef module_def
        = {PyModuleDef_HEAD_INIT,
           "_winsdk_Windows_Media_Capture_Frames",
           module_doc,
           sizeof(module_state),
           module_methods,
           nullptr,
           module_traverse,
           module_clear,
           nullptr};

} // py::cpp::Windows::Media::Capture::Frames

PyMODINIT_FUNC PyInit__winsdk_Windows_Media_Capture_Frames(void) noexcept
{
    using namespace py::cpp::Windows::Media::Capture::Frames;

    py::pyobj_handle module{PyModule_Create(&module_def)};

    if (!module)
    {
        return nullptr;
    }

    auto object_type = py::get_python_type<py::Object>();
    if (!object_type)
    {
        return nullptr;
    }

    py::pyobj_handle bases{PyTuple_Pack(1, object_type)};

    if (!bases)
    {
        return nullptr;
    }

    py::pyobj_handle collections_abc_module{PyImport_ImportModule("collections.abc")};

    if (!collections_abc_module)
    {
        return nullptr;
    }

    py::pyobj_handle sequence_type{PyObject_GetAttrString(collections_abc_module.get(), "Sequence")};

    if (!sequence_type)
    {
        return nullptr;
    }

    py::pyobj_handle sequence_bases{PyTuple_Pack(2, object_type, sequence_type.get())};

    if (!sequence_bases)
    {
        return nullptr;
    }

    py::pyobj_handle mutable_sequence_type{PyObject_GetAttrString(collections_abc_module.get(), "MutableSequence")};

    if (!mutable_sequence_type)
    {
        return nullptr;
    }

    py::pyobj_handle mutable_sequence_bases{PyTuple_Pack(2, object_type, mutable_sequence_type.get())};

    if (!mutable_sequence_bases)
    {
        return nullptr;
    }

    py::pyobj_handle mapping_type{PyObject_GetAttrString(collections_abc_module.get(), "Mapping")};

    if (!mapping_type)
    {
        return nullptr;
    }

    py::pyobj_handle mapping_bases{PyTuple_Pack(2, object_type, mapping_type.get())};

    if (!mapping_bases)
    {
        return nullptr;
    }

    py::pyobj_handle mutable_mapping_type{PyObject_GetAttrString(collections_abc_module.get(), "MutableMapping")};

    if (!mutable_mapping_type)
    {
        return nullptr;
    }

    py::pyobj_handle mutable_mapping_bases{PyTuple_Pack(2, object_type, mutable_mapping_type.get())};

    if (!mutable_mapping_bases)
    {
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module.get()));
    assert(state);

    state->type_AudioMediaFrame = py::register_python_type(module.get(), type_name_AudioMediaFrame, &type_spec_AudioMediaFrame, bases.get(), nullptr);
    if (!state->type_AudioMediaFrame)
    {
        return nullptr;
    }

    state->type_BufferMediaFrame = py::register_python_type(module.get(), type_name_BufferMediaFrame, &type_spec_BufferMediaFrame, bases.get(), nullptr);
    if (!state->type_BufferMediaFrame)
    {
        return nullptr;
    }

    state->type_DepthMediaFrame = py::register_python_type(module.get(), type_name_DepthMediaFrame, &type_spec_DepthMediaFrame, bases.get(), nullptr);
    if (!state->type_DepthMediaFrame)
    {
        return nullptr;
    }

    state->type_DepthMediaFrameFormat = py::register_python_type(module.get(), type_name_DepthMediaFrameFormat, &type_spec_DepthMediaFrameFormat, bases.get(), nullptr);
    if (!state->type_DepthMediaFrameFormat)
    {
        return nullptr;
    }

    state->type_InfraredMediaFrame = py::register_python_type(module.get(), type_name_InfraredMediaFrame, &type_spec_InfraredMediaFrame, bases.get(), nullptr);
    if (!state->type_InfraredMediaFrame)
    {
        return nullptr;
    }

    state->type_MediaFrameArrivedEventArgs = py::register_python_type(module.get(), type_name_MediaFrameArrivedEventArgs, &type_spec_MediaFrameArrivedEventArgs, bases.get(), nullptr);
    if (!state->type_MediaFrameArrivedEventArgs)
    {
        return nullptr;
    }

    state->type_MediaFrameFormat = py::register_python_type(module.get(), type_name_MediaFrameFormat, &type_spec_MediaFrameFormat, bases.get(), nullptr);
    if (!state->type_MediaFrameFormat)
    {
        return nullptr;
    }

    state->type_MediaFrameReader = py::register_python_type(module.get(), type_name_MediaFrameReader, &type_spec_MediaFrameReader, bases.get(), nullptr);
    if (!state->type_MediaFrameReader)
    {
        return nullptr;
    }

    state->type_MediaFrameReference = py::register_python_type(module.get(), type_name_MediaFrameReference, &type_spec_MediaFrameReference, bases.get(), nullptr);
    if (!state->type_MediaFrameReference)
    {
        return nullptr;
    }

    state->type_MediaFrameSource = py::register_python_type(module.get(), type_name_MediaFrameSource, &type_spec_MediaFrameSource, bases.get(), nullptr);
    if (!state->type_MediaFrameSource)
    {
        return nullptr;
    }

    state->type_MediaFrameSourceController = py::register_python_type(module.get(), type_name_MediaFrameSourceController, &type_spec_MediaFrameSourceController, bases.get(), nullptr);
    if (!state->type_MediaFrameSourceController)
    {
        return nullptr;
    }

    state->type_MediaFrameSourceGetPropertyResult = py::register_python_type(module.get(), type_name_MediaFrameSourceGetPropertyResult, &type_spec_MediaFrameSourceGetPropertyResult, bases.get(), nullptr);
    if (!state->type_MediaFrameSourceGetPropertyResult)
    {
        return nullptr;
    }

    state->type_MediaFrameSourceGroup = py::register_python_type(module.get(), type_name_MediaFrameSourceGroup, &type_spec_MediaFrameSourceGroup, bases.get(), nullptr);
    if (!state->type_MediaFrameSourceGroup)
    {
        return nullptr;
    }

    state->type_MediaFrameSourceInfo = py::register_python_type(module.get(), type_name_MediaFrameSourceInfo, &type_spec_MediaFrameSourceInfo, bases.get(), nullptr);
    if (!state->type_MediaFrameSourceInfo)
    {
        return nullptr;
    }

    state->type_MultiSourceMediaFrameArrivedEventArgs = py::register_python_type(module.get(), type_name_MultiSourceMediaFrameArrivedEventArgs, &type_spec_MultiSourceMediaFrameArrivedEventArgs, bases.get(), nullptr);
    if (!state->type_MultiSourceMediaFrameArrivedEventArgs)
    {
        return nullptr;
    }

    state->type_MultiSourceMediaFrameReader = py::register_python_type(module.get(), type_name_MultiSourceMediaFrameReader, &type_spec_MultiSourceMediaFrameReader, bases.get(), nullptr);
    if (!state->type_MultiSourceMediaFrameReader)
    {
        return nullptr;
    }

    state->type_MultiSourceMediaFrameReference = py::register_python_type(module.get(), type_name_MultiSourceMediaFrameReference, &type_spec_MultiSourceMediaFrameReference, bases.get(), nullptr);
    if (!state->type_MultiSourceMediaFrameReference)
    {
        return nullptr;
    }

    state->type_VideoMediaFrame = py::register_python_type(module.get(), type_name_VideoMediaFrame, &type_spec_VideoMediaFrame, bases.get(), nullptr);
    if (!state->type_VideoMediaFrame)
    {
        return nullptr;
    }

    state->type_VideoMediaFrameFormat = py::register_python_type(module.get(), type_name_VideoMediaFrameFormat, &type_spec_VideoMediaFrameFormat, bases.get(), nullptr);
    if (!state->type_VideoMediaFrameFormat)
    {
        return nullptr;
    }


    return module.detach();
}

PyObject* py::py_type<winrt::Windows::Media::Capture::Frames::MediaFrameReaderAcquisitionMode>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Media::Capture::Frames;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Media::Capture::Frames");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_MediaFrameReaderAcquisitionMode;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Media::Capture::Frames::MediaFrameReaderAcquisitionMode is not registered");
        return nullptr;
    }

    return python_type;
}

PyObject* py::py_type<winrt::Windows::Media::Capture::Frames::MediaFrameReaderStartStatus>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Media::Capture::Frames;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Media::Capture::Frames");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_MediaFrameReaderStartStatus;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Media::Capture::Frames::MediaFrameReaderStartStatus is not registered");
        return nullptr;
    }

    return python_type;
}

PyObject* py::py_type<winrt::Windows::Media::Capture::Frames::MediaFrameSourceGetPropertyStatus>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Media::Capture::Frames;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Media::Capture::Frames");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_MediaFrameSourceGetPropertyStatus;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Media::Capture::Frames::MediaFrameSourceGetPropertyStatus is not registered");
        return nullptr;
    }

    return python_type;
}

PyObject* py::py_type<winrt::Windows::Media::Capture::Frames::MediaFrameSourceKind>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Media::Capture::Frames;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Media::Capture::Frames");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_MediaFrameSourceKind;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Media::Capture::Frames::MediaFrameSourceKind is not registered");
        return nullptr;
    }

    return python_type;
}

PyObject* py::py_type<winrt::Windows::Media::Capture::Frames::MediaFrameSourceSetPropertyStatus>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Media::Capture::Frames;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Media::Capture::Frames");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_MediaFrameSourceSetPropertyStatus;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Media::Capture::Frames::MediaFrameSourceSetPropertyStatus is not registered");
        return nullptr;
    }

    return python_type;
}

PyObject* py::py_type<winrt::Windows::Media::Capture::Frames::MultiSourceMediaFrameReaderStartStatus>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Media::Capture::Frames;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Media::Capture::Frames");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_MultiSourceMediaFrameReaderStartStatus;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Media::Capture::Frames::MultiSourceMediaFrameReaderStartStatus is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Media::Capture::Frames::AudioMediaFrame>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Media::Capture::Frames;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Media::Capture::Frames");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_AudioMediaFrame;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Media::Capture::Frames::AudioMediaFrame is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Media::Capture::Frames::BufferMediaFrame>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Media::Capture::Frames;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Media::Capture::Frames");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_BufferMediaFrame;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Media::Capture::Frames::BufferMediaFrame is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Media::Capture::Frames::DepthMediaFrame>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Media::Capture::Frames;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Media::Capture::Frames");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_DepthMediaFrame;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Media::Capture::Frames::DepthMediaFrame is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Media::Capture::Frames::DepthMediaFrameFormat>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Media::Capture::Frames;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Media::Capture::Frames");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_DepthMediaFrameFormat;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Media::Capture::Frames::DepthMediaFrameFormat is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Media::Capture::Frames::InfraredMediaFrame>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Media::Capture::Frames;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Media::Capture::Frames");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_InfraredMediaFrame;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Media::Capture::Frames::InfraredMediaFrame is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Media::Capture::Frames::MediaFrameArrivedEventArgs>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Media::Capture::Frames;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Media::Capture::Frames");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_MediaFrameArrivedEventArgs;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Media::Capture::Frames::MediaFrameArrivedEventArgs is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Media::Capture::Frames::MediaFrameFormat>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Media::Capture::Frames;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Media::Capture::Frames");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_MediaFrameFormat;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Media::Capture::Frames::MediaFrameFormat is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Media::Capture::Frames::MediaFrameReader>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Media::Capture::Frames;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Media::Capture::Frames");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_MediaFrameReader;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Media::Capture::Frames::MediaFrameReader is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Media::Capture::Frames::MediaFrameReference>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Media::Capture::Frames;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Media::Capture::Frames");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_MediaFrameReference;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Media::Capture::Frames::MediaFrameReference is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Media::Capture::Frames::MediaFrameSource>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Media::Capture::Frames;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Media::Capture::Frames");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_MediaFrameSource;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Media::Capture::Frames::MediaFrameSource is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Media::Capture::Frames::MediaFrameSourceController>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Media::Capture::Frames;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Media::Capture::Frames");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_MediaFrameSourceController;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Media::Capture::Frames::MediaFrameSourceController is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Media::Capture::Frames::MediaFrameSourceGetPropertyResult>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Media::Capture::Frames;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Media::Capture::Frames");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_MediaFrameSourceGetPropertyResult;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Media::Capture::Frames::MediaFrameSourceGetPropertyResult is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Media::Capture::Frames::MediaFrameSourceGroup>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Media::Capture::Frames;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Media::Capture::Frames");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_MediaFrameSourceGroup;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Media::Capture::Frames::MediaFrameSourceGroup is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Media::Capture::Frames::MediaFrameSourceInfo>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Media::Capture::Frames;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Media::Capture::Frames");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_MediaFrameSourceInfo;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Media::Capture::Frames::MediaFrameSourceInfo is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Media::Capture::Frames::MultiSourceMediaFrameArrivedEventArgs>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Media::Capture::Frames;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Media::Capture::Frames");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_MultiSourceMediaFrameArrivedEventArgs;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Media::Capture::Frames::MultiSourceMediaFrameArrivedEventArgs is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Media::Capture::Frames::MultiSourceMediaFrameReader>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Media::Capture::Frames;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Media::Capture::Frames");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_MultiSourceMediaFrameReader;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Media::Capture::Frames::MultiSourceMediaFrameReader is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Media::Capture::Frames::MultiSourceMediaFrameReference>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Media::Capture::Frames;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Media::Capture::Frames");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_MultiSourceMediaFrameReference;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Media::Capture::Frames::MultiSourceMediaFrameReference is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Media::Capture::Frames::VideoMediaFrame>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Media::Capture::Frames;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Media::Capture::Frames");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_VideoMediaFrame;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Media::Capture::Frames::VideoMediaFrame is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Media::Capture::Frames::VideoMediaFrameFormat>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Media::Capture::Frames;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Media::Capture::Frames");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_VideoMediaFrameFormat;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Media::Capture::Frames::VideoMediaFrameFormat is not registered");
        return nullptr;
    }

    return python_type;
}
