add variant of Rect::expand() that allows different amounts in each direction
[ardour.git] / gtk2_ardour / transcode_ffmpeg.h
index 2fd9f2f3f26eb9962256917bb803640e5c5890d6..2ee7529dc51e83507fcb9ee11d2dc05326e43ef7 100644 (file)
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
 */
-#ifdef WITH_VIDEOTIMELINE
-
 #ifndef __ardour_transcode_ffmpeg_h__
 #define __ardour_transcode_ffmpeg_h__
 
 #include <string>
+#include "ardour/system_exec.h"
 #include "ardour/types.h"
-#include "system_exec.h"
 
-/* TODO: use a namespace here ? */
-struct AudioStream {
-       std::string name;
-       std::string stream_id;
-       uint32_t channels;
-};
-typedef std::vector<AudioStream> AudioStreams;
-typedef std::map<std::string,std::string> FFSettings;
 
 /** @class TranscodeFfmpeg
  *  @brief wrapper around ffmpeg and ffprobe command-line utils
@@ -48,6 +38,15 @@ class TranscodeFfmpeg : public sigc::trackable
 {
        public:
 
+       struct FFAudioStream {
+               std::string name;
+               std::string stream_id;
+               uint32_t channels;
+       };
+       typedef std::vector<FFAudioStream> FFAudioStreams;
+       typedef std::map<std::string,std::string> FFSettings;
+
+
                /** instantiate a new transcoder. If a file-name is given, the file's
                 * attributes (fps, duration, geometry etc) are read.
                 *
@@ -112,37 +111,44 @@ class TranscodeFfmpeg : public sigc::trackable
                ARDOUR::framecnt_t get_duration() { return m_duration; }
                std::string  get_codec() { return m_codec; }
 
-               AudioStreams get_audio() { return m_audio; }
+               FFAudioStreams get_audio() { return m_audio; }
 
                /** override file duration used with the \ref Progress signal.
                 * @param d duration in video-frames = length_in_seconds * get_fps()
                 */
                void set_duration(ARDOUR::framecnt_t d) { m_duration = d; }
 
+               /* offset, lead-in/out are in seconds */
                void set_avoffset(double av_offset) { m_avoffset = av_offset; }
+               void set_leadinout(double lead_in, double lead_out) { m_lead_in = lead_in; m_lead_out = lead_out; }
 
+               void set_fps(double fps) { m_fps = fps; } // on export, used for rounding only.
 
 #if 1 /* tentative debug mode */
                void   set_debug (bool onoff) { debug_enable = onoff; }
 #endif
        protected:
                std::string infile;
-               SystemExec  *ffcmd;
+               ARDOUR::SystemExec  *ffcmd;
 
                bool probe ();
 
                double m_fps;
                double m_aspect;
+               std::string m_sar;
                ARDOUR::framecnt_t m_duration;
                int m_width;
                int m_height;
                std::string m_codec;
 
+               int m_videoidx;
                double m_avoffset;
+               double m_lead_in;
+               double m_lead_out;
                bool ffexecok;
                bool probeok;
 
-               AudioStreams m_audio;
+               FFAudioStreams m_audio;
 
                char *format_metadata (std::string, std::string);
                void ffmpegparse_v (std::string d, size_t s);
@@ -159,4 +165,3 @@ class TranscodeFfmpeg : public sigc::trackable
 };
 
 #endif /* __ardour_transcode_ffmpeg_h__ */
-#endif /* WITH_VIDEOTIMELINE */