//
// Automatically generated by ipdlc.
// Edit at your own risk
//

#ifndef PRemoteEncoder_h
#define PRemoteEncoder_h

#include "mozilla/Attributes.h"
#include "IPCMessageStart.h"
#include "mozilla/RefPtr.h"
#include "nsString.h"
#include "nsTArray.h"
#include "nsTHashtable.h"
#include "mozilla/MozPromise.h"
#include "mozilla/OperatorNewExtensions.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/ipc/ByteBuf.h"
#include "mozilla/ipc/FileDescriptor.h"
#include "mozilla/ipc/IPCForwards.h"
#include "mozilla/ipc/Shmem.h"

// Headers for typedefs
#include "MediaResult.h"
#include "mozilla/RemoteMediaData.h"
#include "mozilla/ipc/IPDLStructMember.h"


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union EncodedInputIPDL|
//
namespace mozilla {
class EncodedInputIPDL final
{
public:
    enum Type {
        T__None,
        TArrayOfRemoteAudioData = 1,
        TArrayOfRemoteVideoData,
        T__Last = TArrayOfRemoteVideoData
    };

private:
    typedef ::mozilla::ArrayOfRemoteAudioData ArrayOfRemoteAudioData;
    typedef ::mozilla::ArrayOfRemoteVideoData ArrayOfRemoteVideoData;
    typedef RefPtr<ArrayOfRemoteAudioData> ArrayOfRemoteAudioData__tdef;
    typedef RefPtr<ArrayOfRemoteVideoData> ArrayOfRemoteVideoData__tdef;

    RefPtr<ArrayOfRemoteAudioData>*
    ptr_ArrayOfRemoteAudioData()
    {
        return (&(mVArrayOfRemoteAudioData));
    }
    const RefPtr<ArrayOfRemoteAudioData>*
    constptr_ArrayOfRemoteAudioData() const
    {
        return (&(mVArrayOfRemoteAudioData));
    }
    RefPtr<ArrayOfRemoteVideoData>*
    ptr_ArrayOfRemoteVideoData()
    {
        return (&(mVArrayOfRemoteVideoData));
    }
    const RefPtr<ArrayOfRemoteVideoData>*
    constptr_ArrayOfRemoteVideoData() const
    {
        return (&(mVArrayOfRemoteVideoData));
    }

    void
    MaybeDestroy();

    void
    AssertSanity() const
    {
        MOZ_RELEASE_ASSERT((T__None) <= (mType), "invalid type tag");
        MOZ_RELEASE_ASSERT((mType) <= (T__Last), "invalid type tag");
    }
    void
    AssertSanity(Type aType) const
    {
        AssertSanity();
        MOZ_RELEASE_ASSERT((mType) == (aType), "unexpected type tag");
    }

public:
    MOZ_IMPLICIT EncodedInputIPDL() :
        mType(T__None)
    {
    }

    MOZ_IMPLICIT EncodedInputIPDL(ArrayOfRemoteAudioData* aOther);

    MOZ_IMPLICIT EncodedInputIPDL(RefPtr<ArrayOfRemoteAudioData>&& aOther);

    MOZ_IMPLICIT EncodedInputIPDL(ArrayOfRemoteVideoData* aOther);

    MOZ_IMPLICIT EncodedInputIPDL(RefPtr<ArrayOfRemoteVideoData>&& aOther);

    MOZ_IMPLICIT EncodedInputIPDL(const EncodedInputIPDL& aOther);

    MOZ_IMPLICIT EncodedInputIPDL(EncodedInputIPDL&& aOther);

    ~EncodedInputIPDL();

    Type
    type() const
    {
        return mType;
    }

    EncodedInputIPDL&
    operator=(ArrayOfRemoteAudioData* aRhs);

    EncodedInputIPDL&
    operator=(RefPtr<ArrayOfRemoteAudioData>&& aRhs);

    EncodedInputIPDL&
    operator=(ArrayOfRemoteVideoData* aRhs);

    EncodedInputIPDL&
    operator=(RefPtr<ArrayOfRemoteVideoData>&& aRhs);

    EncodedInputIPDL&
    operator=(const EncodedInputIPDL& aRhs);

    EncodedInputIPDL&
    operator=(EncodedInputIPDL&& aRhs);

    RefPtr<ArrayOfRemoteAudioData>&
    get_ArrayOfRemoteAudioData()
    {
        AssertSanity(TArrayOfRemoteAudioData);
        return (*(ptr_ArrayOfRemoteAudioData()));
    }
    ArrayOfRemoteAudioData*
    get_ArrayOfRemoteAudioData() const
    {
        AssertSanity(TArrayOfRemoteAudioData);
        return (*(constptr_ArrayOfRemoteAudioData()));
    }
    operator RefPtr<ArrayOfRemoteAudioData>&()
    {
        return get_ArrayOfRemoteAudioData();
    }
    operator ArrayOfRemoteAudioData*() const
    {
        return get_ArrayOfRemoteAudioData();
    }

