#ifndef CAMERA_HAL_ICAMERA_DEVICE_SESSION_H
#define CAMERA_HAL_ICAMERA_DEVICE_SESSION_H

#include "types.h"
#include <cstdint>

namespace camera_hal {

// ICameraDeviceSession AIDL v4 interface
// Mirrors: hardware/interfaces/camera/device/aidl/android/hardware/camera/device/ICameraDeviceSession.aidl
class ICameraDeviceSession {
public:
    virtual ~ICameraDeviceSession() = default;

    virtual int32_t configureStreams(
        const Stream* streams,
        int32_t stream_count,
        StreamConfigurationMode mode,
        HalStreamConfiguration* out_config) = 0;

    virtual int32_t processCaptureRequest(
        const CaptureRequest* requests,
        int32_t request_count,
        int32_t* out_num_request_processed) = 0;

    virtual int32_t flush() = 0;
    virtual int32_t close() = 0;
    virtual int32_t signalStreamFlush(const int32_t* stream_ids, int32_t count) = 0;
    virtual int32_t getCaptureRequestMetadataQueue(void* queue) = 0;
    virtual int32_t getCaptureResultMetadataQueue(void* queue) = 0;
    virtual int32_t switchToOffline(
        const int32_t* streams_to_keep,
        int32_t count,
        void* out_offline_session) = 0;
    virtual int32_t isReconfigurationRequired(
        const void* old_session_params,
        const void* new_session_params,
        bool* out_required) = 0;
};

// Function pointer types for dlsym
typedef int32_t (*ICameraDeviceSession_configureStreams_t)(
    void* self,
    const Stream* streams,
    int32_t stream_count,
    StreamConfigurationMode mode,
    HalStreamConfiguration* out_config);

typedef int32_t (*ICameraDeviceSession_processCaptureRequest_t)(
    void* self,
    const CaptureRequest* requests,
    int32_t request_count,
    int32_t* out_num_request_processed);

typedef int32_t (*ICameraDeviceSession_flush_t)(void* self);
typedef int32_t (*ICameraDeviceSession_close_t)(void* self);

} // namespace camera_hal

#endif // CAMERA_HAL_ICAMERA_DEVICE_SESSION_H
