mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
move ff* structs & typedef into dedicated namespace
(further avoid conflicts with plugins)
This commit is contained in:
parent
8f5cc1dbba
commit
003492cbf9
4 changed files with 22 additions and 21 deletions
|
|
@ -584,7 +584,7 @@ ExportVideoDialog::encode_pass (int pass)
|
|||
}
|
||||
|
||||
std::string preset = preset_combo.get_active_text();
|
||||
FFSettings ffs ; /* = transcoder->default_encoder_settings(); */
|
||||
TranscodeFfmpeg::FFSettings ffs ; /* = transcoder->default_encoder_settings(); */
|
||||
ffs.clear();
|
||||
|
||||
if (fps_checkbox.get_active()) {
|
||||
|
|
@ -740,7 +740,7 @@ ExportVideoDialog::encode_pass (int pass)
|
|||
transcoder->set_avoffset(av_offset / (double)_session->nominal_frame_rate());
|
||||
}
|
||||
|
||||
FFSettings meta = transcoder->default_meta_data();
|
||||
TranscodeFfmpeg::FFSettings meta = transcoder->default_meta_data();
|
||||
if (meta_checkbox.get_active()) {
|
||||
ARDOUR::SessionMetadata * session_data = ARDOUR::SessionMetadata::Metadata();
|
||||
if (session_data->year() > 0 ) {
|
||||
|
|
|
|||
|
|
@ -261,10 +261,10 @@ TranscodeFfmpeg::probe ()
|
|||
return true;
|
||||
}
|
||||
|
||||
FFSettings
|
||||
TranscodeFfmpeg::FFSettings
|
||||
TranscodeFfmpeg::default_encoder_settings ()
|
||||
{
|
||||
FFSettings ffs;
|
||||
TranscodeFfmpeg::FFSettings ffs;
|
||||
ffs.clear();
|
||||
ffs["-vcodec"] = "mpeg4";
|
||||
ffs["-acodec"] = "ac3";
|
||||
|
|
@ -273,10 +273,10 @@ TranscodeFfmpeg::default_encoder_settings ()
|
|||
return ffs;
|
||||
}
|
||||
|
||||
FFSettings
|
||||
TranscodeFfmpeg::FFSettings
|
||||
TranscodeFfmpeg::default_meta_data ()
|
||||
{
|
||||
FFSettings ffm;
|
||||
TranscodeFfmpeg::FFSettings ffm;
|
||||
ffm.clear();
|
||||
ffm["comment"] = "Created with ardour";
|
||||
return ffm;
|
||||
|
|
@ -308,7 +308,7 @@ TranscodeFfmpeg::format_metadata (std::string key, std::string value)
|
|||
}
|
||||
|
||||
bool
|
||||
TranscodeFfmpeg::encode (std::string outfile, std::string inf_a, std::string inf_v, FFSettings ffs, FFSettings meta, bool map)
|
||||
TranscodeFfmpeg::encode (std::string outfile, std::string inf_a, std::string inf_v, TranscodeFfmpeg::FFSettings ffs, TranscodeFfmpeg::FFSettings meta, bool map)
|
||||
{
|
||||
#define MAX_FFMPEG_ENCODER_ARGS (100)
|
||||
char **argp;
|
||||
|
|
@ -327,11 +327,11 @@ TranscodeFfmpeg::encode (std::string outfile, std::string inf_a, std::string inf
|
|||
argp[a++] = strdup("-i");
|
||||
argp[a++] = strdup(inf_a.c_str());
|
||||
|
||||
for(FFSettings::const_iterator it = ffs.begin(); it != ffs.end(); ++it) {
|
||||
for(TranscodeFfmpeg::FFSettings::const_iterator it = ffs.begin(); it != ffs.end(); ++it) {
|
||||
argp[a++] = strdup(it->first.c_str());
|
||||
argp[a++] = strdup(it->second.c_str());
|
||||
}
|
||||
for(FFSettings::const_iterator it = meta.begin(); it != meta.end(); ++it) {
|
||||
for(TranscodeFfmpeg::FFSettings::const_iterator it = meta.begin(); it != meta.end(); ++it) {
|
||||
argp[a++] = strdup("-metadata");
|
||||
argp[a++] = format_metadata(it->first.c_str(), it->second.c_str());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,14 +24,6 @@
|
|||
#include "ardour/types.h"
|
||||
#include "system_exec.h"
|
||||
|
||||
/* TODO: use a namespace here ? */
|
||||
struct FFAudioStream {
|
||||
std::string name;
|
||||
std::string stream_id;
|
||||
uint32_t channels;
|
||||
};
|
||||
typedef std::vector<FFAudioStream> AudioStreams;
|
||||
typedef std::map<std::string,std::string> FFSettings;
|
||||
|
||||
/** @class TranscodeFfmpeg
|
||||
* @brief wrapper around ffmpeg and ffprobe command-line utils
|
||||
|
|
@ -46,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.
|
||||
*
|
||||
|
|
@ -110,7 +111,7 @@ 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()
|
||||
|
|
@ -145,7 +146,7 @@ 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);
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ TranscodeVideoDialog::TranscodeVideoDialog (Session* s, std::string infile)
|
|||
|
||||
int w = 0, h = 0;
|
||||
m_aspect = 4.0/3.0;
|
||||
AudioStreams as; as.clear();
|
||||
TranscodeFfmpeg::FFAudioStreams as; as.clear();
|
||||
|
||||
path_hbox->pack_start (path_label, false, false, 3);
|
||||
path_hbox->pack_start (path_entry, true, true, 3);
|
||||
|
|
@ -227,7 +227,7 @@ TranscodeVideoDialog::TranscodeVideoDialog (Session* s, std::string infile)
|
|||
t->attach (audio_combo, 1, 4, 2, 3);
|
||||
audio_combo.append_text("No audio");
|
||||
if (as.size() > 0) {
|
||||
for (AudioStreams::iterator it = as.begin(); it < as.end(); ++it) {
|
||||
for (TranscodeFfmpeg::FFAudioStreams::iterator it = as.begin(); it < as.end(); ++it) {
|
||||
audio_combo.append_text((*it).name);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue