Loading...
Searching...
No Matches
DummyReader.h
Go to the documentation of this file.
// Copyright (c) 2008-2019 OpenShot Studios, LLC
//
// SPDX-License-Identifier: LGPL-3.0-or-later
#ifndef OPENSHOT_DUMMY_READER_H
#define OPENSHOT_DUMMY_READER_H
#include "ReaderBase.h"
#include <cmath>
#include <ctime>
#include <iostream>
#include <omp.h>
#include <stdio.h>
#include <memory>
#include "CacheMemory.h"
#include "Fraction.h"
namespace openshot
{
class DummyReader : public ReaderBase
{
private:
CacheBase* dummy_cache;
std::shared_ptr<openshot::Frame> image_frame;
std::shared_ptr<openshot::Frame> last_cached_frame;
bool is_open;
void init(Fraction fps, int width, int height, int sample_rate, int channels, float duration);
public:
DummyReader();
DummyReader(openshot::Fraction fps, int width, int height, int sample_rate, int channels, float duration);
DummyReader(openshot::Fraction fps, int width, int height, int sample_rate, int channels, float duration, CacheBase* cache);
virtual ~DummyReader();
void Close() override;
CacheMemory* GetCache() override { return NULL; };
std::shared_ptr<openshot::Frame> GetFrame(int64_t requested_frame) override;
bool IsOpen() override { return is_open; };
std::string Name() override { return "DummyReader"; };
// Get and Set JSON methods
std::string Json() const override;
void SetJson(const std::string value) override;
Json::Value JsonValue() const override;
void SetJsonValue(const Json::Value root) override;
void Open() override;
};
}
#endif
CacheMemory.h
Header file for CacheMemory class.
Fraction.h
Header file for Fraction class.
ReaderBase.h
Header file for ReaderBase class.
openshot::CacheBase
All cache managers in libopenshot are based on this CacheBase class.
Definition CacheBase.h:35
openshot::CacheMemory
This class is a memory-based cache manager for Frame objects.
Definition CacheMemory.h:29
openshot::DummyReader
This class is used as a simple, dummy reader, which can be very useful when writing unit tests....
Definition DummyReader.h:86
openshot::DummyReader::IsOpen
bool IsOpen() override
Determine if reader is open or closed.
Definition DummyReader.h:123
openshot::DummyReader::DummyReader
DummyReader()
Blank constructor for DummyReader, with default settings.
Definition DummyReader.cpp:50
openshot::DummyReader::GetFrame
std::shared_ptr< openshot::Frame > GetFrame(int64_t requested_frame) override
Definition DummyReader.cpp:105
openshot::DummyReader::SetJson
void SetJson(const std::string value) override
Load JSON string into this object.
Definition DummyReader.cpp:167
openshot::DummyReader::JsonValue
Json::Value JsonValue() const override
Generate Json::Value for this object.
Definition DummyReader.cpp:156
openshot::DummyReader::Json
std::string Json() const override
Generate JSON string of this object.
Definition DummyReader.cpp:149
openshot::DummyReader::~DummyReader
virtual ~DummyReader()
Definition DummyReader.cpp:75
openshot::DummyReader::Open
void Open() override
Open File - which is called by the constructor automatically.
Definition DummyReader.cpp:79
openshot::DummyReader::GetCache
CacheMemory * GetCache() override
Get the cache object used by this reader (always returns NULL for this reader)
Definition DummyReader.h:113
openshot::DummyReader::Close
void Close() override
Close File.
Definition DummyReader.cpp:93
openshot::DummyReader::Name
std::string Name() override
Return the type name of the class.
Definition DummyReader.h:126
openshot::DummyReader::SetJsonValue
void SetJsonValue(const Json::Value root) override
Load Json::Value into this object.
Definition DummyReader.cpp:184
openshot::Fraction
This class represents a fraction.
Definition Fraction.h:30
openshot::ReaderBase
This abstract class is the base class, used by all readers in libopenshot.
Definition ReaderBase.h:76
openshot
This namespace is the default namespace for all code in the openshot library.
Definition Compressor.h:29