Program Listing for File capture-stream-events.h

Return to documentation for file (include\runtime\capture-stream-events.h)

/******************************************************************************
© Intel Corporation.

This software and the related documents are Intel copyrighted materials,
and your use of them is governed by the express license under which they
were provided to you ("License"). Unless the License provides otherwise,
you may not use, modify, copy, publish, distribute, disclose or transmit
this software or the related documents without Intel's prior written
permission.


 This software and the related documents are provided as is, with no express
or implied warranties, other than those that are expressly stated in the
License.

******************************************************************************/

#pragma once

#include "igpa-config.h"

#include "runtime/event-data.h"
#include "utility/common.h"

namespace gpa {
namespace common {

class CaptureStreamOpenedEvent : public runtime::EventData
{
public:
    GPA_EVENT_CLASS(CaptureStreamOpenedEvent)

    TCHAR const* GetStreamPath() const;
    void SetStreamPath(TCHAR const* path);
    bool GetDeferred() const;
    void SetDeferred(bool deferred);

protected:
    // EventData implementation
    size_t Write(serialization::Serializer*) const override;
    size_t Read(serialization::Serializer*) override;
    uint64_t CalculatePayloadSize() const override;

private:
    TCHAR mStreamPath[kMaxPathLength]{};
    bool mIsDeferred = false;
};

class CaptureStreamClosedEvent : public runtime::EventData
{
public:
    GPA_EVENT_CLASS(CaptureStreamClosedEvent)
};

// Request for capture layer to start capturing stream.
// It provides stream path which overrides target directory only for this request (sOutputDirectory is ignored).
// It is used by ConnectionLayer to initiate FrameDX12 capture with specified stream directory.
class ToggleStreamCaptureRequest : public runtime::EventData
{
public:
    GPA_EVENT_CLASS(ToggleStreamCaptureRequest)

    TCHAR const* GetStreamPath() const;
    void SetStreamPath(TCHAR const* path);

protected:
    // EventData implementation
    size_t Write(serialization::Serializer*) const override;
    size_t Read(serialization::Serializer*) override;
    uint64_t CalculatePayloadSize() const override;

private:
    // Override stream path directory (directory in which data files are written)
    TCHAR mStreamPath[kMaxPathLength]{};
};

class CaptureStreamOpenFailedEvent : public runtime::EventData
{
public:
    GPA_EVENT_CLASS(CaptureStreamOpenFailedEvent)

    enum Reason {
        UNKNOWN,
        ACCESS_DENIED,
    };

    Reason GetFailureReason() const;
    void SetFailureReason(Reason reason);

private:
    Reason mReason = UNKNOWN;
};

class ImmediateScreenshotRequest : public runtime::EventData
{
public:
    GPA_EVENT_CLASS(ImmediateScreenshotRequest)

    TCHAR const* GetScreenshotDir() const;
    TCHAR const* GetScreenshotName() const;

    void SetScreenshotDir(TCHAR const* dir);
    void SetScreenshotName(TCHAR const* name);

private:
    TCHAR mScreenshotDir[kMaxPathLength]{};
    TCHAR mScreenshotName[kMaxPathLength]{};
};

}  // namespace common
}  // namespace gpa