Remove some unused code.
authorCarl Hetherington <cth@carlh.net>
Tue, 27 Feb 2018 22:56:42 +0000 (22:56 +0000)
committerCarl Hetherington <cth@carlh.net>
Tue, 27 Feb 2018 22:56:42 +0000 (22:56 +0000)
src/lib/ffmpeg.cc
src/lib/ffmpeg.h
src/lib/internet.cc
src/lib/internet.h
src/lib/playlist.cc
src/lib/playlist.h
src/lib/video_ring_buffers.cc
src/lib/video_ring_buffers.h

index ac179e1d62df8ffa0830056b36a39e09447d697e..5171166d5f0e9aeea6ea9ae60cbe5dd391cf79df 100644 (file)
@@ -276,65 +276,6 @@ FFmpeg::subtitle_period (AVSubtitle const & sub)
                );
 }
 
-string
-FFmpeg::subtitle_id (AVSubtitle const & sub)
-{
-       Digester digester;
-       digester.add (sub.pts);
-       for (unsigned int i = 0; i < sub.num_rects; ++i) {
-               AVSubtitleRect* rect = sub.rects[i];
-               if (rect->type == SUBTITLE_BITMAP) {
-                       digester.add (rect->x);
-                       digester.add (rect->y);
-                       digester.add (rect->w);
-                       digester.add (rect->h);
-#ifdef DCPOMATIC_HAVE_AVSUBTITLERECT_PICT
-                       int const line = rect->pict.linesize[0];
-                       for (int j = 0; j < rect->h; ++j) {
-                               digester.add (rect->pict.data[0] + j * line, line);
-                       }
-#else
-                       int const line = rect->linesize[0];
-                       for (int j = 0; j < rect->h; ++j) {
-                               digester.add (rect->data[0] + j * line, line);
-                       }
-#endif
-               } else if (rect->type == SUBTITLE_TEXT) {
-                       digester.add (string (rect->text));
-               } else if (rect->type == SUBTITLE_ASS) {
-                       digester.add (string (rect->ass));
-               }
-       }
-       return digester.get ();
-}
-
-/** @return true if sub starts a new image subtitle */
-bool
-FFmpeg::subtitle_starts_image (AVSubtitle const & sub)
-{
-       bool image = false;
-       bool text = false;
-
-       for (unsigned int i = 0; i < sub.num_rects; ++i) {
-               switch (sub.rects[i]->type) {
-               case SUBTITLE_BITMAP:
-                       image = true;
-                       break;
-               case SUBTITLE_TEXT:
-               case SUBTITLE_ASS:
-                       text = true;
-                       break;
-               default:
-                       break;
-               }
-       }
-
-       /* We can't cope with mixed image/text in one AVSubtitle */
-       DCPOMATIC_ASSERT (!image || !text);
-
-       return image;
-}
-
 /** Compute the pts offset to use given a set of audio streams and some video details.
  *  Sometimes these parameters will have just been determined by an Examiner, sometimes
  *  they will have been retrieved from a piece of Content, hence the need for this method
index dab67ead9fec3369b5c90379dcbd6516df1cef9c..d2f79765884edf775dbd87d48fe43d8311ac5b04 100644 (file)
@@ -58,8 +58,6 @@ protected:
                ) const;
 
        static FFmpegSubtitlePeriod subtitle_period (AVSubtitle const & sub);
-       static std::string subtitle_id (AVSubtitle const & sub);
-       static bool subtitle_starts_image (AVSubtitle const & sub);
 
        boost::shared_ptr<const FFmpegContent> _ffmpeg_content;
 
index 67f6ed2bc8a71dc42f7e9975fd6fe0102963f0fc..c1bb5e88fbd3d7aab609b202cdd2e960e4ebe304 100644 (file)
@@ -126,68 +126,3 @@ get_from_zip_url (string url, string file, bool pasv, function<void (boost::file
        load (temp_cert.file ());
        return optional<string> ();
 }
-
-static size_t
-ftp_ls_data (void* buffer, size_t size, size_t nmemb, void* data)
-{
-       string* s = reinterpret_cast<string *> (data);
-       uint8_t* b = reinterpret_cast<uint8_t *> (buffer);
-       for (size_t i = 0; i < (size * nmemb); ++i) {
-               *s += b[i];
-       }
-       return size * nmemb;
-}
-
-list<string>
-ftp_ls (string url, bool pasv)
-{
-       CURL* curl = curl_easy_init ();
-       if (!curl) {
-               throw NetworkError ("could not set up curl");
-       }
-
-       if (url.substr (url.length() - 1, 1) != "/") {
-               url += "/";
-       }
-       curl_easy_setopt (curl, CURLOPT_URL, url.c_str ());
-       /* 20s timeout */
-       curl_easy_setopt (curl, CURLOPT_TIMEOUT, 20);
-
-       string ls_raw;
-       struct curl_slist* commands = 0;
-       commands = curl_slist_append (commands, "NLST");
-       curl_easy_setopt (curl, CURLOPT_POSTQUOTE, commands);
-       curl_easy_setopt (curl, CURLOPT_WRITEDATA, &ls_raw);
-       curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, ftp_ls_data);
-       curl_easy_setopt (curl, CURLOPT_FTP_USE_EPSV, 0);
-       curl_easy_setopt (curl, CURLOPT_FTP_USE_EPRT, 0);
-       curl_easy_setopt (curl, CURLOPT_VERBOSE, 1);
-       if (!pasv) {
-               curl_easy_setopt (curl, CURLOPT_FTPPORT, "-");
-       }
-       CURLcode const r = curl_easy_perform (curl);
-       if (r != CURLE_OK) {
-               curl_easy_cleanup (curl);
-               throw NetworkError (curl_easy_strerror (r));
-       }
-
-       list<string> ls;
-       string line;
-       for (size_t i = 0; i < ls_raw.length(); ++i) {
-               line += ls_raw[i];
-               if (ls_raw[i] == '\n') {
-                       trim (line);
-                       if (line.length() > 55) {
-                               string const file = line.substr (55);
-                               if (file != "." && file != "..") {
-                                       ls.push_back (file);
-                               }
-                       }
-                       line = "";
-               }
-       }
-
-       curl_easy_cleanup (curl);
-
-       return ls;
-}
index b477bb4473d0978e7245648417e702a097e2ce39..9b88bde973fe409d055f2b29e6f70bbfad7cd469 100644 (file)
@@ -23,4 +23,3 @@
 #include <boost/filesystem.hpp>
 
 boost::optional<std::string> get_from_zip_url (std::string url, std::string file, bool pasv, boost::function<void (boost::filesystem::path)> load);