    RefPtr<ArrayOfRemoteVideoData>&
    get_ArrayOfRemoteVideoData()
    {
        AssertSanity(TArrayOfRemoteVideoData);
        return (*(ptr_ArrayOfRemoteVideoData()));
    }
    ArrayOfRemoteVideoData*
    get_ArrayOfRemoteVideoData() const
    {
        AssertSanity(TArrayOfRemoteVideoData);
        return (*(constptr_ArrayOfRemoteVideoData()));
    }
    operator RefPtr<ArrayOfRemoteVideoData>&()
    {
        return get_ArrayOfRemoteVideoData();
    }
    operator ArrayOfRemoteVideoData*() const
    {
        return get_ArrayOfRemoteVideoData();
    }

private:
    union {
        RefPtr<ArrayOfRemoteAudioData> mVArrayOfRemoteAudioData;
        RefPtr<ArrayOfRemoteVideoData> mVArrayOfRemoteVideoData;
    };
    Type mType;
};
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::EncodedInputIPDL>
{
    typedef ::mozilla::EncodedInputIPDL paramType;
    static void
    Write(
            IPC::MessageWriter* aWriter,
            const paramType& aVar);
    static IPC::ReadResult<paramType>
    Read(IPC::MessageReader* aReader);
};
} // namespace IPC


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct EncodeInitCompletionIPDL|
//
namespace mozilla {
class EncodeInitCompletionIPDL final
{
private:
    typedef ::nsCString nsCString;

public:
#ifdef __clang__
#  pragma clang diagnostic push
#  if __has_warning("-Wdefaulted-function-deleted")
#    pragma clang diagnostic ignored "-Wdefaulted-function-deleted"
#  endif
#endif
    EncodeInitCompletionIPDL() = default;
#ifdef __clang__
#  pragma clang diagnostic pop
#endif

    MOZ_IMPLICIT EncodeInitCompletionIPDL(
            const nsCString& _description,
            const bool& _hardware,
            const nsCString& _hardwareReason) :
        description_(_description),
        hardware_(_hardware),
        hardwareReason_(_hardwareReason)
    {
    }

    MOZ_IMPLICIT EncodeInitCompletionIPDL(
            nsCString&& _description,
            bool&& _hardware,
            nsCString&& _hardwareReason) :
        description_(std::move(_description)),
        hardware_(std::move(_hardware)),
        hardwareReason_(std::move(_hardwareReason))
    {
    }

    nsCString&
    description()
    {
        return description_;
    }
    const nsCString&
    description() const
    {
        return description_;
    }

    bool&
    hardware()
    {
        return hardware_;
    }
    const bool&
    hardware() const
    {
        return hardware_;
    }

    nsCString&
    hardwareReason()
    {
        return hardwareReason_;
    }
    const nsCString&
    hardwareReason() const
    {
        return hardwareReason_;
    }

private:
    ::mozilla::ipc::IPDLStructMember<nsCString> description_;
    ::mozilla::ipc::IPDLStructMember<bool> hardware_;
    ::mozilla::ipc::IPDLStructMember<nsCString> hardwareReason_;
};
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::EncodeInitCompletionIPDL>
{
    typedef ::mozilla::EncodeInitCompletionIPDL paramType;
    static void
    Write(
            IPC::MessageWriter* aWriter,
            const paramType& aVar);
    static IPC::ReadResult<paramType>
    Read(IPC::MessageReader* aReader);
};
} // namespace IPC


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union EncodeInitResultIPDL|
//
namespace mozilla {
class EncodeInitResultIPDL final
{
public:
    enum Type {
        T__None,
        TMediaResult = 1,
        TEncodeInitCompletionIPDL,
        T__Last = TEncodeInitCompletionIPDL
    };

private:
    typedef ::mozilla::MediaResult MediaResult;
    typedef ::mozilla::EncodeInitCompletionIPDL EncodeInitCompletionIPDL;
    typedef MediaResult MediaResult__tdef;
    typedef EncodeInitCompletionIPDL EncodeInitCompletionIPDL__tdef;

