Program Listing for File stream-preprocessor.h

Return to documentation for file (include\playback\stream-preprocessor.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 <memory>

namespace gpa {
namespace playback {

class Callable;
class StreamData;
class CallableCache;
class StreamDataBookmark;

struct IStreamProcesssor
{
    virtual void OnTargetRangeBegin() = 0;
    virtual void OnProcessingEnd() = 0;
    virtual void Process(Callable& callable) = 0;
    virtual ~IStreamProcesssor() = default;
};

class StreamPreprocessor
{
public:
    StreamPreprocessor(StreamData& streamData, StreamDataBookmark const* rangeBegin = nullptr,
                       StreamDataBookmark const* rangeEnd = nullptr, uint64_t targetQueueId = 0);
    StreamPreprocessor(StreamPreprocessor&& other) noexcept;
    StreamPreprocessor& operator=(StreamPreprocessor&& other) noexcept;
    ~StreamPreprocessor();

    void AddPreprocessor(IStreamProcesssor& preprocessor);
    void Process();
    const CallableCache& GetRangeCache() const;

private:
    class StreamPreprocessorImpl;
    std::unique_ptr<StreamPreprocessorImpl> mImpl;
};

}  // namespace playback
}  // namespace gpa