You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Migrating tr1 to std, adding C++11 support to build scripts, fixing crash in FFmpegReader (caused by shared_ptr, buffer, and last_video_frame corruption). Much improved stability with this change. Thanks to Craig and Peter for the help!
This commit is contained in:
@@ -67,6 +67,9 @@ PROJECT(openshot)
|
||||
MESSAGE("--------------------------------------------------------------")
|
||||
MESSAGE("Generating build files for ${PROJECT_NAME} (${PROJECT_VERSION})")
|
||||
|
||||
#### Enable C++11 (for std::shared_ptr support)
|
||||
set(CMAKE_CXX_FLAGS "-std=c++11")
|
||||
|
||||
IF (WIN32)
|
||||
SET_PROPERTY(GLOBAL PROPERTY WIN32 "WIN32")
|
||||
ENDIF(WIN32)
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace openshot
|
||||
ReaderBase *reader; /// The reader to pull samples from
|
||||
int64 original_frame_number; /// The current frame to read from
|
||||
int64 frame_number; /// The current frame number
|
||||
tr1::shared_ptr<Frame> frame; /// The current frame object that is being read
|
||||
std::shared_ptr<Frame> frame; /// The current frame object that is being read
|
||||
long int frame_position; /// The position of the current frame's buffer
|
||||
double estimated_frame; /// The estimated frame position of the currently playing buffer
|
||||
int estimated_samples_per_frame; /// The estimated samples per frame of video
|
||||
@@ -118,7 +118,7 @@ namespace openshot
|
||||
const ReaderInfo & getReaderInfo() const { return reader->info; }
|
||||
|
||||
/// Return the current frame object
|
||||
tr1::shared_ptr<Frame> getFrame() const { return frame; }
|
||||
std::shared_ptr<Frame> getFrame() const { return frame; }
|
||||
|
||||
/// Get the estimate frame that is playing at this moment
|
||||
long int getEstimatedFrame() const { return long(estimated_frame); }
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#ifndef OPENSHOT_CACHE_BASE_H
|
||||
#define OPENSHOT_CACHE_BASE_H
|
||||
|
||||
#include <tr1/memory>
|
||||
#include <memory>
|
||||
#include "Frame.h"
|
||||
#include "Exceptions.h"
|
||||
#include "Json.h"
|
||||
@@ -62,7 +62,7 @@ namespace openshot {
|
||||
|
||||
/// @brief Add a Frame to the cache
|
||||
/// @param frame The openshot::Frame object needing to be cached.
|
||||
virtual void Add(tr1::shared_ptr<Frame> frame) = 0;
|
||||
virtual void Add(std::shared_ptr<Frame> frame) = 0;
|
||||
|
||||
/// Clear the cache of all frames
|
||||
virtual void Clear() = 0;
|
||||
@@ -72,13 +72,13 @@ namespace openshot {
|
||||
|
||||
/// @brief Get a frame from the cache
|
||||
/// @param frame_number The frame number of the cached frame
|
||||
virtual tr1::shared_ptr<Frame> GetFrame(long int frame_number) = 0;
|
||||
virtual std::shared_ptr<Frame> GetFrame(long int frame_number) = 0;
|
||||
|
||||
/// Gets the maximum bytes value
|
||||
virtual long long int GetBytes() = 0;
|
||||
|
||||
/// Get the smallest frame number
|
||||
virtual tr1::shared_ptr<Frame> GetSmallestFrame() = 0;
|
||||
virtual std::shared_ptr<Frame> GetSmallestFrame() = 0;
|
||||
|
||||
/// @brief Remove a specific frame
|
||||
/// @param frame_number The frame number of the cached frame
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
#include <map>
|
||||
#include <deque>
|
||||
#include <tr1/memory>
|
||||
#include <memory>
|
||||
#include "CacheBase.h"
|
||||
#include "Frame.h"
|
||||
#include "Exceptions.h"
|
||||
@@ -93,7 +93,7 @@ namespace openshot {
|
||||
|
||||
/// @brief Add a Frame to the cache
|
||||
/// @param frame The openshot::Frame object needing to be cached.
|
||||
void Add(tr1::shared_ptr<Frame> frame);
|
||||
void Add(std::shared_ptr<Frame> frame);
|
||||
|
||||
/// Clear the cache of all frames
|
||||
void Clear();
|
||||
@@ -103,13 +103,13 @@ namespace openshot {
|
||||
|
||||
/// @brief Get a frame from the cache
|
||||
/// @param frame_number The frame number of the cached frame
|
||||
tr1::shared_ptr<Frame> GetFrame(long int frame_number);
|
||||
std::shared_ptr<Frame> GetFrame(long int frame_number);
|
||||
|
||||
/// Gets the maximum bytes value
|
||||
long long int GetBytes();
|
||||
|
||||
/// Get the smallest frame number
|
||||
tr1::shared_ptr<Frame> GetSmallestFrame();
|
||||
std::shared_ptr<Frame> GetSmallestFrame();
|
||||
|
||||
/// @brief Move frame to front of queue (so it lasts longer)
|
||||
/// @param frame_number The frame number of the cached frame
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
#include <map>
|
||||
#include <deque>
|
||||
#include <tr1/memory>
|
||||
#include <memory>
|
||||
#include "CacheBase.h"
|
||||
#include "Frame.h"
|
||||
#include "Exceptions.h"
|
||||
@@ -47,7 +47,7 @@ namespace openshot {
|
||||
*/
|
||||
class CacheMemory : public CacheBase {
|
||||
private:
|
||||
map<long int, tr1::shared_ptr<Frame> > frames; ///< This map holds the frame number and Frame objects
|
||||
map<long int, std::shared_ptr<Frame> > frames; ///< This map holds the frame number and Frame objects
|
||||
deque<long int> frame_numbers; ///< This queue holds a sequential list of cached Frame numbers
|
||||
|
||||
bool needs_range_processing; ///< Something has changed, and the range data needs to be re-calculated
|
||||
@@ -75,7 +75,7 @@ namespace openshot {
|
||||
|
||||
/// @brief Add a Frame to the cache
|
||||
/// @param frame The openshot::Frame object needing to be cached.
|
||||
void Add(tr1::shared_ptr<Frame> frame);
|
||||
void Add(std::shared_ptr<Frame> frame);
|
||||
|
||||
/// Clear the cache of all frames
|
||||
void Clear();
|
||||
@@ -85,13 +85,13 @@ namespace openshot {
|
||||
|
||||
/// @brief Get a frame from the cache
|
||||
/// @param frame_number The frame number of the cached frame
|
||||
tr1::shared_ptr<Frame> GetFrame(long int frame_number);
|
||||
std::shared_ptr<Frame> GetFrame(long int frame_number);
|
||||
|
||||
/// Gets the maximum bytes value
|
||||
long long int GetBytes();
|
||||
|
||||
/// Get the smallest frame number
|
||||
tr1::shared_ptr<Frame> GetSmallestFrame();
|
||||
std::shared_ptr<Frame> GetSmallestFrame();
|
||||
|
||||
/// @brief Move frame to front of queue (so it lasts longer)
|
||||
/// @param frame_number The frame number of the cached frame
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#include <QtCore/qdir.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <tr1/memory>
|
||||
#include <memory>
|
||||
#include "Json.h"
|
||||
#include "CacheMemory.h"
|
||||
#include "Exceptions.h"
|
||||
@@ -110,7 +110,7 @@ namespace openshot
|
||||
FFmpegReader *local_reader;
|
||||
ChunkLocation previous_location;
|
||||
ChunkVersion version;
|
||||
tr1::shared_ptr<Frame> last_frame;
|
||||
std::shared_ptr<Frame> last_frame;
|
||||
|
||||
/// Check if folder path existing
|
||||
bool does_folder_exist(string path);
|
||||
@@ -149,7 +149,7 @@ namespace openshot
|
||||
/// @brief Get an openshot::Frame object for a specific frame number of this reader.
|
||||
/// @returns The requested frame (containing the image and audio)
|
||||
/// @param requested_frame The frame number you want to retrieve
|
||||
tr1::shared_ptr<Frame> GetFrame(long int requested_frame) throw(ReaderClosed, ChunkNotFound);
|
||||
std::shared_ptr<Frame> GetFrame(long int requested_frame) throw(ReaderClosed, ChunkNotFound);
|
||||
|
||||
/// Determine if reader is open or closed
|
||||
bool IsOpen() { return is_open; };
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace openshot
|
||||
FFmpegWriter *writer_thumb;
|
||||
FFmpegWriter *writer_preview;
|
||||
FFmpegWriter *writer_final;
|
||||
tr1::shared_ptr<Frame> last_frame;
|
||||
std::shared_ptr<Frame> last_frame;
|
||||
bool last_frame_needed;
|
||||
string default_extension;
|
||||
string default_vcodec;
|
||||
@@ -133,7 +133,7 @@ namespace openshot
|
||||
|
||||
/// @brief Add a frame to the stack waiting to be encoded.
|
||||
/// @param frame The openshot::Frame object that needs to be written to this chunk file.
|
||||
void WriteFrame(tr1::shared_ptr<Frame> frame) throw(WriterClosed);
|
||||
void WriteFrame(std::shared_ptr<Frame> frame) throw(WriterClosed);
|
||||
|
||||
/// @brief Write a block of frames from a reader
|
||||
/// @param start The starting frame number to write (of the reader passed into the constructor)
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#define __JUCE_UNITTEST_JUCEHEADER__
|
||||
#endif
|
||||
|
||||
#include <tr1/memory>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <QtGui/QImage>
|
||||
#include "JuceLibraryCode/JuceHeader.h"
|
||||
@@ -127,16 +127,16 @@ namespace openshot {
|
||||
long int adjust_frame_number_minimum(long int frame_number);
|
||||
|
||||
/// Apply effects to the source frame (if any)
|
||||
tr1::shared_ptr<Frame> apply_effects(tr1::shared_ptr<Frame> frame);
|
||||
std::shared_ptr<Frame> apply_effects(std::shared_ptr<Frame> frame);
|
||||
|
||||
/// Get file extension
|
||||
string get_file_extension(string path);
|
||||
|
||||
/// Get a frame object or create a blank one
|
||||
tr1::shared_ptr<Frame> GetOrCreateFrame(long int number);
|
||||
std::shared_ptr<Frame> GetOrCreateFrame(long int number);
|
||||
|
||||
/// Adjust the audio and image of a time mapped frame
|
||||
tr1::shared_ptr<Frame> get_time_mapped_frame(tr1::shared_ptr<Frame> frame, long int frame_number) throw(ReaderClosed);
|
||||
std::shared_ptr<Frame> get_time_mapped_frame(std::shared_ptr<Frame> frame, long int frame_number) throw(ReaderClosed);
|
||||
|
||||
/// Init default settings for a clip
|
||||
void init_settings();
|
||||
@@ -181,7 +181,7 @@ namespace openshot {
|
||||
///
|
||||
/// @returns The requested frame (containing the image)
|
||||
/// @param requested_frame The frame number that is requested
|
||||
tr1::shared_ptr<Frame> GetFrame(long int requested_frame) throw(ReaderClosed);
|
||||
std::shared_ptr<Frame> GetFrame(long int requested_frame) throw(ReaderClosed);
|
||||
|
||||
/// Open the internal reader
|
||||
void Open() throw(InvalidFile, ReaderClosed);
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#define __JUCE_UNITTEST_JUCEHEADER__
|
||||
#endif
|
||||
|
||||
#include <tr1/memory>
|
||||
#include <memory>
|
||||
#include <sstream>
|
||||
#include "Exceptions.h"
|
||||
#include "Point.h"
|
||||
|
||||
@@ -93,7 +93,7 @@ public:
|
||||
virtual HRESULT STDMETHODCALLTYPE VideoInputFrameArrived(IDeckLinkVideoInputFrame*, IDeckLinkAudioInputPacket*);
|
||||
|
||||
// Extra methods
|
||||
tr1::shared_ptr<openshot::Frame> GetFrame(long int requested_frame);
|
||||
std::shared_ptr<openshot::Frame> GetFrame(long int requested_frame);
|
||||
unsigned long GetCurrentFrameNumber();
|
||||
|
||||
private:
|
||||
|
||||
@@ -97,7 +97,7 @@ protected:
|
||||
// Queue of raw video frames
|
||||
//deque<IDeckLinkMutableVideoFrame*> final_frames;
|
||||
deque<uint8_t * > final_frames;
|
||||
deque<tr1::shared_ptr<openshot::Frame> > raw_video_frames;
|
||||
deque<std::shared_ptr<openshot::Frame> > raw_video_frames;
|
||||
|
||||
// Convert between YUV and RGB
|
||||
IDeckLinkOutput *deckLinkOutput;
|
||||
@@ -125,7 +125,7 @@ public:
|
||||
void ScheduleNextFrame(bool prerolling);
|
||||
|
||||
/// Custom method to write new frames
|
||||
void WriteFrame(tr1::shared_ptr<openshot::Frame> frame);
|
||||
void WriteFrame(std::shared_ptr<openshot::Frame> frame);
|
||||
|
||||
private:
|
||||
ULONG m_refCount;
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <tr1/memory>
|
||||
#include <memory>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "CacheMemory.h"
|
||||
@@ -107,7 +107,7 @@ namespace openshot
|
||||
///
|
||||
/// @returns The requested frame (containing the image)
|
||||
/// @param requested_frame The frame number that is requested.
|
||||
tr1::shared_ptr<Frame> GetFrame(long int requested_frame) throw(ReaderClosed);
|
||||
std::shared_ptr<Frame> GetFrame(long int requested_frame) throw(ReaderClosed);
|
||||
unsigned long GetCurrentFrameNumber();
|
||||
|
||||
/// Determine if reader is open or closed
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <tr1/memory>
|
||||
#include <memory>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "CacheMemory.h"
|
||||
@@ -96,7 +96,7 @@ namespace openshot
|
||||
void Close();
|
||||
|
||||
/// This method is required for all derived classes of WriterBase. Write a Frame to the video file.
|
||||
void WriteFrame(tr1::shared_ptr<Frame> frame) throw(WriterClosed);
|
||||
void WriteFrame(std::shared_ptr<Frame> frame) throw(WriterClosed);
|
||||
|
||||
/// This method is required for all derived classes of WriterBase. Write a block of frames from a reader.
|
||||
void WriteFrame(ReaderBase* reader, int start, int length) throw(WriterClosed);
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include <iostream>
|
||||
#include <omp.h>
|
||||
#include <stdio.h>
|
||||
#include <tr1/memory>
|
||||
#include <memory>
|
||||
#include "CacheMemory.h"
|
||||
#include "Exceptions.h"
|
||||
#include "Fraction.h"
|
||||
@@ -53,7 +53,7 @@ namespace openshot
|
||||
class DummyReader : public ReaderBase
|
||||
{
|
||||
private:
|
||||
tr1::shared_ptr<Frame> image_frame;
|
||||
std::shared_ptr<Frame> image_frame;
|
||||
bool is_open;
|
||||
|
||||
public:
|
||||
@@ -75,7 +75,7 @@ namespace openshot
|
||||
///
|
||||
/// @returns The requested frame (containing the image)
|
||||
/// @param requested_frame The frame number that is requested.
|
||||
tr1::shared_ptr<Frame> GetFrame(long int requested_frame) throw(ReaderClosed);
|
||||
std::shared_ptr<Frame> GetFrame(long int requested_frame) throw(ReaderClosed);
|
||||
|
||||
/// Determine if reader is open or closed
|
||||
bool IsOpen() { return is_open; };
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <tr1/memory>
|
||||
#include <memory>
|
||||
#include "ClipBase.h"
|
||||
#include "Frame.h"
|
||||
#include "Json.h"
|
||||
@@ -84,7 +84,7 @@ namespace openshot
|
||||
/// @returns The modified openshot::Frame object
|
||||
/// @param frame The frame object that needs the effect applied to it
|
||||
/// @param frame_number The frame number (starting at 1) of the effect on the timeline.
|
||||
virtual tr1::shared_ptr<Frame> GetFrame(tr1::shared_ptr<Frame> frame, long int frame_number) = 0;
|
||||
virtual std::shared_ptr<Frame> GetFrame(std::shared_ptr<Frame> frame, long int frame_number) = 0;
|
||||
|
||||
/// Initialize the values of the EffectInfo struct. It is important for derived classes to call
|
||||
/// this method, or the EffectInfo struct values will not be initialized.
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
#include <ctime>
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
#include <tr1/memory>
|
||||
#include <memory>
|
||||
#include "CacheMemory.h"
|
||||
#include "Exceptions.h"
|
||||
#include "OpenMPUtilities.h"
|
||||
@@ -78,7 +78,7 @@ namespace openshot
|
||||
* r.Open(); // Open the reader
|
||||
*
|
||||
* // Get frame number 1 from the video
|
||||
* tr1::shared_ptr<Frame> f = r.GetFrame(1);
|
||||
* std::shared_ptr<Frame> f = r.GetFrame(1);
|
||||
*
|
||||
* // Now that we have an openshot::Frame object, lets have some fun!
|
||||
* f->Display(); // Display the frame on the screen
|
||||
@@ -108,7 +108,6 @@ namespace openshot
|
||||
|
||||
CacheMemory working_cache;
|
||||
CacheMemory missing_frames;
|
||||
map<AVPicture*, AVPicture*> frames;
|
||||
map<long int, long int> processing_video_frames;
|
||||
multimap<long int, long int> processing_audio_frames;
|
||||
map<long int, long int> processed_video_frames;
|
||||
@@ -117,7 +116,6 @@ namespace openshot
|
||||
multimap<long int, long int> missing_video_frames_source;
|
||||
multimap<long int, long int> missing_audio_frames;
|
||||
multimap<long int, long int> missing_audio_frames_source;
|
||||
multimap<long int, long int> duplicate_video_frames;
|
||||
map<long int, int> checked_frames;
|
||||
AudioLocation previous_packet_location;
|
||||
|
||||
@@ -128,7 +126,7 @@ namespace openshot
|
||||
long int pts_counter;
|
||||
long int num_packets_since_video_frame;
|
||||
long int num_checks_since_final;
|
||||
tr1::shared_ptr<Frame> last_video_frame;
|
||||
std::shared_ptr<Frame> last_video_frame;
|
||||
|
||||
bool is_seeking;
|
||||
long int seeking_pts;
|
||||
@@ -169,7 +167,7 @@ namespace openshot
|
||||
long int ConvertVideoPTStoFrame(long int pts);
|
||||
|
||||
/// Create a new Frame (or return an existing one) and add it to the working queue.
|
||||
tr1::shared_ptr<Frame> CreateFrame(long int requested_frame);
|
||||
std::shared_ptr<Frame> CreateFrame(long int requested_frame);
|
||||
|
||||
/// Calculate Starting video frame and sample # for an audio PTS
|
||||
AudioLocation GetAudioPTSLocation(long int pts);
|
||||
@@ -199,7 +197,7 @@ namespace openshot
|
||||
void ProcessAudioPacket(long int requested_frame, long int target_frame, int starting_sample);
|
||||
|
||||
/// Read the stream until we find the requested Frame
|
||||
tr1::shared_ptr<Frame> ReadStream(long int requested_frame);
|
||||
std::shared_ptr<Frame> ReadStream(long int requested_frame);
|
||||
|
||||
/// Remove AVFrame from cache (and deallocate it's memory)
|
||||
void RemoveAVFrame(AVPicture*);
|
||||
@@ -249,7 +247,7 @@ namespace openshot
|
||||
///
|
||||
/// @returns The requested frame of video
|
||||
/// @param requested_frame The frame number that is requested.
|
||||
tr1::shared_ptr<Frame> GetFrame(long int requested_frame) throw(OutOfBoundsFrame, ReaderClosed, TooManySeeks);
|
||||
std::shared_ptr<Frame> GetFrame(long int requested_frame) throw(OutOfBoundsFrame, ReaderClosed, TooManySeeks);
|
||||
|
||||
/// Determine if reader is open or closed
|
||||
bool IsOpen() { return is_open; };
|
||||
|
||||
@@ -102,11 +102,13 @@
|
||||
#define AV_ALLOCATE_FRAME() av_frame_alloc()
|
||||
#define AV_RESET_FRAME(av_frame) av_frame_unref(av_frame)
|
||||
#define AV_FREE_FRAME(av_frame) av_frame_free(av_frame)
|
||||
#define AV_FREE_PACKET(av_packet) av_packet_unref(av_packet)
|
||||
#else
|
||||
#define AV_ALLOCATE_FRAME() avcodec_alloc_frame()
|
||||
#define AV_RESET_FRAME(av_frame) avcodec_get_frame_defaults(av_frame)
|
||||
#define AV_FREE_FRAME(av_frame) avcodec_free_frame(av_frame)
|
||||
#endif
|
||||
#define AV_FREE_PACKET(av_packet) av_free_packet(av_packet)
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -181,20 +181,20 @@ namespace openshot
|
||||
int original_sample_rate;
|
||||
int original_channels;
|
||||
|
||||
tr1::shared_ptr<Frame> last_frame;
|
||||
deque<tr1::shared_ptr<Frame> > spooled_audio_frames;
|
||||
deque<tr1::shared_ptr<Frame> > spooled_video_frames;
|
||||
std::shared_ptr<Frame> last_frame;
|
||||
deque<std::shared_ptr<Frame> > spooled_audio_frames;
|
||||
deque<std::shared_ptr<Frame> > spooled_video_frames;
|
||||
|
||||
deque<tr1::shared_ptr<Frame> > queued_audio_frames;
|
||||
deque<tr1::shared_ptr<Frame> > queued_video_frames;
|
||||
deque<std::shared_ptr<Frame> > queued_audio_frames;
|
||||
deque<std::shared_ptr<Frame> > queued_video_frames;
|
||||
|
||||
deque<tr1::shared_ptr<Frame> > processed_frames;
|
||||
deque<tr1::shared_ptr<Frame> > deallocate_frames;
|
||||
deque<std::shared_ptr<Frame> > processed_frames;
|
||||
deque<std::shared_ptr<Frame> > deallocate_frames;
|
||||
|
||||
map<tr1::shared_ptr<Frame>, AVFrame*> av_frames;
|
||||
map<std::shared_ptr<Frame>, AVFrame*> av_frames;
|
||||
|
||||
/// Add an AVFrame to the cache
|
||||
void add_avframe(tr1::shared_ptr<Frame> frame, AVFrame* av_frame);
|
||||
void add_avframe(std::shared_ptr<Frame> frame, AVFrame* av_frame);
|
||||
|
||||
/// Add an audio output stream
|
||||
AVStream* add_audio_stream();
|
||||
@@ -232,13 +232,13 @@ namespace openshot
|
||||
void open_video(AVFormatContext *oc, AVStream *st);
|
||||
|
||||
/// process video frame
|
||||
void process_video_packet(tr1::shared_ptr<Frame> frame);
|
||||
void process_video_packet(std::shared_ptr<Frame> frame);
|
||||
|
||||
/// write all queued frames' audio to the video file
|
||||
void write_audio_packets(bool final);
|
||||
|
||||
/// write video frame
|
||||
bool write_video_packet(tr1::shared_ptr<Frame> frame, AVFrame* frame_final);
|
||||
bool write_video_packet(std::shared_ptr<Frame> frame, AVFrame* frame_final);
|
||||
|
||||
/// write all queued frames
|
||||
void write_queued_frames() throw (ErrorEncodingVideo);
|
||||
@@ -316,7 +316,7 @@ namespace openshot
|
||||
|
||||
/// @brief Add a frame to the stack waiting to be encoded.
|
||||
/// @param frame The openshot::Frame object to write to this image
|
||||
void WriteFrame(tr1::shared_ptr<Frame> frame) throw(ErrorEncodingVideo, WriterClosed);
|
||||
void WriteFrame(std::shared_ptr<Frame> frame) throw(ErrorEncodingVideo, WriterClosed);
|
||||
|
||||
/// @brief Write a block of frames from a reader
|
||||
/// @param reader A openshot::ReaderBase object which will provide frames to be written
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#include <QtWidgets/QHBoxLayout>
|
||||
#include <QtWidgets/QWidget>
|
||||
#include <QtWidgets/QLabel>
|
||||
#include <tr1/memory>
|
||||
#include <memory>
|
||||
#include <unistd.h>
|
||||
#include "ZmqLogger.h"
|
||||
#ifdef USE_IMAGEMAGICK
|
||||
@@ -108,17 +108,17 @@ namespace openshot
|
||||
* );
|
||||
*
|
||||
* // Some methods require a shared pointer to an openshot::Frame object.
|
||||
* tr1::shared_ptr<Frame> f(new Frame(1, 720, 480, "#000000", 44100, 2));
|
||||
* std::shared_ptr<Frame> f(new Frame(1, 720, 480, "#000000", 44100, 2));
|
||||
*
|
||||
* @endcode
|
||||
*/
|
||||
class Frame
|
||||
{
|
||||
private:
|
||||
tr1::shared_ptr<QImage> image;
|
||||
tr1::shared_ptr<QImage> wave_image;
|
||||
tr1::shared_ptr<juce::AudioSampleBuffer> audio;
|
||||
tr1::shared_ptr<QApplication> previewApp;
|
||||
std::shared_ptr<QImage> image;
|
||||
std::shared_ptr<QImage> wave_image;
|
||||
std::shared_ptr<juce::AudioSampleBuffer> audio;
|
||||
std::shared_ptr<QApplication> previewApp;
|
||||
CriticalSection addingImageSection;
|
||||
CriticalSection addingAudioSection;
|
||||
const unsigned char *qbuffer;
|
||||
@@ -165,14 +165,14 @@ namespace openshot
|
||||
void AddImage(int new_width, int new_height, int bytes_per_pixel, QImage::Format type, const unsigned char *pixels_);
|
||||
|
||||
/// Add (or replace) pixel data to the frame
|
||||
void AddImage(tr1::shared_ptr<QImage> new_image);
|
||||
void AddImage(std::shared_ptr<QImage> new_image);
|
||||
|
||||
/// Add (or replace) pixel data to the frame (for only the odd or even lines)
|
||||
void AddImage(tr1::shared_ptr<QImage> new_image, bool only_odd_lines);
|
||||
void AddImage(std::shared_ptr<QImage> new_image, bool only_odd_lines);
|
||||
|
||||
#ifdef USE_IMAGEMAGICK
|
||||
/// Add (or replace) pixel data to the frame from an ImageMagick Image
|
||||
void AddMagickImage(tr1::shared_ptr<Magick::Image> new_image);
|
||||
void AddMagickImage(std::shared_ptr<Magick::Image> new_image);
|
||||
#endif
|
||||
|
||||
/// Add audio samples to a specific channel
|
||||
@@ -230,11 +230,11 @@ namespace openshot
|
||||
int64 GetBytes();
|
||||
|
||||
/// Get pointer to Qt QImage image object
|
||||
tr1::shared_ptr<QImage> GetImage();
|
||||
std::shared_ptr<QImage> GetImage();
|
||||
|
||||
#ifdef USE_IMAGEMAGICK
|
||||
/// Get pointer to ImageMagick image object
|
||||
tr1::shared_ptr<Magick::Image> GetMagickImage();
|
||||
std::shared_ptr<Magick::Image> GetMagickImage();
|
||||
#endif
|
||||
|
||||
/// Set Pixel Aspect Ratio
|
||||
@@ -256,7 +256,7 @@ namespace openshot
|
||||
static int GetSamplesPerFrame(long int frame_number, Fraction fps, int sample_rate, int channels);
|
||||
|
||||
/// Get an audio waveform image
|
||||
tr1::shared_ptr<QImage> GetWaveform(int width, int height, int Red, int Green, int Blue, int Alpha);
|
||||
std::shared_ptr<QImage> GetWaveform(int width, int height, int Red, int Green, int Blue, int Alpha);
|
||||
|
||||
/// Get an audio waveform image pixels
|
||||
const unsigned char* GetWaveformPixels(int width, int height, int Red, int Green, int Blue, int Alpha);
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <iostream>
|
||||
#include <math.h>
|
||||
#include <vector>
|
||||
#include <tr1/memory>
|
||||
#include <memory>
|
||||
#include "CacheMemory.h"
|
||||
#include "../include/ReaderBase.h"
|
||||
#include "../include/Frame.h"
|
||||
@@ -130,7 +130,7 @@ namespace openshot
|
||||
* \code
|
||||
* // Create a frame mapper for a reader, and convert the frame rate (from 24 fps to 29.97 fps)
|
||||
* FrameMapper mapping(reader, Fraction(30000, 1001), PULLDOWN_CLASSIC, 44100, 2, LAYOUT_STEREO);
|
||||
* tr1::shared_ptr<Frame> frame2 = mapping.GetFrame(2);
|
||||
* std::shared_ptr<Frame> frame2 = mapping.GetFrame(2);
|
||||
|
||||
* // If you need to change the mapping...
|
||||
* mapping.ChangeMapping(Fraction(24, 1), PULLDOWN_CLASSIC, 48000, 2, LAYOUT_MONO)
|
||||
@@ -154,7 +154,7 @@ namespace openshot
|
||||
void AddField(Field field);
|
||||
|
||||
// Get Frame or Generate Blank Frame
|
||||
tr1::shared_ptr<Frame> GetOrCreateFrame(long int number);
|
||||
std::shared_ptr<Frame> GetOrCreateFrame(long int number);
|
||||
|
||||
// Use the original and target frame rates and a pull-down technique to create
|
||||
// a mapping between the original fields and frames or a video to a new frame rate.
|
||||
@@ -194,7 +194,7 @@ namespace openshot
|
||||
///
|
||||
/// @returns The requested frame of video
|
||||
/// @param requested_frame The frame number that is requested.
|
||||
tr1::shared_ptr<Frame> GetFrame(long int requested_frame) throw(ReaderClosed);
|
||||
std::shared_ptr<Frame> GetFrame(long int requested_frame) throw(ReaderClosed);
|
||||
|
||||
/// Determine if reader is open or closed
|
||||
bool IsOpen();
|
||||
@@ -218,7 +218,7 @@ namespace openshot
|
||||
ReaderBase* Reader() throw(ReaderClosed);
|
||||
|
||||
/// Resample audio and map channels (if needed)
|
||||
void ResampleMappedAudio(tr1::shared_ptr<Frame> frame, long int original_frame_number);
|
||||
void ResampleMappedAudio(std::shared_ptr<Frame> frame, long int original_frame_number);
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user