summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-02-27 22:56:42 +0000
committerCarl Hetherington <cth@carlh.net>2018-02-27 22:56:42 +0000
commitf508191f9d794e7762270d19a4211739470cfe0d (patch)
treef6deb3d3bb14e7d52dbbfe528481f6c9b6120f7b /src/lib
parentcb0d899ec71a854e8d54213245812702d85b5670 (diff)
Remove some unused code.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ffmpeg.cc59
-rw-r--r--src/lib/ffmpeg.h2
-rw-r--r--src/lib/internet.cc65
-rw-r--r--src/lib/internet.h1
-rw-r--r--src/lib/playlist.cc45
-rw-r--r--src/lib/playlist.h3
-rw-r--r--src/lib/video_ring_buffers.cc11
-rw-r--r--src/lib/video_ring_buffers.h1
8 files changed, 0 insertions, 187 deletions
diff --git a/src/lib/ffmpeg.cc b/src/lib/ffmpeg.cc
index ac179e1d6..5171166d5 100644
--- a/src/lib/ffmpeg.cc
+++ b/src/lib/ffmpeg.cc
@@ -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
diff --git a/src/lib/ffmpeg.h b/src/lib/ffmpeg.h
index dab67ead9..d2f797658 100644
--- a/src/lib/ffmpeg.h
+++ b/src/lib/ffmpeg.h
@@ -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;
diff --git a/src/lib/internet.cc b/src/lib/internet.cc
index 67f6ed2bc..c1bb5e88f 100644
--- a/src/lib/internet.cc
+++ b/src/lib/internet.cc
@@ -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;
-}
diff --git a/src/lib/internet.h b/src/lib/internet.h
index b477bb447..9b88bde97 100644
--- a/src/lib/internet.h
+++ b/src/lib/internet.h
@@ -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);
diff --git a/src/lib/playlist.cc b/src/lib/playlist.cc
index 12832cfd7..d2ac95cd3 100644
--- a/src/lib/playlist.cc
+++ b/src/lib/playlist.cc
@@ -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
{
diff --git a/src/lib/playlist.h b/src/lib/playlist.h
index f8f51ac2d..fe19c93c9 100644
--- a/src/lib/playlist.h
+++ b/src/lib/playlist.h
@@ -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;
diff --git a/src/lib/video_ring_buffers.cc b/src/lib/video_ring_buffers.cc
index 2fc39d53c..0167f4aec 100644
--- a/src/lib/video_ring_buffers.cc
+++ b/src/lib/video_ring_buffers.cc
@@ -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
{
diff --git a/src/lib/video_ring_buffers.h b/src/lib/video_ring_buffers.h
index 887a5dc2f..f3e521553 100644
--- a/src/lib/video_ring_buffers.h
+++ b/src/lib/video_ring_buffers.h
@@ -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;