-std::list<std::string> ftp_ls (std::string dir, bool pasv = true);
index 12832cfd78aa3c5c059e29723c73d29d4a84d3ee..d2ac95cd388f4bae20451adf22407fc9cd849ead 100644 (file)
@@ -544,51 +544,6 @@ Playlist::content_summary (DCPTimePeriod period) const
        return best_summary;
 }
 
-bool
-Playlist::video_content_at (DCPTime time) const
-{
-       BOOST_FOREACH (shared_ptr<Content> i, _content) {
-               if (i->video && i->position() <= time && time < i->end()) {
-                       return true;
-               }
-       }
-
-       return false;
-}
-
-bool
-Playlist::audio_content_at (DCPTime time) const
-{
-       BOOST_FOREACH (shared_ptr<Content> i, _content) {
-               if (!i->audio) {
-                       continue;
-               }
-               if (i->position() <= time && time < i->end()) {
-                       return true;
-               }
-       }
-
-       return false;
-}
-
-shared_ptr<Content>
-Playlist::next_audio_content (DCPTime time) const
-{
-       shared_ptr<Content> next;
-       DCPTime next_position;
-       BOOST_FOREACH (shared_ptr<Content> i, _content) {
-               if (!i->audio) {
-                       continue;
-               }
-               if (i->position() >= time && (!next || i->position() < next_position)) {
-                       next = i;
-                       next_position = i->position();
-               }
-       }
-
-       return next;
-}
-
 pair<double, double>
 Playlist::speed_up_range (int dcp_video_frame_rate) const
 {
index f8f51ac2da826e2857faeb2746a945378f4bda21..fe19c93c97dc6848e05362db4c34dfdd7659f20a 100644 (file)
@@ -55,9 +55,6 @@ public:
        void move_later (boost::shared_ptr<Content>);
 
        ContentList content () const;
-       bool video_content_at (DCPTime time) const;
-       bool audio_content_at (DCPTime time) const;
-       boost::shared_ptr<Content> next_audio_content (DCPTime time) const;
 
        std::string video_identifier () const;
 
index 2fc39d53c663330794a263a8728ffa782a7888b9..0167f4aec4309c62ba47d1966ee04cba278ced5a 100644 (file)
@@ -73,17 +73,6 @@ VideoRingBuffers::clear ()
        _data.clear ();
 }
 
-optional<DCPTime>
-VideoRingBuffers::earliest () const
-{
-       boost::mutex::scoped_lock lm (_mutex);
-       if (_data.empty ()) {
-               return optional<DCPTime> ();
-       }
-
-       return _data.front().second;
-}
-
 pair<size_t, string>
 VideoRingBuffers::memory_used () const
 {
index 887a5dc2fd2ca9e2c4c3c0858f9d519773b4441c..f3e521553168f938448b9a7436fad604b0d1ce59 100644 (file)
@@ -37,7 +37,6 @@ public:
        void clear ();
        Frame size () const;
        bool empty () const;
-       boost::optional<DCPTime> earliest () const;
 
        std::pair<size_t, std::string> memory_used () const;