NO-OP: clang-format

This commit is contained in:
Robin Gareus 2021-06-21 02:51:14 +02:00
parent 0f7229fb02
commit cc69274234
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
2 changed files with 56 additions and 52 deletions

View file

@ -29,22 +29,24 @@
namespace ARDOUR {
class LIBARDOUR_API FFMPEGFileImportableSource : public ImportableSource {
class LIBARDOUR_API FFMPEGFileImportableSource : public ImportableSource
{
public:
enum {
ALL_CHANNELS = -1,
};
FFMPEGFileImportableSource (const std::string& path, int channel = ALL_CHANNELS);
virtual ~FFMPEGFileImportableSource ();
/* ImportableSource API */
samplecnt_t read (Sample*, samplecnt_t nframes);
uint32_t channels () const { return _channels; }
samplecnt_t length () const { return _length; }
samplecnt_t samplerate () const { return _samplerate; }
samplepos_t natural_position () const { return _natural_position; }
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; }
std::string format_name () const { return _format_name; }
@ -65,12 +67,13 @@ private:
std::string _format_name;
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;
// 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
// stored here until the next `did_read_data` call.
/* 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
* stored here until the next `did_read_data` call.
*/
std::string _leftover_data;
samplecnt_t _read_pos;
@ -79,6 +82,6 @@ private:
PBD::ScopedConnection _ffmpeg_conn;
};
}
} // namespace ARDOUR
#endif /* _ardour_ffmpegfile_importable_source_h_ */

View file

@ -19,17 +19,18 @@
#include <boost/property_tree/json_parser.hpp>
#include <glibmm.h>
#include "pbd/error.h"
#include "pbd/compose.h"
#include "pbd/error.h"
#include "pbd/i18n.h"
#include "ardour/ffmpegfileimportable.h"
#include "ardour/filesystem_paths.h"
namespace ARDOUR {
using namespace ARDOUR;
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;
}
@ -49,6 +50,7 @@ FFMPEGFileImportableSource::FFMPEGFileImportableSource(const std::string &path,
int a = 0;
char** argp = (char**)calloc (10, sizeof (char*));
argp[a++] = strdup (ffprobe_exe.c_str ());
argp[a++] = strdup (_path.c_str ());
argp[a++] = strdup ("-show_streams");
@ -73,8 +75,9 @@ FFMPEGFileImportableSource::FFMPEGFileImportableSource(const std::string &path,
exec->wait ();
namespace pt = boost::property_tree;
std::istringstream is (ffprobe_output);
pt::ptree root;
std::istringstream is (ffprobe_output);
pt::read_json (is, root);
// 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);
}
}
}