diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-03-17 15:51:42 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-03-17 15:51:42 +0000 |
| commit | 9c4c94748ee6bcdec09c63974a4f06d3835db4c5 (patch) | |
| tree | 469954aa0f27e9a44e5155cefb3062eb70c97ae8 /src/lib | |
| parent | 9fe1a5c6dd0c0b90d2fa20d77a86e30a3c7a966b (diff) | |
Rename ExternalAudioDecoder -> SndfileDecoder.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/decoder_factory.cc | 6 | ||||
| -rw-r--r-- | src/lib/film.cc | 16 | ||||
| -rw-r--r-- | src/lib/film.h | 2 | ||||
| -rw-r--r-- | src/lib/sndfile_decoder.cc (renamed from src/lib/external_audio_decoder.cc) | 36 | ||||
| -rw-r--r-- | src/lib/sndfile_decoder.h (renamed from src/lib/external_audio_decoder.h) | 18 | ||||
| -rw-r--r-- | src/lib/stream.cc | 4 | ||||
| -rw-r--r-- | src/lib/wscript | 2 |
7 files changed, 42 insertions, 42 deletions
diff --git a/src/lib/decoder_factory.cc b/src/lib/decoder_factory.cc index 478ccd1c1..f7f9f4074 100644 --- a/src/lib/decoder_factory.cc +++ b/src/lib/decoder_factory.cc @@ -25,7 +25,7 @@ #include "ffmpeg_decoder.h" #include "imagemagick_decoder.h" #include "film.h" -#include "external_audio_decoder.h" +#include "sndfile_decoder.h" #include "decoder_factory.h" using std::string; @@ -47,7 +47,7 @@ decoder_factory ( /* A single image file, or a directory of them */ return Decoders ( shared_ptr<VideoDecoder> (new ImageMagickDecoder (f, o)), - shared_ptr<AudioDecoder> (new ExternalAudioDecoder (f, o)) + shared_ptr<AudioDecoder> (new SndfileDecoder (f, o)) ); } @@ -56,5 +56,5 @@ decoder_factory ( return Decoders (fd, fd); } - return Decoders (fd, shared_ptr<AudioDecoder> (new ExternalAudioDecoder (f, o))); + return Decoders (fd, shared_ptr<AudioDecoder> (new SndfileDecoder (f, o))); } diff --git a/src/lib/film.cc b/src/lib/film.cc index 77f9828cd..c84042451 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -50,7 +50,7 @@ #include "ui_signaller.h" #include "video_decoder.h" #include "audio_decoder.h" -#include "external_audio_decoder.h" +#include "sndfile_decoder.h" #include "analyse_audio_job.h" #include "i18n.h" @@ -138,7 +138,7 @@ Film::Film (string d, bool must_exist) } } - _external_audio_stream = ExternalAudioStream::create (); + _sndfile_stream = SndfileStream::create (); if (must_exist) { read_metadata (); @@ -183,7 +183,7 @@ Film::Film (Film const & o) , _length (o._length) , _content_digest (o._content_digest) , _content_audio_streams (o._content_audio_streams) - , _external_audio_stream (o._external_audio_stream) + , _sndfile_stream (o._sndfile_stream) , _subtitle_streams (o._subtitle_streams) , _source_frame_rate (o._source_frame_rate) , _dirty (o._dirty) @@ -459,7 +459,7 @@ Film::write_metadata () const f << "content_audio_stream " << (*i)->to_string () << endl; } - f << "external_audio_stream " << _external_audio_stream->to_string() << endl; + f << "external_audio_stream " << _sndfile_stream->to_string() << endl; for (vector<shared_ptr<SubtitleStream> >::const_iterator i = _subtitle_streams.begin(); i != _subtitle_streams.end(); ++i) { f << "subtitle_stream " << (*i)->to_string () << endl; @@ -598,7 +598,7 @@ Film::read_metadata () } else if (k == "content_audio_stream" || (!version && k == "audio_stream")) { _content_audio_streams.push_back (audio_stream_factory (v, version)); } else if (k == "external_audio_stream") { - _external_audio_stream = audio_stream_factory (v, version); + _sndfile_stream = audio_stream_factory (v, version); } else if (k == "subtitle_stream") { _subtitle_streams.push_back (subtitle_stream_factory (v, version)); } else if (k == "source_frame_rate") { @@ -1127,9 +1127,9 @@ Film::set_external_audio (vector<string> a) _external_audio = a; } - shared_ptr<ExternalAudioDecoder> decoder (new ExternalAudioDecoder (shared_from_this(), DecodeOptions())); + shared_ptr<SndfileDecoder> decoder (new SndfileDecoder (shared_from_this(), DecodeOptions())); if (decoder->audio_stream()) { - _external_audio_stream = decoder->audio_stream (); + _sndfile_stream = decoder->audio_stream (); } signal_changed (EXTERNAL_AUDIO); @@ -1364,7 +1364,7 @@ Film::audio_stream () const return _content_audio_stream; } - return _external_audio_stream; + return _sndfile_stream; } string diff --git a/src/lib/film.h b/src/lib/film.h index 698e7ef46..adc4b0eec 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -476,7 +476,7 @@ private: /** The audio streams in our content */ std::vector<boost::shared_ptr<AudioStream> > _content_audio_streams; /** A stream to represent possible external audio (will always exist) */ - boost::shared_ptr<AudioStream> _external_audio_stream; + boost::shared_ptr<AudioStream> _sndfile_stream; /** the subtitle streams that we can use */ std::vector<boost::shared_ptr<SubtitleStream> > _subtitle_streams; /** Frames per second of the source */ diff --git a/src/lib/external_audio_decoder.cc b/src/lib/sndfile_decoder.cc index 1248b5a3b..0e3e5e234 100644 --- a/src/lib/external_audio_decoder.cc +++ b/src/lib/sndfile_decoder.cc @@ -19,7 +19,7 @@ #include <iostream> #include <sndfile.h> -#include "external_audio_decoder.h" +#include "sndfile_decoder.h" #include "film.h" #include "exceptions.h" @@ -33,7 +33,7 @@ using std::cout; using boost::shared_ptr; using boost::optional; -ExternalAudioDecoder::ExternalAudioDecoder (shared_ptr<Film> f, DecodeOptions o) +SndfileDecoder::SndfileDecoder (shared_ptr<Film> f, DecodeOptions o) : Decoder (f, o) , AudioDecoder (f, o) { @@ -43,7 +43,7 @@ ExternalAudioDecoder::ExternalAudioDecoder (shared_ptr<Film> f, DecodeOptions o) } vector<SNDFILE*> -ExternalAudioDecoder::open_files (sf_count_t & frames) +SndfileDecoder::open_files (sf_count_t & frames) { vector<string> const files = _film->external_audio (); @@ -79,8 +79,8 @@ ExternalAudioDecoder::open_files (sf_count_t & frames) sndfiles.push_back (s); if (first) { - shared_ptr<ExternalAudioStream> st ( - new ExternalAudioStream ( + shared_ptr<SndfileStream> st ( + new SndfileStream ( info.samplerate, av_get_default_channel_layout (N) ) ); @@ -101,7 +101,7 @@ ExternalAudioDecoder::open_files (sf_count_t & frames) } bool -ExternalAudioDecoder::pass () +SndfileDecoder::pass () { sf_count_t frames; vector<SNDFILE*> sndfiles = open_files (frames); @@ -136,38 +136,38 @@ ExternalAudioDecoder::pass () } void -ExternalAudioDecoder::close_files (vector<SNDFILE*> const & sndfiles) +SndfileDecoder::close_files (vector<SNDFILE*> const & sndfiles) { for (size_t i = 0; i < sndfiles.size(); ++i) { sf_close (sndfiles[i]); } } -shared_ptr<ExternalAudioStream> -ExternalAudioStream::create () +shared_ptr<SndfileStream> +SndfileStream::create () { - return shared_ptr<ExternalAudioStream> (new ExternalAudioStream); + return shared_ptr<SndfileStream> (new SndfileStream); } -shared_ptr<ExternalAudioStream> -ExternalAudioStream::create (string t, optional<int> v) +shared_ptr<SndfileStream> +SndfileStream::create (string t, optional<int> v) { if (!v) { /* version < 1; no type in the string, and there's only FFmpeg streams anyway */ - return shared_ptr<ExternalAudioStream> (); + return shared_ptr<SndfileStream> (); } stringstream s (t); string type; s >> type; if (type != N_("external")) { - return shared_ptr<ExternalAudioStream> (); + return shared_ptr<SndfileStream> (); } - return shared_ptr<ExternalAudioStream> (new ExternalAudioStream (t, v)); + return shared_ptr<SndfileStream> (new SndfileStream (t, v)); } -ExternalAudioStream::ExternalAudioStream (string t, optional<int> v) +SndfileStream::SndfileStream (string t, optional<int> v) { assert (v); @@ -176,13 +176,13 @@ ExternalAudioStream::ExternalAudioStream (string t, optional<int> v) s >> type >> _sample_rate >> _channel_layout; } -ExternalAudioStream::ExternalAudioStream () +SndfileStream::SndfileStream () { } string -ExternalAudioStream::to_string () const +SndfileStream::to_string () const { return String::compose (N_("external %1 %2"), _sample_rate, _channel_layout); } diff --git a/src/lib/external_audio_decoder.h b/src/lib/sndfile_decoder.h index 6f010abb1..e16eab673 100644 --- a/src/lib/external_audio_decoder.h +++ b/src/lib/sndfile_decoder.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012 Carl Hetherington <cth@carlh.net> + Copyright (C) 2012-2013 Carl Hetherington <cth@carlh.net> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -22,29 +22,29 @@ #include "audio_decoder.h" #include "stream.h" -class ExternalAudioStream : public AudioStream +class SndfileStream : public AudioStream { public: - ExternalAudioStream (int sample_rate, int64_t layout) + SndfileStream (int sample_rate, int64_t layout) : AudioStream (sample_rate, layout) {} std::string to_string () const; - static boost::shared_ptr<ExternalAudioStream> create (); - static boost::shared_ptr<ExternalAudioStream> create (std::string t, boost::optional<int> v); + static boost::shared_ptr<SndfileStream> create (); + static boost::shared_ptr<SndfileStream> create (std::string t, boost::optional<int> v); private: friend class stream_test; - ExternalAudioStream (); - ExternalAudioStream (std::string t, boost::optional<int> v); + SndfileStream (); + SndfileStream (std::string t, boost::optional<int> v); }; -class ExternalAudioDecoder : public AudioDecoder +class SndfileDecoder : public AudioDecoder { public: - ExternalAudioDecoder (boost::shared_ptr<Film>, DecodeOptions); + SndfileDecoder (boost::shared_ptr<Film>, DecodeOptions); bool pass (); diff --git a/src/lib/stream.cc b/src/lib/stream.cc index e5a2bbc2b..bfe7b5eb4 100644 --- a/src/lib/stream.cc +++ b/src/lib/stream.cc @@ -21,7 +21,7 @@ #include "compose.hpp" #include "stream.h" #include "ffmpeg_decoder.h" -#include "external_audio_decoder.h" +#include "sndfile_decoder.h" #include "i18n.h" @@ -74,7 +74,7 @@ audio_stream_factory (string t, optional<int> v) s = FFmpegAudioStream::create (t, v); if (!s) { - s = ExternalAudioStream::create (t, v); + s = SndfileStream::create (t, v); } return s; diff --git a/src/lib/wscript b/src/lib/wscript index d36a24e7a..de39345d5 100644 --- a/src/lib/wscript +++ b/src/lib/wscript @@ -20,7 +20,6 @@ sources = """ dolby_cp750.cc encoder.cc examine_content_job.cc - external_audio_decoder.cc filter_graph.cc ffmpeg_compatibility.cc ffmpeg_decoder.cc @@ -38,6 +37,7 @@ sources = """ scp_dcp_job.cc scaler.cc server.cc + sndfile_decoder.cc sound_processor.cc stream.cc subtitle.cc |
