You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Merge branch 'clip-refactor-keyframes' of https://github.com/OpenShot/libopenshot into clip-refactor-keyframes
This commit is contained in:
@@ -111,16 +111,10 @@ namespace openshot
|
||||
openshot::ReaderInfo info;
|
||||
|
||||
/// Parent clip object of this reader (which can be unparented and NULL)
|
||||
inline openshot::ClipBase* GetParentClip() { return parent; };
|
||||
|
||||
/// Deprecated alias for GetParentClip()
|
||||
inline openshot::ClipBase* GetClip() { return parent; };
|
||||
openshot::ClipBase* ParentClip();
|
||||
|
||||
/// Set parent clip object of this reader
|
||||
inline void SetParentClip(openshot::ClipBase* clip) { parent = clip; };
|
||||
|
||||
/// Deprecated alias for SetParentClip()
|
||||
inline void SetClip(openshot::ClipBase* clip) { parent = clip; };
|
||||
void ParentClip(openshot::ClipBase* new_clip);
|
||||
|
||||
/// Close the reader (and any resources it was consuming)
|
||||
virtual void Close() = 0;
|
||||
|
||||
@@ -160,7 +160,7 @@ Clip::Clip(ReaderBase* new_reader) : resampler(NULL), reader(new_reader), alloca
|
||||
// Update duration and set parent
|
||||
if (reader) {
|
||||
End(reader->info.duration);
|
||||
reader->SetParentClip(this);
|
||||
reader->ParentClip(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,7 +217,7 @@ Clip::Clip(std::string path) : resampler(NULL), reader(NULL), allocated_reader(N
|
||||
// Update duration and set parent
|
||||
if (reader) {
|
||||
End(reader->info.duration);
|
||||
reader->SetParentClip(this);
|
||||
reader->ParentClip(this);
|
||||
allocated_reader = reader;
|
||||
// Init reader info struct and cache size
|
||||
init_reader_settings(); }
|
||||
@@ -246,7 +246,7 @@ void Clip::Reader(ReaderBase* new_reader)
|
||||
reader = new_reader;
|
||||
|
||||
// set parent
|
||||
reader->SetParentClip(this);
|
||||
reader->ParentClip(this);
|
||||
|
||||
// Init reader info struct and cache size
|
||||
init_reader_settings();
|
||||
@@ -1062,7 +1062,7 @@ void Clip::SetJsonValue(const Json::Value root) {
|
||||
|
||||
// mark as managed reader and set parent
|
||||
if (reader) {
|
||||
reader->SetParentClip(this);
|
||||
reader->ParentClip(this);
|
||||
allocated_reader = reader;
|
||||
}
|
||||
|
||||
|
||||
@@ -1271,7 +1271,7 @@ void FFmpegReader::ProcessVideoPacket(int64_t requested_frame) {
|
||||
int max_width = info.width;
|
||||
int max_height = info.height;
|
||||
|
||||
Clip *parent = (Clip *) GetParentClip();
|
||||
Clip *parent = (Clip *) ParentClip();
|
||||
if (parent) {
|
||||
if (parent->ParentTimeline()) {
|
||||
// Set max width/height based on parent clip's timeline (if attached to a timeline)
|
||||
|
||||
@@ -221,7 +221,8 @@ std::shared_ptr<QImage> Frame::GetWaveform(int width, int height, int Red, int G
|
||||
}
|
||||
|
||||
// Create blank image
|
||||
wave_image = std::make_shared<QImage>(total_width, total_height, QImage::Format_RGBA8888_Premultiplied);
|
||||
wave_image = std::make_shared<QImage>(
|
||||
total_width, total_height, QImage::Format_RGBA8888_Premultiplied);
|
||||
wave_image->fill(QColor(0,0,0,0));
|
||||
|
||||
// Load QPainter with wave_image device
|
||||
@@ -836,7 +837,8 @@ void Frame::AddImage(std::shared_ptr<QImage> new_image, bool only_odd_lines)
|
||||
ret = true;
|
||||
}
|
||||
else if (new_image->format() != QImage::Format_RGBA8888_Premultiplied) {
|
||||
new_image = std::make_shared<QImage>(new_image->convertToFormat(QImage::Format_RGBA8888_Premultiplied));
|
||||
new_image = std::make_shared<QImage>(
|
||||
new_image->convertToFormat(QImage::Format_RGBA8888_Premultiplied));
|
||||
}
|
||||
}
|
||||
if (ret) {
|
||||
|
||||
@@ -174,7 +174,7 @@ std::shared_ptr<Frame> QtImageReader::GetFrame(int64_t requested_frame)
|
||||
int max_width = info.width;
|
||||
int max_height = info.height;
|
||||
|
||||
Clip* parent = (Clip*) GetParentClip();
|
||||
Clip* parent = (Clip*) ParentClip();
|
||||
if (parent) {
|
||||
if (parent->ParentTimeline()) {
|
||||
// Set max width/height based on parent clip's timeline (if attached to a timeline)
|
||||
|
||||
Reference in New Issue
Block a user