X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Ftranscode_ffmpeg.h;h=e7f4c5690063c8f2e30082052b503cbe0b4484ec;hb=e8903a7590caaa46498d3e53c9d7df63edb24090;hp=b809719f010616d1150f78ccd08ed273e02ff532;hpb=1d48fb011e5f5eefbc656dc72197a620654ff847;p=ardour.git diff --git a/gtk2_ardour/transcode_ffmpeg.h b/gtk2_ardour/transcode_ffmpeg.h index b809719f01..e7f4c56900 100644 --- a/gtk2_ardour/transcode_ffmpeg.h +++ b/gtk2_ardour/transcode_ffmpeg.h @@ -17,23 +17,13 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifdef WITH_VIDEOTIMELINE - #ifndef __ardour_transcode_ffmpeg_h__ #define __ardour_transcode_ffmpeg_h__ #include +#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 AudioStreams; -typedef std::map 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 FFAudioStreams; + typedef std::map FFSettings; + + /** instantiate a new transcoder. If a file-name is given, the file's * attributes (fps, duration, geometry etc) are read. * @@ -71,7 +70,7 @@ class TranscodeFfmpeg : public sigc::trackable * specified as element-number in \ref get_audio(). * @return \c true if the transcoder process was successfully started. */ - bool extract_audio (std::string outfile, ARDOUR::framecnt_t samplerate, unsigned int stream=0); + bool extract_audio (std::string outfile, ARDOUR::samplecnt_t samplerate, unsigned int stream=0); /** transcode video and mux audio files into a new video-file. * @param outfile full-path of output file to create (existing files are overwritten) * @param inf_a filename of input audio-file @@ -101,7 +100,7 @@ class TranscodeFfmpeg : public sigc::trackable * during \ref encode \ref transcode and \ref extract_audio * The parameters are current and last video-frame. */ - PBD::Signal2 Progress; + PBD::Signal2 Progress; /** signal emitted when the transcoder process terminates. */ PBD::Signal0 Finished; @@ -109,33 +108,35 @@ class TranscodeFfmpeg : public sigc::trackable double get_aspect () { return m_aspect; } int get_width() { return m_width; } int get_height() { return m_height; } - ARDOUR::framecnt_t get_duration() { return m_duration; } + ARDOUR::samplecnt_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; } + void set_duration(ARDOUR::samplecnt_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; - ARDOUR::framecnt_t m_duration; + std::string m_sar; + ARDOUR::samplecnt_t m_duration; int m_width; int m_height; std::string m_codec; @@ -147,9 +148,8 @@ class TranscodeFfmpeg : public sigc::trackable 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); void ffmpegparse_a (std::string d, size_t s); void ffprobeparse (std::string d, size_t s); @@ -164,4 +164,3 @@ class TranscodeFfmpeg : public sigc::trackable }; #endif /* __ardour_transcode_ffmpeg_h__ */ -#endif /* WITH_VIDEOTIMELINE */