    MediaResult*
    ptr_MediaResult()
    {
        return (&(mVMediaResult));
    }
    const MediaResult*
    constptr_MediaResult() const
    {
        return (&(mVMediaResult));
    }
    EncodeInitCompletionIPDL*
    ptr_EncodeInitCompletionIPDL()
    {
        return (&(mVEncodeInitCompletionIPDL));
    }
    const EncodeInitCompletionIPDL*
    constptr_EncodeInitCompletionIPDL() const
    {
        return (&(mVEncodeInitCompletionIPDL));
    }

    void
    MaybeDestroy();

    void
    AssertSanity() const
    {
        MOZ_RELEASE_ASSERT((T__None) <= (mType), "invalid type tag");
        MOZ_RELEASE_ASSERT((mType) <= (T__Last), "invalid type tag");
    }
    void
    AssertSanity(Type aType) const
    {
        AssertSanity();
        MOZ_RELEASE_ASSERT((mType) == (aType), "unexpected type tag");
    }

public:
    MOZ_IMPLICIT EncodeInitResultIPDL() :
        mType(T__None)
    {
    }

    MOZ_IMPLICIT EncodeInitResultIPDL(const MediaResult& aOther);

    MOZ_IMPLICIT EncodeInitResultIPDL(MediaResult&& aOther);

    MOZ_IMPLICIT EncodeInitResultIPDL(const EncodeInitCompletionIPDL& aOther);

    MOZ_IMPLICIT EncodeInitResultIPDL(EncodeInitCompletionIPDL&& aOther);

    MOZ_IMPLICIT EncodeInitResultIPDL(const EncodeInitResultIPDL& aOther);

    MOZ_IMPLICIT EncodeInitResultIPDL(EncodeInitResultIPDL&& aOther);

    ~EncodeInitResultIPDL();

    Type
    type() const
    {
        return mType;
    }

    EncodeInitResultIPDL&
    operator=(const MediaResult& aRhs);

    EncodeInitResultIPDL&
    operator=(MediaResult&& aRhs);

    EncodeInitResultIPDL&
    operator=(const EncodeInitCompletionIPDL& aRhs);

    EncodeInitResultIPDL&
    operator=(EncodeInitCompletionIPDL&& aRhs);

    EncodeInitResultIPDL&
    operator=(const EncodeInitResultIPDL& aRhs);

    EncodeInitResultIPDL&
    operator=(EncodeInitResultIPDL&& aRhs);

    MediaResult&
    get_MediaResult()
    {
        AssertSanity(TMediaResult);
        return (*(ptr_MediaResult()));
    }
    const MediaResult&
    get_MediaResult() const
    {
        AssertSanity(TMediaResult);
        return (*(constptr_MediaResult()));
    }
    operator MediaResult&()
    {
        return get_MediaResult();
    }
    operator const MediaResult&() const
    {
        return get_MediaResult();
    }

    EncodeInitCompletionIPDL&
    get_EncodeInitCompletionIPDL()
    {
        AssertSanity(TEncodeInitCompletionIPDL);
        return (*(ptr_EncodeInitCompletionIPDL()));
    }
    const EncodeInitCompletionIPDL&
    get_EncodeInitCompletionIPDL() const
    {
        AssertSanity(TEncodeInitCompletionIPDL);
        return (*(constptr_EncodeInitCompletionIPDL()));
    }
    operator EncodeInitCompletionIPDL&()
    {
        return get_EncodeInitCompletionIPDL();
    }
    operator const EncodeInitCompletionIPDL&() const
    {
        return get_EncodeInitCompletionIPDL();
    }

private:
    union {
        MediaResult mVMediaResult;
        EncodeInitCompletionIPDL mVEncodeInitCompletionIPDL;
    };
    Type mType;
};
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::EncodeInitResultIPDL>
{
    typedef ::mozilla::EncodeInitResultIPDL paramType;
    static void
    Write(
            IPC::MessageWriter* aWriter,
            const paramType& aVar);
    static IPC::ReadResult<paramType>
    Read(IPC::MessageReader* aReader);
};
} // namespace IPC


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct EncodeCompletionIPDL|
//
namespace mozilla {
class EncodeCompletionIPDL final
{
private:
    typedef ::mozilla::ArrayOfRemoteMediaRawData ArrayOfRemoteMediaRawData;
    typedef ::uint32_t uint32_t;

public:
#ifdef __clang__
#  pragma clang diagnostic push
#  if __has_warning("-Wdefaulted-function-deleted")
#    pragma clang diagnostic ignored "-Wdefaulted-function-deleted"
#  endif
#endif
    EncodeCompletionIPDL() = default;
#ifdef __clang__
#  pragma clang diagnostic pop
#endif

    MOZ_IMPLICIT EncodeCompletionIPDL(
            ArrayOfRemoteMediaRawData* _samples,
            const uint32_t& _ticketId) :
        samples_(_samples),
        ticketId_(_ticketId)
    {
    }

