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

#ifndef PRemoteMediaManager_h
#define PRemoteMediaManager_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 "MediaInfo.h"
#include "mozilla/ipc/IPDLStructMember.h"
#include "mozilla/layers/LayersSurfaces.h"
#include "mozilla/PMediaDecoderParams.h"


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

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

    MOZ_IMPLICIT VideoDecoderInfoIPDL(
            const VideoInfo& _videoInfo,
            const float& _framerate) :
        videoInfo_(_videoInfo),
        framerate_(_framerate)
    {
    }

    MOZ_IMPLICIT VideoDecoderInfoIPDL(
            VideoInfo&& _videoInfo,
            float&& _framerate) :
        videoInfo_(std::move(_videoInfo)),
        framerate_(std::move(_framerate))
    {
    }

    VideoInfo&
    videoInfo()
    {
        return videoInfo_;
    }
    const VideoInfo&
    videoInfo() const
    {
        return videoInfo_;
    }

    float&
    framerate()
    {
        return framerate_;
    }
    const float&
    framerate() const
    {
        return framerate_;
    }

private:
    ::mozilla::ipc::IPDLStructMember<VideoInfo> videoInfo_;
    ::mozilla::ipc::IPDLStructMember<float> framerate_;
};
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::VideoDecoderInfoIPDL>
{
    typedef ::mozilla::VideoDecoderInfoIPDL 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 RemoteDecoderInfoIPDL|
//
namespace mozilla {
class RemoteDecoderInfoIPDL final
{
public:
    enum Type {
        T__None,
        TAudioInfo = 1,
        TVideoDecoderInfoIPDL,
        T__Last = TVideoDecoderInfoIPDL
    };

private:
    typedef ::mozilla::AudioInfo AudioInfo;
    typedef ::mozilla::VideoDecoderInfoIPDL VideoDecoderInfoIPDL;
    typedef AudioInfo AudioInfo__tdef;
    typedef VideoDecoderInfoIPDL VideoDecoderInfoIPDL__tdef;

    AudioInfo*
    ptr_AudioInfo()
    {
        return (&(mVAudioInfo));
    }
    const AudioInfo*
    constptr_AudioInfo() const
    {
        return (&(mVAudioInfo));
    }
    VideoDecoderInfoIPDL*
    ptr_VideoDecoderInfoIPDL()
    {
        return (&(mVVideoDecoderInfoIPDL));
    }
    const VideoDecoderInfoIPDL*
    constptr_VideoDecoderInfoIPDL() const
    {
        return (&(mVVideoDecoderInfoIPDL));
    }

    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 RemoteDecoderInfoIPDL() :
        mType(T__None)
    {
    }

    MOZ_IMPLICIT RemoteDecoderInfoIPDL(const AudioInfo& aOther);

    MOZ_IMPLICIT RemoteDecoderInfoIPDL(AudioInfo&& aOther);

    MOZ_IMPLICIT RemoteDecoderInfoIPDL(const VideoDecoderInfoIPDL& aOther);

    MOZ_IMPLICIT RemoteDecoderInfoIPDL(VideoDecoderInfoIPDL&& aOther);

    MOZ_IMPLICIT RemoteDecoderInfoIPDL(const RemoteDecoderInfoIPDL& aOther);

    MOZ_IMPLICIT RemoteDecoderInfoIPDL(RemoteDecoderInfoIPDL&& aOther);

    ~RemoteDecoderInfoIPDL();

    Type
    type() const
    {
        return mType;
    }

    RemoteDecoderInfoIPDL&
    operator=(const AudioInfo& aRhs);

    RemoteDecoderInfoIPDL&
    operator=(AudioInfo&& aRhs);

    RemoteDecoderInfoIPDL&
    operator=(const VideoDecoderInfoIPDL& aRhs);

    RemoteDecoderInfoIPDL&
    operator=(VideoDecoderInfoIPDL&& aRhs);

    RemoteDecoderInfoIPDL&
    operator=(const RemoteDecoderInfoIPDL& aRhs);

    RemoteDecoderInfoIPDL&
    operator=(RemoteDecoderInfoIPDL&& aRhs);

    AudioInfo&
    get_AudioInfo()
    {
        AssertSanity(TAudioInfo);
        return (*(ptr_AudioInfo()));
    }
    const AudioInfo&
    get_AudioInfo() const
    {
        AssertSanity(TAudioInfo);
        return (*(constptr_AudioInfo()));
    }
    operator AudioInfo&()
    {
        return get_AudioInfo();
    }
    operator const AudioInfo&() const
    {
        return get_AudioInfo();
    }

    VideoDecoderInfoIPDL&
    get_VideoDecoderInfoIPDL()
    {
        AssertSanity(TVideoDecoderInfoIPDL);
        return (*(ptr_VideoDecoderInfoIPDL()));
    }
    const VideoDecoderInfoIPDL&
    get_VideoDecoderInfoIPDL() const
    {
        AssertSanity(TVideoDecoderInfoIPDL);
        return (*(constptr_VideoDecoderInfoIPDL()));
    }
    operator VideoDecoderInfoIPDL&()
    {
        return get_VideoDecoderInfoIPDL();
    }
    operator const VideoDecoderInfoIPDL&() const
    {
        return get_VideoDecoderInfoIPDL();
    }

private:
    union {
        AudioInfo mVAudioInfo;
        VideoDecoderInfoIPDL mVVideoDecoderInfoIPDL;
    };
    Type mType;
};
} // namespace mozilla

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

namespace mozilla {
class PRemoteMediaManagerParent;
} // namespace mozilla
namespace mozilla {
class PRemoteMediaManagerChild;
} // namespace mozilla

//-----------------------------------------------------------------------------
// Code common to PRemoteMediaManagerChild and PRemoteMediaManagerParent
//
namespace mozilla {
namespace PRemoteMediaManager {

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

enum MessageType {
    PRemoteMediaManagerStart = PRemoteMediaManagerMsgStart << 16,
    Msg_PRemoteDecoderConstructor__ID,
    Reply_PRemoteDecoderConstructor__ID,
    Msg_PRemoteEncoderConstructor__ID,
    Reply_PRemoteEncoderConstructor__ID,
    Msg_PRemoteCDMConstructor__ID,
    Reply_PRemoteCDMConstructor__ID,
    Msg_Readback__ID,
    Reply_Readback__ID,
    Msg_DeallocateSurfaceDescriptorGPUVideo__ID,
    Msg_OnSetCurrent__ID,
    PRemoteMediaManagerEnd
};

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

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

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

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

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

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



} // namespace PRemoteMediaManager
} // namespace mozilla

#endif // ifndef PRemoteMediaManager_h
