31 #ifndef OPENSHOT_FRAMEMAPPER_H
32 #define OPENSHOT_FRAMEMAPPER_H
79 Field(int64_t frame,
bool isodd)
147 float parent_position;
152 void AddField(int64_t frame);
153 void AddField(
Field field);
156 std::shared_ptr<Frame> GetOrCreateFrame(int64_t number);
159 int64_t AdjustFrameNumber(int64_t clip_frame_number);
182 void Close()
override;
196 std::shared_ptr<Frame>
GetFrame(int64_t requested_frame)
override;
202 std::string
Name()
override {
return "FrameMapper"; };
205 std::string
Json()
const override;
206 void SetJson(
const std::string value)
override;
211 void Open()
override;
Header file for CacheMemory class.
Header file for FFmpegUtilities.
Header file for Fraction class.
Header file for Frame class.
Header file for the Keyframe class.
Header file for OpenMPUtilities (set some common macros)
Header file for ReaderBase class.
This class is a memory-based cache manager for Frame objects.
This class represents a fraction.
This class creates a mapping between 2 different frame rates, applying a specific pull-down technique...
CacheMemory * GetCache() override
Get the cache object used by this reader.
std::shared_ptr< Frame > GetFrame(int64_t requested_frame) override
This method is required for all derived classes of ReaderBase, and return the openshot::Frame object,...
void ChangeMapping(Fraction target_fps, PulldownType pulldown, int target_sample_rate, int target_channels, ChannelLayout target_channel_layout)
Change frame rate or audio mapping details.
void Reader(ReaderBase *new_reader)
Set the current reader.
MappedFrame GetMappedFrame(int64_t TargetFrameNumber)
Get a frame based on the target frame rate and the new frame number of a frame.
std::string Name() override
Return the type name of the class.
void SetJsonValue(const Json::Value root) override
Load Json::Value into this object.
bool IsOpen() override
Determine if reader is open or closed.
std::vector< Field > fields
ReaderBase * Reader()
Get the current reader.
std::vector< MappedFrame > frames
void PrintMapping()
Print all of the original frames and which new frames they map to.
void ResampleMappedAudio(std::shared_ptr< Frame > frame, int64_t original_frame_number)
Resample audio and map channels (if needed)
void Open() override
Open the internal reader.
void Close() override
Close the openshot::FrameMapper and internal reader.
std::string Json() const override
Generate JSON string of this object.
FrameMapper(ReaderBase *reader, Fraction target_fps, PulldownType target_pulldown, int target_sample_rate, int target_channels, ChannelLayout target_channel_layout)
Default constructor for openshot::FrameMapper class.
void SetJson(const std::string value) override
Load JSON string into this object.
Json::Value JsonValue() const override
Generate Json::Value for this object.
virtual ~FrameMapper()
Destructor.
This class represents a single frame of video (i.e. image & audio data)
This abstract class is the base class, used by all readers in libopenshot.
This namespace is the default namespace for all code in the openshot library.
PulldownType
This enumeration determines how frame rates are increased or decreased.
@ PULLDOWN_CLASSIC
Classic 2:3:2:3 pull-down.
@ PULLDOWN_ADVANCED
Advanced 2:3:3:2 pull-down (minimal dirty frames)
@ PULLDOWN_NONE
Do not apply pull-down techniques, just repeat or skip entire frames.
ChannelLayout
This enumeration determines the audio channel layout (such as stereo, mono, 5 point surround,...
This struct holds a single field (half a frame).
Field(int64_t frame, bool isodd)
This struct holds two fields which together make up a complete video frame.
This struct holds a the range of samples needed by this frame.