    MOZ_IMPLICIT EncodeCompletionIPDL(
            RefPtr<ArrayOfRemoteMediaRawData>&& _samples,
            uint32_t&& _ticketId) :
        samples_(std::move(_samples)),
        ticketId_(std::move(_ticketId))
    {
    }

    RefPtr<ArrayOfRemoteMediaRawData>&
    samples()
    {
        return samples_;
    }
    ArrayOfRemoteMediaRawData*
    samples() const
    {
        return samples_;
    }

    uint32_t&
    ticketId()
    {
        return ticketId_;
    }
    const uint32_t&
    ticketId() const
    {
        return ticketId_;
    }

private:
    ::mozilla::ipc::IPDLStructMember<RefPtr<ArrayOfRemoteMediaRawData>> samples_;
    ::mozilla::ipc::IPDLStructMember<uint32_t> ticketId_;
};
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::EncodeCompletionIPDL>
{
    typedef ::mozilla::EncodeCompletionIPDL paramType;
    static void
    Write(
            IPC::MessageWriter* aWriter,
            const paramType& aVar);
    static IPC::ReadResult<paramType>
    Read(IPC::MessageReader* aReader);
};
} // namespace IPC


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union EncodeResultIPDL|
//
namespace mozilla {
class EncodeResultIPDL final
{
public:
    enum Type {
        T__None,
        TMediaResult = 1,
        TEncodeCompletionIPDL,
        T__Last = TEncodeCompletionIPDL
    };

private:
    typedef ::mozilla::MediaResult MediaResult;
    typedef ::mozilla::EncodeCompletionIPDL EncodeCompletionIPDL;
    typedef MediaResult MediaResult__tdef;
    typedef EncodeCompletionIPDL EncodeCompletionIPDL__tdef;

    MediaResult*
    ptr_MediaResult()
    {
        return (&(mVMediaResult));
    }
    const MediaResult*
    constptr_MediaResult() const
    {
        return (&(mVMediaResult));
    }
    EncodeCompletionIPDL*
    ptr_EncodeCompletionIPDL()
    {
        return (&(mVEncodeCompletionIPDL));
    }
    const EncodeCompletionIPDL*
    constptr_EncodeCompletionIPDL() const
    {
        return (&(mVEncodeCompletionIPDL));
    }

    void
    MaybeDestroy();

    void
    AssertSanity() const
    {
        MOZ_RELEASE_ASSERT((T__None) <= (mType), "invalid type tag");
        MOZ_RELEASE_ASSERT((mType) <= (T__Last), "invalid type tag");
    }
    void
    AssertSanity(Type aType) const
    {
        AssertSanity();
        MOZ_RELEASE_ASSERT((mType) == (aType), "unexpected type tag");
    }

public:
    MOZ_IMPLICIT EncodeResultIPDL() :
        mType(T__None)
    {
    }

    MOZ_IMPLICIT EncodeResultIPDL(const MediaResult& aOther);

    MOZ_IMPLICIT EncodeResultIPDL(MediaResult&& aOther);

    MOZ_IMPLICIT EncodeResultIPDL(const EncodeCompletionIPDL& aOther);

    MOZ_IMPLICIT EncodeResultIPDL(EncodeCompletionIPDL&& aOther);

    MOZ_IMPLICIT EncodeResultIPDL(const EncodeResultIPDL& aOther);

    MOZ_IMPLICIT EncodeResultIPDL(EncodeResultIPDL&& aOther);

    ~EncodeResultIPDL();

    Type
    type() const
    {
        return mType;
    }

    EncodeResultIPDL&
    operator=(const MediaResult& aRhs);

    EncodeResultIPDL&
    operator=(MediaResult&& aRhs);

    EncodeResultIPDL&
    operator=(const EncodeCompletionIPDL& aRhs);

    EncodeResultIPDL&
    operator=(EncodeCompletionIPDL&& aRhs);

    EncodeResultIPDL&
    operator=(const EncodeResultIPDL& aRhs);

    EncodeResultIPDL&
    operator=(EncodeResultIPDL&& aRhs);

    MediaResult&
    get_MediaResult()
    {
        AssertSanity(TMediaResult);
        return (*(ptr_MediaResult()));
    }
    const MediaResult&
    get_MediaResult() const
    {
        AssertSanity(TMediaResult);
        return (*(constptr_MediaResult()));
    }
    operator MediaResult&()
    {
        return get_MediaResult();
    }
    operator const MediaResult&() const
    {
        return get_MediaResult();
    }

