mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 23:35:03 +01:00
NO-OP: clang-format
This commit is contained in:
parent
0f7229fb02
commit
cc69274234
2 changed files with 56 additions and 52 deletions
|
|
@ -29,22 +29,24 @@
|
||||||
|
|
||||||
namespace ARDOUR {
|
namespace ARDOUR {
|
||||||
|
|
||||||
class LIBARDOUR_API FFMPEGFileImportableSource : public ImportableSource {
|
class LIBARDOUR_API FFMPEGFileImportableSource : public ImportableSource
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
enum {
|
enum {
|
||||||
ALL_CHANNELS = -1,
|
ALL_CHANNELS = -1,
|
||||||
};
|
};
|
||||||
|
|
||||||
FFMPEGFileImportableSource (const std::string& path, int channel = ALL_CHANNELS);
|
FFMPEGFileImportableSource (const std::string& path, int channel = ALL_CHANNELS);
|
||||||
|
|
||||||
virtual ~FFMPEGFileImportableSource ();
|
virtual ~FFMPEGFileImportableSource ();
|
||||||
|
|
||||||
/* ImportableSource API */
|
/* ImportableSource API */
|
||||||
|
samplecnt_t read (Sample*, samplecnt_t nframes);
|
||||||
uint32_t channels () const { return _channels; }
|
uint32_t channels () const { return _channels; }
|
||||||
samplecnt_t length () const { return _length; }
|
samplecnt_t length () const { return _length; }
|
||||||
samplecnt_t samplerate () const { return _samplerate; }
|
samplecnt_t samplerate () const { return _samplerate; }
|
||||||
samplepos_t natural_position () const { return _natural_position; }
|
|
||||||
void seek (samplepos_t pos);
|
void seek (samplepos_t pos);
|
||||||
samplecnt_t read (Sample*, samplecnt_t nframes);
|
samplepos_t natural_position () const { return _natural_position; }
|
||||||
|
|
||||||
bool clamped_at_unity () const { return false; }
|
bool clamped_at_unity () const { return false; }
|
||||||
|
|
||||||
std::string format_name () const { return _format_name; }
|
std::string format_name () const { return _format_name; }
|
||||||
|
|
@ -65,12 +67,13 @@ private:
|
||||||
std::string _format_name;
|
std::string _format_name;
|
||||||
|
|
||||||
PBD::RingBuffer<Sample> _buffer;
|
PBD::RingBuffer<Sample> _buffer;
|
||||||
// Set to 1 to indicate that ffmpeg should be terminating.
|
/* Set to 1 to indicate that ffmpeg should be terminating. */
|
||||||
GATOMIC_QUAL gint _ffmpeg_should_terminate;
|
GATOMIC_QUAL gint _ffmpeg_should_terminate;
|
||||||
|
|
||||||
// To make sure we don't try to parse partial floats, we might have a couple of bytes
|
/* To make sure we don't try to parse partial floats, we might have a couple of bytes
|
||||||
// of leftover unparsable data after any `did_read_data` call. Those couple of bytes are
|
* of leftover unparsable data after any `did_read_data` call. Those couple of bytes are
|
||||||
// stored here until the next `did_read_data` call.
|
* stored here until the next `did_read_data` call.
|
||||||
|
*/
|
||||||
std::string _leftover_data;
|
std::string _leftover_data;
|
||||||
|
|
||||||
samplecnt_t _read_pos;
|
samplecnt_t _read_pos;
|
||||||
|
|
@ -79,6 +82,6 @@ private:
|
||||||
PBD::ScopedConnection _ffmpeg_conn;
|
PBD::ScopedConnection _ffmpeg_conn;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
} // namespace ARDOUR
|
||||||
|
|
||||||
#endif /* _ardour_ffmpegfile_importable_source_h_ */
|
#endif /* _ardour_ffmpegfile_importable_source_h_ */
|
||||||
|
|
|
||||||
|
|
@ -19,17 +19,18 @@
|
||||||
#include <boost/property_tree/json_parser.hpp>
|
#include <boost/property_tree/json_parser.hpp>
|
||||||
#include <glibmm.h>
|
#include <glibmm.h>
|
||||||
|
|
||||||
#include "pbd/error.h"
|
|
||||||
#include "pbd/compose.h"
|
#include "pbd/compose.h"
|
||||||
|
#include "pbd/error.h"
|
||||||
#include "pbd/i18n.h"
|
#include "pbd/i18n.h"
|
||||||
|
|
||||||
#include "ardour/ffmpegfileimportable.h"
|
#include "ardour/ffmpegfileimportable.h"
|
||||||
#include "ardour/filesystem_paths.h"
|
#include "ardour/filesystem_paths.h"
|
||||||
|
|
||||||
namespace ARDOUR {
|
using namespace ARDOUR;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
receive_stdout (std::string* out, const std::string& data, size_t size) {
|
receive_stdout (std::string* out, const std::string& data, size_t size)
|
||||||
|
{
|
||||||
*out += data;
|
*out += data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -49,6 +50,7 @@ FFMPEGFileImportableSource::FFMPEGFileImportableSource(const std::string &path,
|
||||||
|
|
||||||
int a = 0;
|
int a = 0;
|
||||||
char** argp = (char**)calloc (10, sizeof (char*));
|
char** argp = (char**)calloc (10, sizeof (char*));
|
||||||
|
|
||||||
argp[a++] = strdup (ffprobe_exe.c_str ());
|
argp[a++] = strdup (ffprobe_exe.c_str ());
|
||||||
argp[a++] = strdup (_path.c_str ());
|
argp[a++] = strdup (_path.c_str ());
|
||||||
argp[a++] = strdup ("-show_streams");
|
argp[a++] = strdup ("-show_streams");
|
||||||
|
|
@ -73,8 +75,9 @@ FFMPEGFileImportableSource::FFMPEGFileImportableSource(const std::string &path,
|
||||||
exec->wait ();
|
exec->wait ();
|
||||||
|
|
||||||
namespace pt = boost::property_tree;
|
namespace pt = boost::property_tree;
|
||||||
std::istringstream is (ffprobe_output);
|
|
||||||
pt::ptree root;
|
pt::ptree root;
|
||||||
|
std::istringstream is (ffprobe_output);
|
||||||
|
|
||||||
pt::read_json (is, root);
|
pt::read_json (is, root);
|
||||||
|
|
||||||
// TODO: Find the stream with the most channels, rather than whatever the first one is.
|
// TODO: Find the stream with the most channels, rather than whatever the first one is.
|
||||||
|
|
@ -241,5 +244,3 @@ FFMPEGFileImportableSource::did_read_data (std::string data, size_t size)
|
||||||
_buffer.increment_write_idx (written);
|
_buffer.increment_write_idx (written);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue