From dac2c9a58c2ebefed4212ec0e49d072b859dc502 Mon Sep 17 00:00:00 2001 From: Jeff Shillitto Date: Sat, 15 Dec 2018 21:55:00 +1100 Subject: [PATCH 01/10] Add a text background colored box option to the text reader --- include/TextReader.h | 7 ++++++- src/TextReader.cpp | 15 +++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/include/TextReader.h b/include/TextReader.h index d7d653d2..8e0bc18d 100644 --- a/include/TextReader.h +++ b/include/TextReader.h @@ -90,6 +90,7 @@ namespace openshot double size; string text_color; string background_color; + string text_background_color; std::shared_ptr image; list lines; bool is_open; @@ -110,9 +111,13 @@ namespace openshot /// @param font The font of the text /// @param size The size of the text /// @param text_color The color of the text - /// @param background_color The background color of the text (also supports Transparent) + /// @param background_color The background color of the text frame image (also supports Transparent) TextReader(int width, int height, int x_offset, int y_offset, GravityType gravity, string text, string font, double size, string text_color, string background_color); + /// Draw a box under rendered text using the specified color. + /// @param text_background_color The background color behind the text + void SetTextBackgroundColor(string color); + /// Close Reader void Close(); diff --git a/src/TextReader.cpp b/src/TextReader.cpp index 8234aa5d..245ca6a8 100644 --- a/src/TextReader.cpp +++ b/src/TextReader.cpp @@ -45,6 +45,14 @@ TextReader::TextReader(int width, int height, int x_offset, int y_offset, Gravit Close(); } +void TextReader::SetTextBackgroundColor(string color) { + text_background_color = color; + + // Open and Close the reader, to populate it's attributes (such as height, width, etc...) plus the text background color + Open(); + Close(); +} + // Open reader void TextReader::Open() { @@ -97,6 +105,10 @@ void TextReader::Open() lines.push_back(Magick::DrawablePointSize(size)); lines.push_back(Magick::DrawableText(x_offset, y_offset, text)); + if (!text_background_color.empty()) { + lines.push_back(Magick::DrawableTextUnderColor(Magick::Color(text_background_color))); + } + // Draw image image->draw(lines); @@ -190,6 +202,7 @@ Json::Value TextReader::JsonValue() { root["size"] = size; root["text_color"] = text_color; root["background_color"] = background_color; + root["text_background_color"] = text_background_color; root["gravity"] = gravity; // return JsonValue @@ -244,6 +257,8 @@ void TextReader::SetJsonValue(Json::Value root) { text_color = root["text_color"].asString(); if (!root["background_color"].isNull()) background_color = root["background_color"].asString(); + if (!root["text_background_color"].isNull()) + text_background_color = root["text_background_color"].asString(); if (!root["gravity"].isNull()) gravity = (GravityType) root["gravity"].asInt(); From 650d3ec820b3a14d77d2d3642dfacd2be7dbffe0 Mon Sep 17 00:00:00 2001 From: Chris Kirmse Date: Thu, 14 Mar 2019 09:26:56 -0700 Subject: [PATCH 02/10] fix grammar error with possessive its and update sample for audio parameter --- CMakeLists.txt | 8 ++++---- include/Clip.h | 4 ++-- include/EffectBase.h | 2 +- include/FFmpegReader.h | 8 ++++---- include/FFmpegWriter.h | 4 ++-- include/Frame.h | 2 +- include/ImageReader.h | 2 +- include/ImageWriter.h | 2 +- include/QtImageReader.h | 2 +- include/Timeline.h | 1 + include/effects/Bars.h | 2 +- include/effects/Blur.h | 2 +- include/effects/Brightness.h | 2 +- include/effects/ChromaKey.h | 2 +- include/effects/ColorShift.h | 2 +- include/effects/Crop.h | 2 +- include/effects/Deinterlace.h | 2 +- include/effects/Hue.h | 2 +- include/effects/Mask.h | 2 +- include/effects/Negate.h | 2 +- include/effects/Pixelate.h | 2 +- include/effects/Saturation.h | 2 +- include/effects/Shift.h | 2 +- include/effects/Wave.h | 2 +- src/ChunkReader.cpp | 2 +- src/Clip.cpp | 2 +- src/DummyReader.cpp | 2 +- src/FFmpegReader.cpp | 10 +++++----- src/Frame.cpp | 2 +- src/ImageReader.cpp | 6 +++--- src/QtImageReader.cpp | 6 +++--- src/TextReader.cpp | 4 ++-- 32 files changed, 49 insertions(+), 48 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index eaf7d65f..a4926953 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,8 +6,8 @@ # # Copyright (c) 2008-2014 OpenShot Studios, LLC # . This file is part of -# OpenShot Library (libopenshot), an open-source project dedicated to -# delivering high quality video editing and animation solutions to the +# OpenShot Library (libopenshot), an open-source project dedicated to +# delivering high quality video editing and animation solutions to the # world. For more information visit . # # OpenShot Library (libopenshot) is free software: you can redistribute it @@ -41,8 +41,8 @@ MESSAGE("Determining Version Number (from Version.h file)") #### Get the lines related to libopenshot version from the Version.h header file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/include/Version.h OPENSHOT_VERSION_LINES REGEX "#define[ ]+OPENSHOT_VERSION_.*[0-9]+;.*") - -#### Set each line into it's own variable + +#### Set each line into its own variable list (GET OPENSHOT_VERSION_LINES 0 LINE_MAJOR) list (GET OPENSHOT_VERSION_LINES 1 LINE_MINOR) list (GET OPENSHOT_VERSION_LINES 2 LINE_BUILD) diff --git a/include/Clip.h b/include/Clip.h index 3cd33b3a..83387fac 100644 --- a/include/Clip.h +++ b/include/Clip.h @@ -142,8 +142,8 @@ namespace openshot { void reverse_buffer(juce::AudioSampleBuffer* buffer); public: - GravityType gravity; ///< The gravity of a clip determines where it snaps to it's parent - ScaleType scale; ///< The scale determines how a clip should be resized to fit it's parent + GravityType gravity; ///< The gravity of a clip determines where it snaps to its parent + ScaleType scale; ///< The scale determines how a clip should be resized to fit its parent AnchorType anchor; ///< The anchor determines what parent a clip should snap to FrameDisplayType display; ///< The format to display the frame number (if any) VolumeMixType mixing; ///< What strategy should be followed when mixing audio with other clips diff --git a/include/EffectBase.h b/include/EffectBase.h index 209369a8..8df7fabf 100644 --- a/include/EffectBase.h +++ b/include/EffectBase.h @@ -82,7 +82,7 @@ namespace openshot /// modified openshot::Frame object /// /// The frame object is passed into this method, and a frame_number is passed in which - /// tells the effect which settings to use from it's keyframes (starting at 1). + /// tells the effect which settings to use from its keyframes (starting at 1). /// /// @returns The modified openshot::Frame object /// @param frame The frame object that needs the effect applied to it diff --git a/include/FFmpegReader.h b/include/FFmpegReader.h index eaa45943..f24dac9f 100644 --- a/include/FFmpegReader.h +++ b/include/FFmpegReader.h @@ -150,7 +150,7 @@ namespace openshot /// Check the current seek position and determine if we need to seek again bool CheckSeek(bool is_video); - /// Check if a frame is missing and attempt to replace it's frame image (and + /// Check if a frame is missing and attempt to replace its frame image (and bool CheckMissingFrame(int64_t requested_frame); /// Check the working queue, and move finished frames to the finished queue @@ -198,10 +198,10 @@ namespace openshot /// Read the stream until we find the requested Frame std::shared_ptr ReadStream(int64_t requested_frame); - /// Remove AVFrame from cache (and deallocate it's memory) + /// Remove AVFrame from cache (and deallocate its memory) void RemoveAVFrame(AVFrame*); - /// Remove AVPacket from cache (and deallocate it's memory) + /// Remove AVPacket from cache (and deallocate its memory) void RemoveAVPacket(AVPacket*); /// Seek to a specific Frame. This is not always frame accurate, it's more of an estimation on many codecs. @@ -228,7 +228,7 @@ namespace openshot /// frame 1, or it throws one of the following exceptions. FFmpegReader(string path); - /// Constructor for FFmpegReader. This only opens the media file to inspect it's properties + /// Constructor for FFmpegReader. This only opens the media file to inspect its properties /// if inspect_reader=true. When not inspecting the media file, it's much faster, and useful /// when you are inflating the object using JSON after instantiating it. FFmpegReader(string path, bool inspect_reader); diff --git a/include/FFmpegWriter.h b/include/FFmpegWriter.h index e219f72c..c9351af7 100644 --- a/include/FFmpegWriter.h +++ b/include/FFmpegWriter.h @@ -83,7 +83,7 @@ namespace openshot * FFmpegWriter w("/home/jonathan/NewVideo.webm"); * * // Set options - * w.SetAudioOptions(true, "libvorbis", 44100, 2, 128000); // Sample Rate: 44100, Channels: 2, Bitrate: 128000 + * w.SetAudioOptions(true, "libvorbis", 44100, 2, ChannelLayout::LAYOUT_STEREO, 128000); // Sample Rate: 44100, Channels: 2, Bitrate: 128000 * w.SetVideoOptions(true, "libvpx", openshot::Fraction(24,1), 720, 480, openshot::Fraction(1,1), false, false, 300000); // FPS: 24, Size: 720x480, Pixel Ratio: 1/1, Bitrate: 300000 * * // Open the writer @@ -110,7 +110,7 @@ namespace openshot * FFmpegWriter w("/home/jonathan/NewVideo.webm"); * * // Set options - * w.SetAudioOptions(true, "libvorbis", 44100, 2, 128000); // Sample Rate: 44100, Channels: 2, Bitrate: 128000 + * w.SetAudioOptions(true, "libvorbis", 44100, 2, ChannelLayout::LAYOUT_STEREO, 128000); // Sample Rate: 44100, Channels: 2, Bitrate: 128000 * w.SetVideoOptions(true, "libvpx", openshot::Fraction(24,1), 720, 480, openshot::Fraction(1,1), false, false, 300000); // FPS: 24, Size: 720x480, Pixel Ratio: 1/1, Bitrate: 300000 * * // Prepare Streams (Optional method that must be called before any SetOption calls) diff --git a/include/Frame.h b/include/Frame.h index eba7f8bb..f89149e2 100644 --- a/include/Frame.h +++ b/include/Frame.h @@ -197,7 +197,7 @@ namespace openshot /// Clean up buffer after QImage is deleted static void cleanUpBuffer(void *info); - /// Clear the waveform image (and deallocate it's memory) + /// Clear the waveform image (and deallocate its memory) void ClearWaveform(); /// Copy data and pointers from another Frame instance diff --git a/include/ImageReader.h b/include/ImageReader.h index e698e0c1..a44cbf07 100644 --- a/include/ImageReader.h +++ b/include/ImageReader.h @@ -77,7 +77,7 @@ namespace openshot /// frame 1, or it throws one of the following exceptions. ImageReader(string path); - /// Constructor for ImageReader. This only opens the media file to inspect it's properties + /// Constructor for ImageReader. This only opens the media file to inspect its properties /// if inspect_reader=true. When not inspecting the media file, it's much faster, and useful /// when you are inflating the object using JSON after instantiating it. ImageReader(string path, bool inspect_reader); diff --git a/include/ImageWriter.h b/include/ImageWriter.h index 25177134..ded29a5b 100644 --- a/include/ImageWriter.h +++ b/include/ImageWriter.h @@ -127,7 +127,7 @@ namespace openshot /// @param height Height in pixels of image /// @param quality Quality of image (0 to 100, 70 is default) /// @param loops Number of times to repeat the image (used on certain multi-frame image formats, such as GIF) - /// @param combine Combine frames into a single image (if possible), or save each frame as it's own image + /// @param combine Combine frames into a single image (if possible), or save each frame as its own image void SetVideoOptions(string format, Fraction fps, int width, int height, int quality, int loops, bool combine); diff --git a/include/QtImageReader.h b/include/QtImageReader.h index 6b260f15..a7be1ab6 100644 --- a/include/QtImageReader.h +++ b/include/QtImageReader.h @@ -75,7 +75,7 @@ namespace openshot /// frame 1, or it throws one of the following exceptions. QtImageReader(string path); - /// Constructor for QtImageReader. This only opens the media file to inspect it's properties + /// Constructor for QtImageReader. This only opens the media file to inspect its properties /// if inspect_reader=true. When not inspecting the media file, it's much faster, and useful /// when you are inflating the object using JSON after instantiating it. QtImageReader(string path, bool inspect_reader); diff --git a/include/Timeline.h b/include/Timeline.h index 312add2e..6fd88796 100644 --- a/include/Timeline.h +++ b/include/Timeline.h @@ -100,6 +100,7 @@ namespace openshot { * Fraction(25,1), // framerate * 44100, // sample rate * 2 // channels + * ChannelLayout::LAYOUT_STEREO, * ); * * // Create some clips diff --git a/include/effects/Bars.h b/include/effects/Bars.h index 27d21725..247a914a 100644 --- a/include/effects/Bars.h +++ b/include/effects/Bars.h @@ -80,7 +80,7 @@ namespace openshot /// modified openshot::Frame object /// /// The frame object is passed into this method, and a frame_number is passed in which - /// tells the effect which settings to use from it's keyframes (starting at 1). + /// tells the effect which settings to use from its keyframes (starting at 1). /// /// @returns The modified openshot::Frame object /// @param frame The frame object that needs the effect applied to it diff --git a/include/effects/Blur.h b/include/effects/Blur.h index 314dabbe..f72bf484 100644 --- a/include/effects/Blur.h +++ b/include/effects/Blur.h @@ -93,7 +93,7 @@ namespace openshot /// modified openshot::Frame object /// /// The frame object is passed into this method, and a frame_number is passed in which - /// tells the effect which settings to use from it's keyframes (starting at 1). + /// tells the effect which settings to use from its keyframes (starting at 1). /// /// @returns The modified openshot::Frame object /// @param frame The frame object that needs the effect applied to it diff --git a/include/effects/Brightness.h b/include/effects/Brightness.h index 67ab4c9c..eb74c58f 100644 --- a/include/effects/Brightness.h +++ b/include/effects/Brightness.h @@ -80,7 +80,7 @@ namespace openshot /// modified openshot::Frame object /// /// The frame object is passed into this method, and a frame_number is passed in which - /// tells the effect which settings to use from it's keyframes (starting at 1). + /// tells the effect which settings to use from its keyframes (starting at 1). /// /// @returns The modified openshot::Frame object /// @param frame The frame object that needs the effect applied to it diff --git a/include/effects/ChromaKey.h b/include/effects/ChromaKey.h index 000dbba4..b93b8f51 100644 --- a/include/effects/ChromaKey.h +++ b/include/effects/ChromaKey.h @@ -77,7 +77,7 @@ namespace openshot /// modified openshot::Frame object /// /// The frame object is passed into this method, and a frame_number is passed in which - /// tells the effect which settings to use from it's keyframes (starting at 1). + /// tells the effect which settings to use from its keyframes (starting at 1). /// /// @returns The modified openshot::Frame object /// @param frame The frame object that needs the effect applied to it diff --git a/include/effects/ColorShift.h b/include/effects/ColorShift.h index 4b3de2bb..88d6e4d0 100644 --- a/include/effects/ColorShift.h +++ b/include/effects/ColorShift.h @@ -84,7 +84,7 @@ namespace openshot /// modified openshot::Frame object /// /// The frame object is passed into this method, and a frame_number is passed in which - /// tells the effect which settings to use from it's keyframes (starting at 1). + /// tells the effect which settings to use from its keyframes (starting at 1). /// /// @returns The modified openshot::Frame object /// @param frame The frame object that needs the effect applied to it diff --git a/include/effects/Crop.h b/include/effects/Crop.h index 7921a78d..c9836824 100644 --- a/include/effects/Crop.h +++ b/include/effects/Crop.h @@ -80,7 +80,7 @@ namespace openshot /// modified openshot::Frame object /// /// The frame object is passed into this method, and a frame_number is passed in which - /// tells the effect which settings to use from it's keyframes (starting at 1). + /// tells the effect which settings to use from its keyframes (starting at 1). /// /// @returns The modified openshot::Frame object /// @param frame The frame object that needs the effect applied to it diff --git a/include/effects/Deinterlace.h b/include/effects/Deinterlace.h index c1fb7227..1bb29062 100644 --- a/include/effects/Deinterlace.h +++ b/include/effects/Deinterlace.h @@ -73,7 +73,7 @@ namespace openshot /// modified openshot::Frame object /// /// The frame object is passed into this method, and a frame_number is passed in which - /// tells the effect which settings to use from it's keyframes (starting at 1). + /// tells the effect which settings to use from its keyframes (starting at 1). /// /// @returns The modified openshot::Frame object /// @param frame The frame object that needs the effect applied to it diff --git a/include/effects/Hue.h b/include/effects/Hue.h index 4f680047..fa59ab4e 100644 --- a/include/effects/Hue.h +++ b/include/effects/Hue.h @@ -70,7 +70,7 @@ namespace openshot /// modified openshot::Frame object /// /// The frame object is passed into this method, and a frame_number is passed in which - /// tells the effect which settings to use from it's keyframes (starting at 1). + /// tells the effect which settings to use from its keyframes (starting at 1). /// /// @returns The modified openshot::Frame object /// @param frame The frame object that needs the effect applied to it diff --git a/include/effects/Mask.h b/include/effects/Mask.h index ef707f5f..210ffe9c 100644 --- a/include/effects/Mask.h +++ b/include/effects/Mask.h @@ -91,7 +91,7 @@ namespace openshot /// modified openshot::Frame object /// /// The frame object is passed into this method, and a frame_number is passed in which - /// tells the effect which settings to use from it's keyframes (starting at 1). + /// tells the effect which settings to use from its keyframes (starting at 1). /// /// @returns The modified openshot::Frame object /// @param frame The frame object that needs the effect applied to it diff --git a/include/effects/Negate.h b/include/effects/Negate.h index 84621132..2397e331 100644 --- a/include/effects/Negate.h +++ b/include/effects/Negate.h @@ -61,7 +61,7 @@ namespace openshot /// modified openshot::Frame object /// /// The frame object is passed into this method, and a frame_number is passed in which - /// tells the effect which settings to use from it's keyframes (starting at 1). + /// tells the effect which settings to use from its keyframes (starting at 1). /// /// @returns The modified openshot::Frame object /// @param frame The frame object that needs the effect applied to it diff --git a/include/effects/Pixelate.h b/include/effects/Pixelate.h index b8ca2998..1d62192d 100644 --- a/include/effects/Pixelate.h +++ b/include/effects/Pixelate.h @@ -79,7 +79,7 @@ namespace openshot /// modified openshot::Frame object /// /// The frame object is passed into this method, and a frame_number is passed in which - /// tells the effect which settings to use from it's keyframes (starting at 1). + /// tells the effect which settings to use from its keyframes (starting at 1). /// /// @returns The modified openshot::Frame object /// @param frame The frame object that needs the effect applied to it diff --git a/include/effects/Saturation.h b/include/effects/Saturation.h index d49069a6..f7c20341 100644 --- a/include/effects/Saturation.h +++ b/include/effects/Saturation.h @@ -77,7 +77,7 @@ namespace openshot /// modified openshot::Frame object /// /// The frame object is passed into this method, and a frame_number is passed in which - /// tells the effect which settings to use from it's keyframes (starting at 1). + /// tells the effect which settings to use from its keyframes (starting at 1). /// /// @returns The modified openshot::Frame object /// @param frame The frame object that needs the effect applied to it diff --git a/include/effects/Shift.h b/include/effects/Shift.h index 86ccf7a4..875c736b 100644 --- a/include/effects/Shift.h +++ b/include/effects/Shift.h @@ -73,7 +73,7 @@ namespace openshot /// modified openshot::Frame object /// /// The frame object is passed into this method, and a frame_number is passed in which - /// tells the effect which settings to use from it's keyframes (starting at 1). + /// tells the effect which settings to use from its keyframes (starting at 1). /// /// @returns The modified openshot::Frame object /// @param frame The frame object that needs the effect applied to it diff --git a/include/effects/Wave.h b/include/effects/Wave.h index 04c1620f..11047097 100644 --- a/include/effects/Wave.h +++ b/include/effects/Wave.h @@ -79,7 +79,7 @@ namespace openshot /// modified openshot::Frame object /// /// The frame object is passed into this method, and a frame_number is passed in which - /// tells the effect which settings to use from it's keyframes (starting at 1). + /// tells the effect which settings to use from its keyframes (starting at 1). /// /// @returns The modified openshot::Frame object /// @param frame The frame object that needs the effect applied to it diff --git a/src/ChunkReader.cpp b/src/ChunkReader.cpp index fe552243..ac6835d0 100644 --- a/src/ChunkReader.cpp +++ b/src/ChunkReader.cpp @@ -42,7 +42,7 @@ ChunkReader::ChunkReader(string path, ChunkVersion chunk_version) previous_location.number = 0; previous_location.frame = 0; - // Open and Close the reader, to populate it's attributes (such as height, width, etc...) + // Open and Close the reader, to populate its attributes (such as height, width, etc...) Open(); Close(); } diff --git a/src/Clip.cpp b/src/Clip.cpp index 207494e3..33ff5093 100644 --- a/src/Clip.cpp +++ b/src/Clip.cpp @@ -272,7 +272,7 @@ void Clip::Close() // Get end position of clip (trim end of video), which can be affected by the time curve. float Clip::End() { - // if a time curve is present, use it's length + // if a time curve is present, use its length if (time.Points.size() > 1) { // Determine the FPS fo this clip diff --git a/src/DummyReader.cpp b/src/DummyReader.cpp index 8fe039ab..25c45f5c 100644 --- a/src/DummyReader.cpp +++ b/src/DummyReader.cpp @@ -66,7 +66,7 @@ DummyReader::DummyReader(Fraction fps, int width, int height, int sample_rate, i info.display_ratio.num = size.num; info.display_ratio.den = size.den; - // Open and Close the reader, to populate it's attributes (such as height, width, etc...) + // Open and Close the reader, to populate its attributes (such as height, width, etc...) Open(); Close(); } diff --git a/src/FFmpegReader.cpp b/src/FFmpegReader.cpp index a8d1d746..d5f69b0c 100644 --- a/src/FFmpegReader.cpp +++ b/src/FFmpegReader.cpp @@ -49,7 +49,7 @@ FFmpegReader::FFmpegReader(string path) missing_frames.SetMaxBytesFromInfo(OPEN_MP_NUM_PROCESSORS * 2, info.width, info.height, info.sample_rate, info.channels); final_cache.SetMaxBytesFromInfo(OPEN_MP_NUM_PROCESSORS * 2, info.width, info.height, info.sample_rate, info.channels); - // Open and Close the reader, to populate it's attributes (such as height, width, etc...) + // Open and Close the reader, to populate its attributes (such as height, width, etc...) Open(); Close(); } @@ -71,7 +71,7 @@ FFmpegReader::FFmpegReader(string path, bool inspect_reader) missing_frames.SetMaxBytesFromInfo(OPEN_MP_NUM_PROCESSORS * 2, info.width, info.height, info.sample_rate, info.channels); final_cache.SetMaxBytesFromInfo(OPEN_MP_NUM_PROCESSORS * 2, info.width, info.height, info.sample_rate, info.channels); - // Open and Close the reader, to populate it's attributes (such as height, width, etc...) + // Open and Close the reader, to populate its attributes (such as height, width, etc...) if (inspect_reader) { Open(); Close(); @@ -1698,7 +1698,7 @@ bool FFmpegReader::IsPartialFrame(int64_t requested_frame) { return seek_trash; } -// Check if a frame is missing and attempt to replace it's frame image (and +// Check if a frame is missing and attempt to replace its frame image (and bool FFmpegReader::CheckMissingFrame(int64_t requested_frame) { // Lock @@ -2025,7 +2025,7 @@ void FFmpegReader::CheckFPS() } } -// Remove AVFrame from cache (and deallocate it's memory) +// Remove AVFrame from cache (and deallocate its memory) void FFmpegReader::RemoveAVFrame(AVFrame* remove_frame) { // Remove pFrame (if exists) @@ -2042,7 +2042,7 @@ void FFmpegReader::RemoveAVFrame(AVFrame* remove_frame) } } -// Remove AVPacket from cache (and deallocate it's memory) +// Remove AVPacket from cache (and deallocate its memory) void FFmpegReader::RemoveAVPacket(AVPacket* remove_packet) { // deallocate memory for packet diff --git a/src/Frame.cpp b/src/Frame.cpp index a00fc232..263eb5af 100644 --- a/src/Frame.cpp +++ b/src/Frame.cpp @@ -263,7 +263,7 @@ std::shared_ptr Frame::GetWaveform(int width, int height, int Red, int G return wave_image; } -// Clear the waveform image (and deallocate it's memory) +// Clear the waveform image (and deallocate its memory) void Frame::ClearWaveform() { if (wave_image) diff --git a/src/ImageReader.cpp b/src/ImageReader.cpp index f535666a..937457b0 100644 --- a/src/ImageReader.cpp +++ b/src/ImageReader.cpp @@ -31,14 +31,14 @@ using namespace openshot; ImageReader::ImageReader(string path) : path(path), is_open(false) { - // Open and Close the reader, to populate it's attributes (such as height, width, etc...) + // Open and Close the reader, to populate its attributes (such as height, width, etc...) Open(); Close(); } ImageReader::ImageReader(string path, bool inspect_reader) : path(path), is_open(false) { - // Open and Close the reader, to populate it's attributes (such as height, width, etc...) + // Open and Close the reader, to populate its attributes (such as height, width, etc...) if (inspect_reader) { Open(); Close(); @@ -106,7 +106,7 @@ void ImageReader::Close() { // Mark as "closed" is_open = false; - + // Delete the image image.reset(); } diff --git a/src/QtImageReader.cpp b/src/QtImageReader.cpp index c500d221..a0108f48 100644 --- a/src/QtImageReader.cpp +++ b/src/QtImageReader.cpp @@ -43,14 +43,14 @@ using namespace openshot; QtImageReader::QtImageReader(string path) : path(path), is_open(false) { - // Open and Close the reader, to populate it's attributes (such as height, width, etc...) + // Open and Close the reader, to populate its attributes (such as height, width, etc...) Open(); Close(); } QtImageReader::QtImageReader(string path, bool inspect_reader) : path(path), is_open(false) { - // Open and Close the reader, to populate it's attributes (such as height, width, etc...) + // Open and Close the reader, to populate its attributes (such as height, width, etc...) if (inspect_reader) { Open(); Close(); @@ -143,7 +143,7 @@ void QtImageReader::Close() { // Mark as "closed" is_open = false; - + // Delete the image image.reset(); diff --git a/src/TextReader.cpp b/src/TextReader.cpp index 8234aa5d..5c8256b6 100644 --- a/src/TextReader.cpp +++ b/src/TextReader.cpp @@ -32,7 +32,7 @@ using namespace openshot; /// Default constructor (blank text) TextReader::TextReader() : width(1024), height(768), x_offset(0), y_offset(0), text(""), font("Arial"), size(10.0), text_color("#ffffff"), background_color("#000000"), is_open(false), gravity(GRAVITY_CENTER) { - // Open and Close the reader, to populate it's attributes (such as height, width, etc...) + // Open and Close the reader, to populate its attributes (such as height, width, etc...) Open(); Close(); } @@ -40,7 +40,7 @@ TextReader::TextReader() : width(1024), height(768), x_offset(0), y_offset(0), t TextReader::TextReader(int width, int height, int x_offset, int y_offset, GravityType gravity, string text, string font, double size, string text_color, string background_color) : width(width), height(height), x_offset(x_offset), y_offset(y_offset), text(text), font(font), size(size), text_color(text_color), background_color(background_color), is_open(false), gravity(gravity) { - // Open and Close the reader, to populate it's attributes (such as height, width, etc...) + // Open and Close the reader, to populate its attributes (such as height, width, etc...) Open(); Close(); } From dc4d687e712e1ca96035624c4768792cff1ed60f Mon Sep 17 00:00:00 2001 From: Frank Dana Date: Thu, 18 Apr 2019 09:26:20 -0400 Subject: [PATCH 03/10] Travis CI: Also run `make install` Taking my own suggestion, this adds a `make install` step to all three (overkill, maybe?) Travis builds, using `DESTDIR=dist/` to keep the files local to the build dir. Meant to bring the CMake-managed install logic under CI verification. --- .travis.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4afd8467..2e7db59d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,8 @@ matrix: - cmake -D"CMAKE_BUILD_TYPE:STRING=Debug" ../ - make VERBOSE=1 - make os_test - + - make install DESTDIR=dist/ + - language: cpp name: "FFmpeg 3" before_script: @@ -31,7 +32,8 @@ matrix: - cmake -D"CMAKE_BUILD_TYPE:STRING=Debug" ../ - make VERBOSE=1 - make os_test - + - make install DESTDIR=dist/ + - language: cpp name: "FFmpeg 4" before_script: @@ -48,3 +50,4 @@ matrix: - cmake -D"CMAKE_BUILD_TYPE:STRING=Debug" ../ - make VERBOSE=1 - make os_test + - make install DESTDIR=dist/ From 49831a24b00ea46b749fbd6fe9101fb74fbc6972 Mon Sep 17 00:00:00 2001 From: Sergey Parfenyuk Date: Sat, 27 Apr 2019 12:37:24 +0200 Subject: [PATCH 04/10] Add virtual destructor for abstract classes --- include/CacheBase.h | 1 + include/ClipBase.h | 1 + include/EffectBase.h | 1 + include/PlayerBase.h | 1 + include/ReaderBase.h | 2 ++ include/WriterBase.h | 2 ++ 6 files changed, 8 insertions(+) diff --git a/include/CacheBase.h b/include/CacheBase.h index aaef5320..a7f8c88f 100644 --- a/include/CacheBase.h +++ b/include/CacheBase.h @@ -109,6 +109,7 @@ namespace openshot { virtual void SetJson(string value) = 0; ///< Load JSON string into this object virtual Json::Value JsonValue() = 0; ///< Generate Json::JsonValue for this object virtual void SetJsonValue(Json::Value root) = 0; ///< Load Json::JsonValue into this object + virtual ~CacheBase() = default; }; diff --git a/include/ClipBase.h b/include/ClipBase.h index 3dae8a53..4678f25a 100644 --- a/include/ClipBase.h +++ b/include/ClipBase.h @@ -101,6 +101,7 @@ namespace openshot { /// of all properties at any time) virtual string PropertiesJSON(int64_t requested_frame) = 0; + virtual ~ClipBase() = default; }; diff --git a/include/EffectBase.h b/include/EffectBase.h index d38e3f45..26add05d 100644 --- a/include/EffectBase.h +++ b/include/EffectBase.h @@ -105,6 +105,7 @@ namespace openshot /// Set the order that this effect should be executed. void Order(int new_order) { order = new_order; } + virtual ~EffectBase() = default; }; } diff --git a/include/PlayerBase.h b/include/PlayerBase.h index ecc222a8..f1ce2d80 100644 --- a/include/PlayerBase.h +++ b/include/PlayerBase.h @@ -104,6 +104,7 @@ namespace openshot /// Set the Volume (1.0 = normal volume, <1.0 = quieter, >1.0 louder) virtual void Volume(float new_volume) = 0; + virtual ~PlayerBase() = default; }; } diff --git a/include/ReaderBase.h b/include/ReaderBase.h index b0a1b3db..ce665f1d 100644 --- a/include/ReaderBase.h +++ b/include/ReaderBase.h @@ -147,6 +147,8 @@ namespace openshot /// Open the reader (and start consuming resources, such as images or video files) virtual void Open() = 0; + + virtual ~ReaderBase() = default; }; } diff --git a/include/WriterBase.h b/include/WriterBase.h index 8f424054..3fd80c7f 100644 --- a/include/WriterBase.h +++ b/include/WriterBase.h @@ -116,6 +116,8 @@ namespace openshot /// Open the writer (and start initializing streams) virtual void Open() = 0; + + virtual ~WriterBase() = default; }; } From 665a03f9e23973a626abcc9520071fe1f6644142 Mon Sep 17 00:00:00 2001 From: Sergey Parfenyuk Date: Sat, 27 Apr 2019 12:50:31 +0200 Subject: [PATCH 05/10] Fix logical statements --- src/AudioResampler.cpp | 4 ++-- src/KeyFrame.cpp | 2 +- src/QtImageReader.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/AudioResampler.cpp b/src/AudioResampler.cpp index 442a91d9..d7829ec5 100644 --- a/src/AudioResampler.cpp +++ b/src/AudioResampler.cpp @@ -74,9 +74,9 @@ AudioResampler::~AudioResampler() void AudioResampler::SetBuffer(AudioSampleBuffer *new_buffer, double sample_rate, double new_sample_rate) { if (sample_rate <= 0) - sample_rate == 44100; + sample_rate = 44100; if (new_sample_rate <= 0) - new_sample_rate == 44100; + new_sample_rate = 44100; // Set the sample ratio (the ratio of sample rate change) source_ratio = sample_rate / new_sample_rate; diff --git a/src/KeyFrame.cpp b/src/KeyFrame.cpp index 025484a3..a2c2362d 100644 --- a/src/KeyFrame.cpp +++ b/src/KeyFrame.cpp @@ -784,7 +784,7 @@ void Keyframe::ProcessSegment(int Segment, Point p1, Point p2) { // Add new value to the vector Coordinate new_coord(current_frame, current_value); - if (Segment == 0 || Segment > 0 && current_frame > p1.co.X) + if (Segment == 0 || (Segment > 0 && current_frame > p1.co.X)) // Add to "values" vector Values.push_back(new_coord); diff --git a/src/QtImageReader.cpp b/src/QtImageReader.cpp index c500d221..8cc2debc 100644 --- a/src/QtImageReader.cpp +++ b/src/QtImageReader.cpp @@ -209,7 +209,7 @@ std::shared_ptr QtImageReader::GetFrame(int64_t requested_frame) } // Scale image smaller (or use a previous scaled image) - if (!cached_image || (cached_image && cached_image->width() != max_width || cached_image->height() != max_height)) { + if (!cached_image || (cached_image->width() != max_width || cached_image->height() != max_height)) { #if USE_RESVG == 1 // If defined and found in CMake, utilize the libresvg for parsing From 626a2f73f5b4f200cef8965963efc21e80c0030b Mon Sep 17 00:00:00 2001 From: "FeRD (Frank Dana)" Date: Thu, 2 May 2019 20:14:45 -0400 Subject: [PATCH 06/10] Python: Assume /usr/local prefix on Debian If we're using the fallback path detection method on Debian, we shouldn't compute the install path relative to `${CMAKE_INSTALL_PREFIX}` since it _isn't_. So, we assume it's relative to `/usr/local` instead. --- src/bindings/python/CMakeLists.txt | 50 ++++++++++++++++++------------ 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/src/bindings/python/CMakeLists.txt b/src/bindings/python/CMakeLists.txt index 2a481aa7..3f8ff2c1 100644 --- a/src/bindings/python/CMakeLists.txt +++ b/src/bindings/python/CMakeLists.txt @@ -65,29 +65,39 @@ if (PYTHONLIBS_FOUND AND PYTHONINTERP_FOUND) target_link_libraries(${SWIG_MODULE_pyopenshot_REAL_NAME} ${PYTHON_LIBRARIES} openshot) - ### Check if the following Debian-friendly python module path exists - SET(PYTHON_MODULE_PATH "${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages") - if (NOT EXISTS ${PYTHON_MODULE_PATH}) - - ### Check if another Debian-friendly python module path exists - SET(PYTHON_MODULE_PATH "${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/dist-packages") - if (NOT EXISTS ${PYTHON_MODULE_PATH}) - - ### Calculate the python module path (using distutils) - execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c "\ + ### FIND THE PYTHON INTERPRETER (AND THE SITE PACKAGES FOLDER) + if (UNIX AND NOT APPLE) + ### Special-case for Debian's crazy, by checking to see if pybuild + ### is available. We don't use it, except as a canary in a coal mine + find_program(PYBUILD_EXECUTABLE pybuild + DOC "Path to Debian's pybuild utility") + if (PYBUILD_EXECUTABLE) + # We're on a Debian derivative, fall back to old path detection + set(py_detection "import site; print(site.getsitepackages()[0])") + set(PY_INSTALL_PREFIX "/usr/local") # An assumption (bad one?) + else() + # Use distutils to detect install path + set (py_detection "\ from distutils.sysconfig import get_python_lib; \ -print( get_python_lib( plat_specific=True, prefix='${CMAKE_INSTALL_PREFIX}' ) )" - OUTPUT_VARIABLE _ABS_PYTHON_MODULE_PATH - OUTPUT_STRIP_TRAILING_WHITESPACE ) - - GET_FILENAME_COMPONENT(_ABS_PYTHON_MODULE_PATH - "${_ABS_PYTHON_MODULE_PATH}" ABSOLUTE) - FILE(RELATIVE_PATH _REL_PYTHON_MODULE_PATH - ${CMAKE_INSTALL_PREFIX} ${_ABS_PYTHON_MODULE_PATH}) - SET(PYTHON_MODULE_PATH ${_ABS_PYTHON_MODULE_PATH}) +print( get_python_lib( plat_specific=True, prefix='${CMAKE_INSTALL_PREFIX}' ) )") + set(PY_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}) endif() endif() - message("PYTHON_MODULE_PATH: ${PYTHON_MODULE_PATH}") + + if (NOT PYTHON_MODULE_PATH) + execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c "${py_detection}" + OUTPUT_VARIABLE _ABS_PYTHON_MODULE_PATH + OUTPUT_STRIP_TRAILING_WHITESPACE ) + + GET_FILENAME_COMPONENT(_ABS_PYTHON_MODULE_PATH + "${_ABS_PYTHON_MODULE_PATH}" ABSOLUTE) + FILE(RELATIVE_PATH _REL_PYTHON_MODULE_PATH + ${PY_INSTALL_PREFIX} ${_ABS_PYTHON_MODULE_PATH}) + SET(PYTHON_MODULE_PATH ${_REL_PYTHON_MODULE_PATH} + CACHE PATH "Install path for Python modules (relative to prefix)") + endif() + + message(STATUS "Will install Python module to: ${PYTHON_MODULE_PATH}") ############### INSTALL HEADERS & LIBRARY ################ ### Install Python bindings From be7db1148074aa3a3f7524300310192ab150fe5d Mon Sep 17 00:00:00 2001 From: SuslikV Date: Tue, 11 Jun 2019 10:49:45 +0300 Subject: [PATCH 07/10] Add streamable file format options for mp4, mov Add 2 new multiplexing presets for mp4, mov files: mp4_faststart mp4_fragmented The Preset usage from openshot-qt export.py as follows (example): w.SetOption(openshot.VIDEO_STREAM, "muxing_preset", "mp4_faststart") YouTube suggest to use streamable file formats to process the uploading videos faster (by starting its processing when upload not yet complete) MP4, MOV files export requires additional dictionary keys to be set in this case. --- src/FFmpegWriter.cpp | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/src/FFmpegWriter.cpp b/src/FFmpegWriter.cpp index ddcd4e16..45ff31b8 100644 --- a/src/FFmpegWriter.cpp +++ b/src/FFmpegWriter.cpp @@ -38,6 +38,9 @@ using namespace openshot; #pragma message "You are compiling only with software encode" #endif +// Multiplexer parameters temporary storage +AVDictionary *mux_dict = NULL; + #if IS_FFMPEG_3_2 int hw_en_on = 1; // Is set in UI int hw_en_supported = 0; // Is set by FFmpegWriter @@ -464,6 +467,17 @@ void FFmpegWriter::SetOption(StreamType stream, string name, string value) { ZmqLogger::Instance()->AppendDebugMethod("FFmpegWriter::SetOption (" + (string)name + ")", "stream == VIDEO_STREAM", stream == VIDEO_STREAM, "", -1, "", -1, "", -1, "", -1, "", -1); + // Muxing dictionary is not part of the codec context. + // Just reusing SetOption function to set popular multiplexing presets. + } else if (name == "muxing_preset") { + if (value == "mp4_faststart") { + // 'moov' box to the beginning; only for MOV, MP4 + av_dict_set(&mux_dict, "movflags", "faststart", 0); + } else if (value == "mp4_fragmented") { + // write selfcontained fragmented file, minimum length of the fragment 8 sec; only for MOV, MP4 + av_dict_set(&mux_dict, "movflags", "frag_keyframe", 0); + av_dict_set(&mux_dict, "min_frag_duration", "8000000", 0); + } } else { throw InvalidOptions("The option is not valid for this codec.", path); } @@ -511,17 +525,29 @@ void FFmpegWriter::WriteHeader() { snprintf(oc->AV_FILENAME, sizeof(oc->AV_FILENAME), "%s", path.c_str()); // Write the stream header, if any - // TODO: add avoptions / parameters instead of NULL // Add general metadata (if any) for (std::map::iterator iter = info.metadata.begin(); iter != info.metadata.end(); ++iter) { av_dict_set(&oc->metadata, iter->first.c_str(), iter->second.c_str(), 0); } - if (avformat_write_header(oc, NULL) != 0) { + // Set multiplexing parameters + AVDictionary *dict = NULL; + + bool is_mp4 = strcmp(oc->oformat->name, "mp4"); + bool is_mov = strcmp(oc->oformat->name, "mov"); + // Set dictionary preset only for MP4 and MOV files + if (is_mp4 || is_mov) + av_dict_copy(&dict, mux_dict, 0); + + if (avformat_write_header(oc, &dict) != 0) { throw InvalidFile("Could not write header to file.", path); }; + // Free multiplexing dictionaries sets + if (dict) av_dict_free(&dict); + if (mux_dict) av_dict_free(&mux_dict); + // Mark as 'written' write_header = true; From ac8876f81051f69074bc50f21d66ba2706620a2f Mon Sep 17 00:00:00 2001 From: Jonathan Thomas Date: Fri, 21 Jun 2019 15:57:41 -0500 Subject: [PATCH 08/10] Removing duplicated destructor definitions and implementations... so our virtual destructors will not break on older toolchains. --- include/CacheBase.h | 2 -- include/ClipBase.h | 1 - include/ReaderBase.h | 2 -- src/CacheBase.cpp | 3 --- src/ClipBase.cpp | 3 --- src/ReaderBase.cpp | 3 --- 6 files changed, 14 deletions(-) diff --git a/include/CacheBase.h b/include/CacheBase.h index 12108680..3760e84b 100644 --- a/include/CacheBase.h +++ b/include/CacheBase.h @@ -63,8 +63,6 @@ namespace openshot { /// @param max_bytes The maximum bytes to allow in the cache. Once exceeded, the cache will purge the oldest frames. CacheBase(int64_t max_bytes); - virtual ~CacheBase(); - /// @brief Add a Frame to the cache /// @param frame The openshot::Frame object needing to be cached. virtual void Add(std::shared_ptr frame) = 0; diff --git a/include/ClipBase.h b/include/ClipBase.h index 05f2747e..ab3f0637 100644 --- a/include/ClipBase.h +++ b/include/ClipBase.h @@ -72,7 +72,6 @@ namespace openshot { /// Constructor for the base clip ClipBase() { }; - virtual ~ClipBase(); // Compare a clip using the Position() property bool operator< ( ClipBase& a) { return (Position() < a.Position()); } diff --git a/include/ReaderBase.h b/include/ReaderBase.h index b2e8f19e..0d14ea19 100644 --- a/include/ReaderBase.h +++ b/include/ReaderBase.h @@ -110,8 +110,6 @@ namespace openshot /// Constructor for the base reader, where many things are initialized. ReaderBase(); - virtual ~ReaderBase(); - /// Information about the current media file ReaderInfo info; diff --git a/src/CacheBase.cpp b/src/CacheBase.cpp index 8270b393..0016694a 100644 --- a/src/CacheBase.cpp +++ b/src/CacheBase.cpp @@ -45,9 +45,6 @@ CacheBase::CacheBase(int64_t max_bytes) : max_bytes(max_bytes) { cacheCriticalSection = new CriticalSection(); }; -CacheBase::~CacheBase() { -}; - // Set maximum bytes to a different amount based on a ReaderInfo struct void CacheBase::SetMaxBytesFromInfo(int64_t number_of_frames, int width, int height, int sample_rate, int channels) { diff --git a/src/ClipBase.cpp b/src/ClipBase.cpp index 1517a7e3..60bdb633 100644 --- a/src/ClipBase.cpp +++ b/src/ClipBase.cpp @@ -32,9 +32,6 @@ using namespace openshot; -ClipBase::~ClipBase() { -} - // Generate Json::JsonValue for this object Json::Value ClipBase::JsonValue() { diff --git a/src/ReaderBase.cpp b/src/ReaderBase.cpp index ece0684f..30706866 100644 --- a/src/ReaderBase.cpp +++ b/src/ReaderBase.cpp @@ -66,9 +66,6 @@ ReaderBase::ReaderBase() parent = NULL; } -ReaderBase::~ReaderBase() { -} - // Display file information void ReaderBase::DisplayInfo() { cout << fixed << setprecision(2) << boolalpha; From 9d09b65e70ef242bfbc673e4b337c3b64534b4bd Mon Sep 17 00:00:00 2001 From: Jonathan Thomas Date: Fri, 21 Jun 2019 16:47:37 -0500 Subject: [PATCH 09/10] Revert "Don't break Python install path detection on Debian" --- src/bindings/python/CMakeLists.txt | 50 ++++++++++++------------------ 1 file changed, 20 insertions(+), 30 deletions(-) diff --git a/src/bindings/python/CMakeLists.txt b/src/bindings/python/CMakeLists.txt index 0496bef6..eb7c989a 100644 --- a/src/bindings/python/CMakeLists.txt +++ b/src/bindings/python/CMakeLists.txt @@ -65,39 +65,29 @@ if (PYTHONLIBS_FOUND AND PYTHONINTERP_FOUND) target_link_libraries(${SWIG_MODULE_pyopenshot_REAL_NAME} ${PYTHON_LIBRARIES} openshot) - ### FIND THE PYTHON INTERPRETER (AND THE SITE PACKAGES FOLDER) - if (UNIX AND NOT APPLE) - ### Special-case for Debian's crazy, by checking to see if pybuild - ### is available. We don't use it, except as a canary in a coal mine - find_program(PYBUILD_EXECUTABLE pybuild - DOC "Path to Debian's pybuild utility") - if (PYBUILD_EXECUTABLE) - # We're on a Debian derivative, fall back to old path detection - set(py_detection "import site; print(site.getsitepackages()[0])") - set(PY_INSTALL_PREFIX "/usr/local") # An assumption (bad one?) - else() - # Use distutils to detect install path - set (py_detection "\ + ### Check if the following Debian-friendly python module path exists + SET(PYTHON_MODULE_PATH "${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages") + if (NOT EXISTS ${PYTHON_MODULE_PATH}) + + ### Check if another Debian-friendly python module path exists + SET(PYTHON_MODULE_PATH "${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/dist-packages") + if (NOT EXISTS ${PYTHON_MODULE_PATH}) + + ### Calculate the python module path (using distutils) + execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c "\ from distutils.sysconfig import get_python_lib; \ -print( get_python_lib( plat_specific=True, prefix='${CMAKE_INSTALL_PREFIX}' ) )") - set(PY_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}) +print( get_python_lib( plat_specific=True, prefix='${CMAKE_INSTALL_PREFIX}' ) )" + OUTPUT_VARIABLE _ABS_PYTHON_MODULE_PATH + OUTPUT_STRIP_TRAILING_WHITESPACE ) + + GET_FILENAME_COMPONENT(_ABS_PYTHON_MODULE_PATH + "${_ABS_PYTHON_MODULE_PATH}" ABSOLUTE) + FILE(RELATIVE_PATH _REL_PYTHON_MODULE_PATH + ${CMAKE_INSTALL_PREFIX} ${_ABS_PYTHON_MODULE_PATH}) + SET(PYTHON_MODULE_PATH ${_ABS_PYTHON_MODULE_PATH}) endif() endif() - - if (NOT PYTHON_MODULE_PATH) - execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c "${py_detection}" - OUTPUT_VARIABLE _ABS_PYTHON_MODULE_PATH - OUTPUT_STRIP_TRAILING_WHITESPACE ) - - GET_FILENAME_COMPONENT(_ABS_PYTHON_MODULE_PATH - "${_ABS_PYTHON_MODULE_PATH}" ABSOLUTE) - FILE(RELATIVE_PATH _REL_PYTHON_MODULE_PATH - ${PY_INSTALL_PREFIX} ${_ABS_PYTHON_MODULE_PATH}) - SET(PYTHON_MODULE_PATH ${_REL_PYTHON_MODULE_PATH} - CACHE PATH "Install path for Python modules (relative to prefix)") - endif() - - message(STATUS "Will install Python module to: ${PYTHON_MODULE_PATH}") + message("PYTHON_MODULE_PATH: ${PYTHON_MODULE_PATH}") ############### INSTALL HEADERS & LIBRARY ################ ### Install Python bindings From 8f42a9ff07585be22c4d40f46c6e8bf6666d4b3b Mon Sep 17 00:00:00 2001 From: Frank Dana Date: Wed, 26 Jun 2019 02:07:02 -0400 Subject: [PATCH 10/10] Fix tabs-vs-spaces indent in Timeline.h --- include/Timeline.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/Timeline.h b/include/Timeline.h index a90399cd..3793f301 100644 --- a/include/Timeline.h +++ b/include/Timeline.h @@ -104,7 +104,7 @@ namespace openshot { * Fraction(25,1), // framerate * 44100, // sample rate * 2 // channels - * ChannelLayout::LAYOUT_STEREO, + * ChannelLayout::LAYOUT_STEREO, * ); * * // Create some clips