    EncodeCompletionIPDL&
    get_EncodeCompletionIPDL()
    {
        AssertSanity(TEncodeCompletionIPDL);
        return (*(ptr_EncodeCompletionIPDL()));
    }
    const EncodeCompletionIPDL&
    get_EncodeCompletionIPDL() const
    {
        AssertSanity(TEncodeCompletionIPDL);
        return (*(constptr_EncodeCompletionIPDL()));
    }
    operator EncodeCompletionIPDL&()
    {
        return get_EncodeCompletionIPDL();
    }
    operator const EncodeCompletionIPDL&() const
    {
        return get_EncodeCompletionIPDL();
    }

private:
    union {
        MediaResult mVMediaResult;
        EncodeCompletionIPDL mVEncodeCompletionIPDL;
    };
    Type mType;
};
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::EncodeResultIPDL>
{
    typedef ::mozilla::EncodeResultIPDL paramType;
    static void
    Write(
            IPC::MessageWriter* aWriter,
            const paramType& aVar);
    static IPC::ReadResult<paramType>
    Read(IPC::MessageReader* aReader);
};
} // namespace IPC

namespace mozilla {
class PRemoteEncoderParent;
} // namespace mozilla
namespace mozilla {
class PRemoteEncoderChild;
} // namespace mozilla

//-----------------------------------------------------------------------------
// Code common to PRemoteEncoderChild and PRemoteEncoderParent
//
namespace mozilla {
namespace PRemoteEncoder {

nsresult
CreateEndpoints(
        mozilla::ipc::EndpointProcInfo aParentDestInfo,
        mozilla::ipc::EndpointProcInfo aChildDestInfo,
        mozilla::ipc::Endpoint<::mozilla::PRemoteEncoderParent>* aParent,
        mozilla::ipc::Endpoint<::mozilla::PRemoteEncoderChild>* aChild);

enum MessageType {
    PRemoteEncoderStart = PRemoteEncoderMsgStart << 16,
    Msg_Construct__ID,
    Reply_Construct__ID,
    Msg_Init__ID,
    Reply_Init__ID,
    Msg_Encode__ID,
    Reply_Encode__ID,
    Msg_Reconfigure__ID,
    Reply_Reconfigure__ID,
    Msg_Drain__ID,
    Reply_Drain__ID,
    Msg_ReleaseTicket__ID,
    Msg_Shutdown__ID,
    Reply_Shutdown__ID,
    Msg_SetBitrate__ID,
    Reply_SetBitrate__ID,
    Msg___delete____ID,
    Reply___delete____ID,
    PRemoteEncoderEnd
};

mozilla::UniquePtr<IPC::Message>
Msg_Construct(IPC::Message::routeid_t routingId);
mozilla::UniquePtr<IPC::Message>
Reply_Construct(IPC::Message::routeid_t routingId);

mozilla::UniquePtr<IPC::Message>
Msg_Init(IPC::Message::routeid_t routingId);
mozilla::UniquePtr<IPC::Message>
Reply_Init(IPC::Message::routeid_t routingId);

mozilla::UniquePtr<IPC::Message>
Msg_Encode(IPC::Message::routeid_t routingId);
mozilla::UniquePtr<IPC::Message>
Reply_Encode(IPC::Message::routeid_t routingId);

mozilla::UniquePtr<IPC::Message>
Msg_Reconfigure(IPC::Message::routeid_t routingId);
mozilla::UniquePtr<IPC::Message>
Reply_Reconfigure(IPC::Message::routeid_t routingId);

mozilla::UniquePtr<IPC::Message>
Msg_Drain(IPC::Message::routeid_t routingId);
mozilla::UniquePtr<IPC::Message>
Reply_Drain(IPC::Message::routeid_t routingId);

mozilla::UniquePtr<IPC::Message>
Msg_ReleaseTicket(IPC::Message::routeid_t routingId);

mozilla::UniquePtr<IPC::Message>
Msg_Shutdown(IPC::Message::routeid_t routingId);
mozilla::UniquePtr<IPC::Message>
Reply_Shutdown(IPC::Message::routeid_t routingId);

mozilla::UniquePtr<IPC::Message>
Msg_SetBitrate(IPC::Message::routeid_t routingId);
mozilla::UniquePtr<IPC::Message>
Reply_SetBitrate(IPC::Message::routeid_t routingId);

mozilla::UniquePtr<IPC::Message>
Msg___delete__(IPC::Message::routeid_t routingId);
mozilla::UniquePtr<IPC::Message>
Reply___delete__(IPC::Message::routeid_t routingId);



} // namespace PRemoteEncoder
} // namespace mozilla

#endif // ifndef PRemoteEncoder_h
