]> git.sesse.net Git - nageru/commitdiff
Assorted clang-format fixes (not complete).
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 14 Oct 2018 13:38:11 +0000 (15:38 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 14 Oct 2018 13:41:45 +0000 (15:41 +0200)
35 files changed:
chroma_subsampler.cpp
chroma_subsampler.h
clip_list.cpp
clip_list.h
context.cpp
db.cpp
db.h
disk_space_estimator.cpp
disk_space_estimator.h
eval.cpp
flow.cpp
flow.h
flow_main.cpp
gpu_timers.cpp
gpu_timers.h
httpd.cpp
httpd.h
jpeg_frame_view.cpp
jpeg_frame_view.h
main.cpp
mainwindow.cpp
mainwindow.h
memcpy_interleaved.cpp
mux.cpp
player.cpp
ref_counted_gl_sync.h
util.cpp
util.h
vaapi_jpeg_decoder.cpp
vaapi_jpeg_decoder.h
video_stream.cpp
video_stream.h
vis.cpp
ycbcr_converter.cpp
ycbcr_converter.h

index 28bd0a3e4fc6487cf3476599f15f21b50df8a4b9..04fd5945f0f3b80ae3fc1c5edc0201f432377283 100644 (file)
@@ -1,7 +1,7 @@
 #include "chroma_subsampler.h"
 
-#include <string>
 #include <movit/util.h>
+#include <string>
 
 #define BUFFER_OFFSET(i) ((char *)nullptr + (i))
 
@@ -83,10 +83,10 @@ ChromaSubsampler::ChromaSubsampler()
                2.0f, 0.0f
        };
        glCreateBuffers(1, &vbo);
-        glNamedBufferData(vbo, sizeof(vertices), vertices, GL_STATIC_DRAW);
+       glNamedBufferData(vbo, sizeof(vertices), vertices, GL_STATIC_DRAW);
        glBindBuffer(GL_ARRAY_BUFFER, vbo);
 
-        GLint position_attrib = 0;  // Hard-coded in every vertex shader.
+       GLint position_attrib = 0;  // Hard-coded in every vertex shader.
        glEnableVertexArrayAttrib(vao, position_attrib);
        glVertexAttribPointer(position_attrib, 2, GL_FLOAT, GL_FALSE, 0, BUFFER_OFFSET(0));
 
@@ -112,7 +112,7 @@ void ChromaSubsampler::subsample_chroma(GLuint cbcr_tex, unsigned width, unsigne
        glProgramUniform2f(cbcr_program, uniform_chroma_offset_0, -1.0f / width, 0.0f);
        glProgramUniform2f(cbcr_program, uniform_chroma_offset_1, -0.0f / width, 0.0f);
 
-       glViewport(0, 0, width/2, height);
+       glViewport(0, 0, width / 2, height);
        fbos.render_to(cb_tex, cr_tex);
 
        glBindVertexArray(vao);
index 84351c9502be28c6eda9eb1df9285abe93b24190..ec43fe084627f3532da549fb1411051081ecc0ab 100644 (file)
@@ -1,10 +1,10 @@
 #ifndef _CHROMA_SUBSAMPLER_H
 #define _CHROMA_SUBSAMPLER_H 1
 
-#include <epoxy/gl.h>
-
 #include "flow.h"
 
+#include <epoxy/gl.h>
+
 class ChromaSubsampler {
 public:
        ChromaSubsampler();
index cdffba9365db3306919b9cb18cd4bc4bd76eea8f..5ee36df1cc432a50b5be00c152c9ea4274aed61d 100644 (file)
@@ -1,13 +1,13 @@
+#include "clip_list.h"
+
 #include "mainwindow.h"
+#include "timebase.h"
+#include "ui_mainwindow.h"
 
 #include <math.h>
 #include <string>
 #include <vector>
 
-#include "clip_list.h"
-#include "timebase.h"
-#include "ui_mainwindow.h"
-
 using namespace std;
 
 string pts_to_string(int64_t pts)
@@ -40,27 +40,36 @@ string duration_to_string(int64_t pts_diff)
        return buf;
 }
 
-int ClipList::rowCount(const QModelIndex &parent) const {
-       if (parent.isValid()) return 0;
+int ClipList::rowCount(const QModelIndex &parent) const
+{
+       if (parent.isValid())
+               return 0;
        return clips.size();
 }
 
-int PlayList::rowCount(const QModelIndex &parent) const {
-       if (parent.isValid()) return 0;
+int PlayList::rowCount(const QModelIndex &parent) const
+{
+       if (parent.isValid())
+               return 0;
        return clips.size();
 }
 
-int ClipList::columnCount(const QModelIndex &parent) const {
-       if (parent.isValid()) return 0;
+int ClipList::columnCount(const QModelIndex &parent) const
+{
+       if (parent.isValid())
+               return 0;
        return int(Column::NUM_COLUMNS);
 }
 
-int PlayList::columnCount(const QModelIndex &parent) const {
-       if (parent.isValid()) return 0;
+int PlayList::columnCount(const QModelIndex &parent) const
+{
+       if (parent.isValid())
+               return 0;
        return int(Column::NUM_COLUMNS);
 }
 
-QVariant ClipList::data(const QModelIndex &parent, int role) const {
+QVariant ClipList::data(const QModelIndex &parent, int role) const
+{
        if (!parent.isValid())
                return QVariant();
        const int row = parent.row(), column = parent.column();
@@ -108,7 +117,8 @@ QVariant ClipList::data(const QModelIndex &parent, int role) const {
        }
 }
 
-QVariant PlayList::data(const QModelIndex &parent, int role) const {
+QVariant PlayList::data(const QModelIndex &parent, int role) const
+{
        if (!parent.isValid())
                return QVariant();
        const int row = parent.row(), column = parent.column();
@@ -186,7 +196,8 @@ QVariant PlayList::data(const QModelIndex &parent, int role) const {
        }
 }
 
-QVariant ClipList::headerData(int section, Qt::Orientation orientation, int role) const {
+QVariant ClipList::headerData(int section, Qt::Orientation orientation, int role) const
+{
        if (role != Qt::DisplayRole)
                return QVariant();
        if (orientation != Qt::Horizontal)
@@ -212,7 +223,8 @@ QVariant ClipList::headerData(int section, Qt::Orientation orientation, int role
        }
 }
 
-QVariant PlayList::headerData(int section, Qt::Orientation orientation, int role) const {
+QVariant PlayList::headerData(int section, Qt::Orientation orientation, int role) const
+{
        if (role != Qt::DisplayRole)
                return QVariant();
        if (orientation != Qt::Horizontal)
@@ -379,7 +391,7 @@ void PlayList::move_clips(size_t first, size_t last, int delta)
                beginMoveRows(QModelIndex(), first, last, QModelIndex(), first - 1);
                rotate(clips.begin() + first - 1, clips.begin() + first, clips.begin() + last + 1);
        } else {
-               beginMoveRows(QModelIndex(), first, last, QModelIndex(), first + (last-first+1) + 1);
+               beginMoveRows(QModelIndex(), first, last, QModelIndex(), first + (last - first + 1) + 1);
                first = clips.size() - first - 1;
                last = clips.size() - last - 1;
                rotate(clips.rbegin() + last - 1, clips.rbegin() + last, clips.rbegin() + first + 1);
index c853263c13e28047048fcaa7c53aa59df6253d41..66449826cb3cdfd1a3e0743d3350b0c7ab5419b2 100644 (file)
@@ -1,15 +1,13 @@
 #ifndef _CLIP_LIST_H
 #define _CLIP_LIST_H 1
 
-#include <QAbstractTableModel>
+#include "defs.h"
+#include "state.pb.h"
 
+#include <QAbstractTableModel>
 #include <stdint.h>
-
-#include <vector>
 #include <string>
-
-#include "defs.h"
-#include "state.pb.h"
+#include <vector>
 
 struct Clip {
        int64_t pts_in = -1, pts_out = -1;  // pts_in is inclusive, pts_out is exclusive.
@@ -28,7 +26,8 @@ struct ClipProxy {
 public:
        ClipProxy(Clip &clip, DataChangedReceiver *clip_list, size_t row)
                : clip(clip), clip_list(clip_list), row(row) {}
-       ~ClipProxy() {
+       ~ClipProxy()
+       {
                if (clip_list != nullptr) {
                        clip_list->emit_data_changed(row);
                }
index ac8c97b3365ebec3962c29be8ad19a4d84b0a4cb..0b17bfa56893ec065b5f96efbe1a95a1a6a687c7 100644 (file)
@@ -1,12 +1,10 @@
-#include <stdio.h>
-
-#include <string>
-
 #include <QGL>
 #include <QOffscreenSurface>
 #include <QOpenGLContext>
 #include <QSurface>
 #include <QSurfaceFormat>
+#include <stdio.h>
+#include <string>
 
 QGLWidget *global_share_widget = nullptr;
 
diff --git a/db.cpp b/db.cpp
index c999a1d01780109d3abf20bf42afbc38a36bffa0..77e3b73e09e9417dcea301528db398fdc8beb666 100644 (file)
--- a/db.cpp
+++ b/db.cpp
@@ -67,7 +67,7 @@ void DB::store_state(const StateProto &state)
        }
 
        sqlite3_stmt *stmt;
-       ret = sqlite3_prepare(db, "INSERT INTO state VALUES (?)", -1, &stmt, 0);
+       ret = sqlite3_prepare(db, "INSERT INTO state VALUES (?)", -1, &stmt, 0);
        if (ret != SQLITE_OK) {
                fprintf(stderr, "INSERT prepare: %s\n", sqlite3_errmsg(db));
                exit(1);
diff --git a/db.h b/db.h
index 826ab3f9c30152b701dedf8a0cf2995a792a76fb..13a7e510535fc0cdb2421cc7ce011d5ef982fe73 100644 (file)
--- a/db.h
+++ b/db.h
@@ -2,6 +2,7 @@
 #define DB_H 1
 
 #include "state.pb.h"
+
 #include <sqlite3.h>
 
 class DB {
index 50460f9893446d78b429bc6916a832d98e095a5b..5ce507020d58b6918049757f6d533cce02b7a069 100644 (file)
@@ -1,11 +1,11 @@
 #include "disk_space_estimator.h"
 
+#include "timebase.h"
+
+#include <memory>
 #include <stdio.h>
 #include <sys/stat.h>
 #include <sys/statfs.h>
-#include <memory>
-
-#include "timebase.h"
 
 DiskSpaceEstimator::DiskSpaceEstimator(DiskSpaceEstimator::callback_t callback)
        : callback(callback)
index c7f1df5ce058d573175a54a5b014bd13563c68cc..a86ee2e486a799a8de3530488265aa89693d6bdb 100644 (file)
@@ -9,16 +9,15 @@
 //
 // The bitrate is measured over a simple 30-second sliding window.
 
-#include <stdint.h>
-#include <sys/types.h>
+#include "timebase.h"
+
 #include <deque>
 #include <functional>
+#include <stdint.h>
 #include <string>
+#include <sys/types.h>
 
-#include "timebase.h"
-
-class DiskSpaceEstimator
-{
+class DiskSpaceEstimator {
 public:
        typedef std::function<void(off_t free_bytes, double estimated_seconds_left)> callback_t;
        DiskSpaceEstimator(callback_t callback);
index 8161527127179bb1aaa10cad80d824c5569f8f95..85783bb58a1a83d95b92391c6fbc37d234f6d3c2 100644 (file)
--- a/eval.cpp
+++ b/eval.cpp
@@ -1,12 +1,11 @@
 // Evaluate a .flo file against ground truth,
 // outputting the average end-point error.
 
-#include <assert.h>
-#include <stdio.h>
+#include "util.h"
 
+#include <assert.h>
 #include <memory>
-
-#include "util.h"
+#include <stdio.h>
 
 using namespace std;
 
index 68392dc535b5a13c2efe5234a037347431df53af..e672fe6f6d8fefb8ecc97935b73af79ee3495f8e 100644 (file)
--- a/flow.cpp
+++ b/flow.cpp
@@ -1,21 +1,20 @@
 #define NO_SDL_GLEXT 1
 
-#include <epoxy/gl.h>
-
-#include <assert.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-
 #include "flow.h"
+
 #include "gpu_timers.h"
 #include "util.h"
 
 #include <algorithm>
+#include <assert.h>
 #include <deque>
-#include <memory>
+#include <epoxy/gl.h>
 #include <map>
+#include <memory>
 #include <stack>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
 #include <vector>
 
 #define BUFFER_OFFSET(i) ((char *)nullptr + (i))
@@ -80,7 +79,7 @@ string read_file(const string &filename)
        }
        if (ret == 0) {
                fprintf(stderr, "Short read when trying to read %d bytes from %s\n",
-                               size, filename.c_str());
+                       size, filename.c_str());
                exit(1);
        }
        fclose(fp);
@@ -88,11 +87,10 @@ string read_file(const string &filename)
        return str;
 }
 
-
 GLuint compile_shader(const string &shader_src, GLenum type)
 {
        GLuint obj = glCreateShader(type);
-       const GLcharsource[] = { shader_src.data() };
+       const GLchar *source[] = { shader_src.data() };
        const GLint length[] = { (GLint)shader_src.size() };
        glShaderSource(obj, 1, source, length);
        glCompileShader(obj);
diff --git a/flow.h b/flow.h
index af3f8103d5e9c0c817b0f5ca59a6d4f82d5c0972..08b25904356ab61265835e46cf219105c5ae88d2 100644 (file)
--- a/flow.h
+++ b/flow.h
@@ -5,13 +5,13 @@
 // in-between frames. The main user interface is the DISComputeFlow and Interpolate
 // classes (also GrayscaleConversion can be useful).
 
-#include <stdint.h>
-#include <epoxy/gl.h>
 #include <array>
+#include <epoxy/gl.h>
 #include <map>
 #include <mutex>
-#include <vector>
+#include <stdint.h>
 #include <utility>
+#include <vector>
 
 class ScopedTimer;
 
@@ -111,7 +111,6 @@ private:
        std::map<std::array<GLuint, num_elements>, GLuint> fbos;
 };
 
-
 // Same, but with a depth texture.
 template<size_t num_elements>
 class PersistentFBOSetWithDepth {
@@ -422,7 +421,8 @@ public:
        // after use.
        GLuint exec(GLuint tex, FlowDirection flow_direction, ResizeStrategy resize_strategy);
 
-       void release_texture(GLuint tex) {
+       void release_texture(GLuint tex)
+       {
                pool.release_texture(tex);
        }
 
@@ -548,7 +548,8 @@ public:
        // two-layer RGBA8 texture with mipmaps (unless flow_level == 0).
        std::pair<GLuint, GLuint> exec(GLuint image_tex, GLuint gray_tex, GLuint bidirectional_flow_tex, GLuint width, GLuint height, float alpha);
 
-       void release_texture(GLuint tex) {
+       void release_texture(GLuint tex)
+       {
                pool.release_texture(tex);
        }
 
index ecaee058d78ce5b62e385160fff60549be6d8a1a..1ef44ac55b58ab85281faf903eb18945f2e7eea5 100644 (file)
@@ -1,6 +1,8 @@
 #define NO_SDL_GLEXT 1
 
-#include <epoxy/gl.h>
+#include "flow.h"
+#include "gpu_timers.h"
+#include "util.h"
 
 #include <SDL2/SDL.h>
 #include <SDL2/SDL_error.h>
 #include <SDL2/SDL_keyboard.h>
 #include <SDL2/SDL_mouse.h>
 #include <SDL2/SDL_video.h>
-
-#include <assert.h>
-#include <getopt.h>
-#include <stdio.h>
-#include <unistd.h>
-
-#include "flow.h"
-#include "gpu_timers.h"
-#include "util.h"
-
 #include <algorithm>
+#include <assert.h>
 #include <deque>
-#include <memory>
+#include <epoxy/gl.h>
+#include <getopt.h>
 #include <map>
+#include <memory>
 #include <stack>
+#include <stdio.h>
+#include <unistd.h>
 #include <vector>
 
 #define BUFFER_OFFSET(i) ((char *)nullptr + (i))
@@ -418,7 +415,7 @@ void interpolate_image(int argc, char **argv, int optind)
 
 int main(int argc, char **argv)
 {
-        static const option long_options[] = {
+       static const option long_options[] = {
                { "smoothness-relative-weight", required_argument, 0, 's' },  // alpha.
                { "intensity-relative-weight", required_argument, 0, 'i' },  // delta.
                { "gradient-relative-weight", required_argument, 0, 'g' },  // gamma.
index 1e20cc1c791f733b0e0cb2a8720327579e287431..ad747ae6372f508127f64122d45a10029bc2fa78 100644 (file)
@@ -1,7 +1,7 @@
-#include <epoxy/gl.h>
-
 #include "gpu_timers.h"
 
+#include <epoxy/gl.h>
+
 using namespace std;
 
 bool enable_timing = false;
@@ -54,7 +54,8 @@ void GPUTimers::print()
                        size_t num_subtimers = 0;
                        GLint64 sum_subtimers = 0;
                        for (size_t j = i + 1; j < timers.size() && timers[j].level > timers[i].level; ++j) {
-                               if (timers[j].level != timers[i].level + 1) continue;
+                               if (timers[j].level != timers[i].level + 1)
+                                       continue;
                                ++num_subtimers;
                                sum_subtimers += find_elapsed(timers[j].query);
                        }
index e843fea120caa5d4dd090457d79047f9e41f6311..a8c626e18ae04902afee27faa6105b81c0805dad 100644 (file)
@@ -1,12 +1,11 @@
 #ifndef _GPU_TIMERS_H
 #define _GPU_TIMERS_H 1
 
+#include <epoxy/gl.h>
 #include <string>
 #include <utility>
 #include <vector>
 
-#include <epoxy/gl.h>
-
 extern bool enable_timing;
 extern bool detailed_timing;
 extern bool in_warmup;
index fddc45a4e896899dc779abfc2bb03d3b231613c3..36d2874d40241df9112e872923f5a1c869f2db67 100644 (file)
--- a/httpd.cpp
+++ b/httpd.cpp
@@ -3,13 +3,13 @@
 #include <assert.h>
 #include <byteswap.h>
 #include <endian.h>
+#include <memory>
 #include <microhttpd.h>
 #include <netinet/in.h>
 #include <stdio.h>
 #include <string.h>
 #include <sys/time.h>
 #include <time.h>
-#include <memory>
 extern "C" {
 #include <libavutil/avutil.h>
 }
@@ -75,8 +75,8 @@ int HTTPD::answer_to_connection_thunk(void *cls, MHD_Connection *connection,
 
 int HTTPD::answer_to_connection(MHD_Connection *connection,
                                 const char *url, const char *method,
-                               const char *version, const char *upload_data,
-                               size_t *upload_data_size, void **con_cls)
+                                const char *version, const char *upload_data,
+                                size_t *upload_data_size, void **con_cls)
 {
        // See if the URL ends in “.metacube”.
        HTTPD::Stream::Framing framing;
@@ -154,7 +154,7 @@ ssize_t HTTPD::Stream::reader_callback_thunk(void *cls, uint64_t pos, char *buf,
 ssize_t HTTPD::Stream::reader_callback(uint64_t pos, char *buf, size_t max)
 {
        unique_lock<mutex> lock(buffer_mutex);
-       has_buffered_data.wait(lock, [this]{ return should_quit || !buffered_data.empty(); });
+       has_buffered_data.wait(lock, [this] { return should_quit || !buffered_data.empty(); });
        if (should_quit) {
                return 0;
        }
@@ -253,7 +253,7 @@ void HTTPD::Stream::add_data(const char *buf, size_t buf_size, HTTPD::Stream::Da
                buffered_data.emplace_back((char *)&packet, sizeof(packet));
        }
 
-       has_buffered_data.notify_all(); 
+       has_buffered_data.notify_all();
 }
 
 void HTTPD::Stream::stop()
diff --git a/httpd.h b/httpd.h
index 57c649b61158c6f73b498aeca6556b97bc52f179..9901814586cb913ca06c7f6afc4f39364561f5ac 100644 (file)
--- a/httpd.h
+++ b/httpd.h
@@ -3,16 +3,16 @@
 
 // A class dealing with stream output to HTTP.
 
-#include <stddef.h>
-#include <stdint.h>
-#include <sys/types.h>
 #include <atomic>
 #include <condition_variable>
 #include <deque>
 #include <functional>
 #include <mutex>
 #include <set>
+#include <stddef.h>
+#include <stdint.h>
 #include <string>
+#include <sys/types.h>
 #include <unordered_map>
 #include <utility>
 
@@ -32,7 +32,8 @@ public:
        ~HTTPD();
 
        // Should be called before start().
-       void set_header(const std::string &data) {
+       void set_header(const std::string &data)
+       {
                header = data;
        }
 
@@ -41,14 +42,16 @@ public:
                NO_CORS_POLICY,
                ALLOW_ALL_ORIGINS
        };
-       void add_endpoint(const std::string &url, const EndpointCallback &callback, CORSPolicy cors_policy) {
+       void add_endpoint(const std::string &url, const EndpointCallback &callback, CORSPolicy cors_policy)
+       {
                endpoints[url] = Endpoint{ callback, cors_policy };
        }
 
        void start(int port);
        void stop();
        void add_data(const char *buf, size_t size, bool keyframe, int64_t time, AVRational timebase);
-       int64_t get_num_connected_clients() const {
+       int64_t get_num_connected_clients() const
+       {
                return metric_num_connected_clients.load();
        }
 
index 905249a0cfe9e2b7e33c7e4b91b280e7201144f4..b33b76b945a5ca25b8228e17124584ed9f3bc242 100644 (file)
@@ -1,28 +1,27 @@
 #include "jpeg_frame_view.h"
 
-#include <jpeglib.h>
-#include <stdint.h>
-#include <unistd.h>
+#include "defs.h"
+#include "post_to_main_thread.h"
+#include "video_stream.h"
+#include "ycbcr_converter.h"
 
+#include <QMouseEvent>
+#include <QScreen>
 #include <atomic>
 #include <condition_variable>
 #include <deque>
+#include <jpeglib.h>
+#include <movit/init.h>
+#include <movit/resource_pool.h>
+#include <movit/util.h>
 #include <mutex>
+#include <stdint.h>
 #include <thread>
+#include <unistd.h>
 #include <utility>
 
-#include <QMouseEvent>
-#include <QScreen>
-
-#include <movit/resource_pool.h>
-#include <movit/init.h>
-#include <movit/util.h>
-
-#include "defs.h"
-#include "post_to_main_thread.h"
+// Must come after the Qt stuff.
 #include "vaapi_jpeg_decoder.h"
-#include "video_stream.h"
-#include "ycbcr_converter.h"
 
 using namespace movit;
 using namespace std;
@@ -146,7 +145,7 @@ shared_ptr<Frame> decode_jpeg(const string &filename)
                jpeg_read_raw_data(&dinfo, data, v_mcu_size);
        }
 
-       (void) jpeg_finish_decompress(&dinfo);
+       (void)jpeg_finish_decompress(&dinfo);
        jpeg_destroy_decompress(&dinfo);
        fclose(fp);
 
@@ -215,7 +214,8 @@ void jpeg_decoder_thread_func()
                        any_pending_decodes.wait(lock, [] {
                                return !pending_decodes.empty() || should_quit.load();
                        });
-                       if (should_quit.load()) break;
+                       if (should_quit.load())
+                               break;
                        decode = pending_decodes.front();
                        pending_decodes.pop_front();
 
@@ -248,7 +248,8 @@ void jpeg_decoder_thread_func()
                                cache_updated.wait(lock, [id] {
                                        return cache.count(id) != 0 || should_quit.load();
                                });
-                               if (should_quit.load()) break;
+                               if (should_quit.load())
+                                       break;
                                found_in_cache = true;  // Don't count it as a decode.
 
                                auto it = cache.find(id);
@@ -302,7 +303,8 @@ void JPEGFrameView::shutdown()
 }
 
 JPEGFrameView::JPEGFrameView(QWidget *parent)
-       : QGLWidget(parent, global_share_widget) {
+       : QGLWidget(parent, global_share_widget)
+{
 }
 
 void JPEGFrameView::setFrame(unsigned stream_idx, int64_t pts, bool interpolated, int secondary_stream_idx, int64_t secondary_pts, float fade_alpha)
@@ -399,7 +401,6 @@ void JPEGFrameView::paintGL()
 
 namespace {
 
-
 }  // namespace
 
 void JPEGFrameView::setDecodedFrame(shared_ptr<Frame> frame, shared_ptr<Frame> secondary_frame, float fade_alpha)
index b8e26c4a3a98f35170d73e8445098e11488d7d01..1047e0b36d584db8b89363a3567b2b7ce1a3c95c 100644 (file)
@@ -1,22 +1,19 @@
 #ifndef _JPEG_FRAME_VIEW_H
 #define _JPEG_FRAME_VIEW_H 1
 
-#include <epoxy/gl.h>
-#include <QGLWidget>
-
-#include <stdint.h>
+#include "jpeg_frame.h"
+#include "ycbcr_converter.h"
 
+#include <QGLWidget>
+#include <epoxy/gl.h>
+#include <memory>
 #include <movit/effect_chain.h>
 #include <movit/flat_input.h>
 #include <movit/mix_effect.h>
 #include <movit/ycbcr_input.h>
-
-#include <memory>
+#include <stdint.h>
 #include <thread>
 
-#include "jpeg_frame.h"
-#include "ycbcr_converter.h"
-
 struct JPEGID {
        unsigned stream_idx;
        int64_t pts;
index b7ae8f0b9be54d9b9beff73c75379ca7234ba6e6..da2340bdfd81c34862bd075648395adaf1e8554b 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -1,15 +1,14 @@
 #include <assert.h>
-#include <dirent.h>
-#include <stdio.h>
-#include <stdint.h>
-#include <sys/types.h>
-
 #include <atomic>
 #include <chrono>
 #include <condition_variable>
+#include <dirent.h>
 #include <memory>
 #include <mutex>
+#include <stdint.h>
+#include <stdio.h>
 #include <string>
+#include <sys/types.h>
 #include <thread>
 #include <vector>
 
@@ -17,18 +16,13 @@ extern "C" {
 #include <libavformat/avformat.h>
 }
 
-#include <QApplication>
-
-#include <movit/init.h>
-#include <movit/util.h>
-
 #include "clip_list.h"
 #include "context.h"
 #include "defs.h"
 #include "disk_space_estimator.h"
-#include "mainwindow.h"
 #include "ffmpeg_raii.h"
 #include "httpd.h"
+#include "mainwindow.h"
 #include "player.h"
 #include "post_to_main_thread.h"
 #include "ref_counted_gl_sync.h"
@@ -36,6 +30,10 @@ extern "C" {
 #include "ui_mainwindow.h"
 #include "vaapi_jpeg_decoder.h"
 
+#include <QApplication>
+#include <movit/init.h>
+#include <movit/util.h>
+
 using namespace std;
 using namespace std::chrono;
 
index 8f63bee0fbd05108c96e2f573cd45c4f4a00342d..0932a757bbdcafa5f76c1fea2407ed2ecb944364 100644 (file)
@@ -7,16 +7,14 @@
 #include "timebase.h"
 #include "ui_mainwindow.h"
 
-#include <future>
-#include <string>
-#include <vector>
-
 #include <QMouseEvent>
-#include <QWheelEvent>
 #include <QShortcut>
 #include <QTimer>
-
+#include <QWheelEvent>
+#include <future>
 #include <sqlite3.h>
+#include <string>
+#include <vector>
 
 using namespace std;
 using namespace std::placeholders;
@@ -199,7 +197,8 @@ void MainWindow::queue_clicked()
 
 void MainWindow::preview_clicked()
 {
-       if (cliplist_clips->empty()) return;
+       if (cliplist_clips->empty())
+               return;
 
        QItemSelectionModel *selected = ui->clip_list->selectionModel();
        if (!selected->hasSelection()) {
@@ -315,7 +314,8 @@ void MainWindow::state_changed(const StateProto &state)
 
 void MainWindow::play_clicked()
 {
-       if (playlist_clips->empty()) return;
+       if (playlist_clips->empty())
+               return;
 
        QItemSelectionModel *selected = ui->playlist->selectionModel();
        int row;
@@ -366,7 +366,7 @@ void MainWindow::live_player_clip_progress(double played_this_clip, double total
        double remaining = total_length - played_this_clip;
        for (int row = playlist_clips->get_currently_playing() + 1; row < int(playlist_clips->size()); ++row) {
                const Clip clip = *playlist_clips->clip(row);
-               remaining += double(clip.pts_out - clip.pts_in) / TIMEBASE / 0.5;   // FIXME: stop hardcoding speed.
+               remaining += double(clip.pts_out - clip.pts_in) / TIMEBASE / 0.5;  // FIXME: stop hardcoding speed.
        }
        int remaining_ms = lrint(remaining * 1e3);
 
@@ -444,7 +444,8 @@ bool MainWindow::eventFilter(QObject *watched, QEvent *event)
                }
                int column = destination->columnAt(mouse->x());
                int row = destination->rowAt(mouse->y());
-               if (column == -1 || row == -1) return false;
+               if (column == -1 || row == -1)
+                       return false;
 
                if (type == SCRUBBING_CLIP_LIST) {
                        if (ClipList::Column(column) == ClipList::Column::IN) {
@@ -596,7 +597,8 @@ void MainWindow::preview_single_frame(int64_t pts, unsigned stream_idx, MainWind
 {
        if (rounding == LAST_BEFORE) {
                lock_guard<mutex> lock(frame_mu);
-               if (frames[stream_idx].empty()) return;
+               if (frames[stream_idx].empty())
+                       return;
                auto it = lower_bound(frames[stream_idx].begin(), frames[stream_idx].end(), pts);
                if (it != frames[stream_idx].end()) {
                        pts = *it;
@@ -604,7 +606,8 @@ void MainWindow::preview_single_frame(int64_t pts, unsigned stream_idx, MainWind
        } else {
                assert(rounding == FIRST_AT_OR_AFTER);
                lock_guard<mutex> lock(frame_mu);
-               if (frames[stream_idx].empty()) return;
+               if (frames[stream_idx].empty())
+                       return;
                auto it = upper_bound(frames[stream_idx].begin(), frames[stream_idx].end(), pts - 1);
                if (it != frames[stream_idx].end()) {
                        pts = *it;
@@ -667,10 +670,10 @@ void MainWindow::report_disk_space(off_t free_bytes, double estimated_seconds_le
 
        std::string label = buf;
 
-       post_to_main_thread([this, label]{
-                       disk_free_label->setText(QString::fromStdString(label));
-                       ui->menuBar->setCornerWidget(disk_free_label);  // Need to set this again for the sizing to get right.
-                       });
+       post_to_main_thread([this, label] {
+               disk_free_label->setText(QString::fromStdString(label));
+               ui->menuBar->setCornerWidget(disk_free_label);  // Need to set this again for the sizing to get right.
+       });
 }
 
 void MainWindow::exit_triggered()
index 7f77273c5b7b712b006957080357b82d3353d435..103dd8379a962ee3ac5f558602359c34adf752d6 100644 (file)
@@ -1,24 +1,22 @@
 #ifndef MAINWINDOW_H
 #define MAINWINDOW_H
 
-#include <stdbool.h>
-#include <sys/types.h>
-
-#include <QLabel>
-#include <QMainWindow>
-
 #include "clip_list.h"
 #include "db.h"
 #include "state.pb.h"
 
+#include <QLabel>
+#include <QMainWindow>
+#include <stdbool.h>
+#include <sys/types.h>
+
 namespace Ui {
 class MainWindow;
 }  // namespace Ui
 
 class Player;
 
-class MainWindow : public QMainWindow
-{
+class MainWindow : public QMainWindow {
        Q_OBJECT
 
 public:
@@ -102,4 +100,3 @@ private slots:
 extern MainWindow *global_mainwindow;
 
 #endif
-
index 9a41cdd53ac1e5ba93330c9657a2d670171e910c..9634fd26b88ddcb95ca4d5c5afcedb79cb21747c 100644 (file)
@@ -1,6 +1,6 @@
-#include <cstdint>
 #include <algorithm>
 #include <assert.h>
+#include <cstdint>
 #if __SSE2__
 #include <immintrin.h>
 #endif
@@ -56,9 +56,9 @@ size_t memcpy_interleaved_fastpath(uint8_t *dest1, uint8_t *dest2, const uint8_t
        assert(((limit - src) % 64) == 0);
 
 #if __AVX2__
-       const __m256i * __restrict in = (const __m256i *)src;
-       __m256i * __restrict out1 = (__m256i *)dest1;
-       __m256i * __restrict out2 = (__m256i *)dest2;
+       const __m256i *__restrict in = (const __m256i *)src;
+       __m256i *__restrict out1 = (__m256i *)dest1;
+       __m256i *__restrict out2 = (__m256i *)dest2;
 
        __m256i shuffle_cw = _mm256_set_epi8(
                15, 13, 11, 9, 7, 5, 3, 1, 14, 12, 10, 8, 6, 4, 2, 0,
diff --git a/mux.cpp b/mux.cpp
index a459c45dd43ca0f8378d9f30fdd0c3b6f7dbe46e..2be0fe4c16848d885d553745716c26c6917a29d9 100644 (file)
--- a/mux.cpp
+++ b/mux.cpp
@@ -1,12 +1,12 @@
 #include "mux.h"
 
+#include <algorithm>
 #include <assert.h>
+#include <mutex>
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <algorithm>
-#include <mutex>
 #include <string>
 #include <utility>
 #include <vector>
@@ -171,7 +171,8 @@ void Mux::add_packet(const AVPacket &pkt, int64_t pts, int64_t dts, AVRational t
                lock_guard<mutex> lock(mu);
                if (write_strategy == WriteStrategy::WRITE_BACKGROUND) {
                        packet_queue.push_back(QueuedPacket{ av_packet_clone(&pkt_copy), pts });
-                       if (plug_count == 0) packet_queue_ready.notify_all();
+                       if (plug_count == 0)
+                               packet_queue_ready.notify_all();
                } else if (plug_count > 0) {
                        packet_queue.push_back(QueuedPacket{ av_packet_clone(&pkt_copy), pts });
                } else {
index b3cc76997e74b6e39f632088509315d31d64fdd9..dc619f43b6df0fc7d2a154b4d780d986b4f1b073 100644 (file)
@@ -1,13 +1,4 @@
-#include <algorithm>
-#include <chrono>
-#include <condition_variable>
-#include <mutex>
-#include <thread>
-#include <vector>
-
-#include <stdio.h>
-
-#include <movit/util.h>
+#include "player.h"
 
 #include "clip_list.h"
 #include "context.h"
 #include "httpd.h"
 #include "jpeg_frame_view.h"
 #include "mux.h"
-#include "player.h"
 #include "timebase.h"
 #include "video_stream.h"
 
+#include <algorithm>
+#include <chrono>
+#include <condition_variable>
+#include <movit/util.h>
+#include <mutex>
+#include <stdio.h>
+#include <thread>
+#include <vector>
+
 using namespace std;
 using namespace std::chrono;
 
@@ -45,7 +44,7 @@ void Player::thread_func(bool also_output_to_stream)
                video_stream.reset(new VideoStream);
                video_stream->start();
        }
-       
+
        check_error();
 
        constexpr double output_framerate = 60000.0 / 1001.0;  // FIXME: make configurable
@@ -61,7 +60,7 @@ void Player::thread_func(bool also_output_to_stream)
                // Wait until we're supposed to play something.
                {
                        unique_lock<mutex> lock(queue_state_mu);
-                       clip_ready = new_clip_changed.wait_for(lock, milliseconds(100), [this]{
+                       clip_ready = new_clip_changed.wait_for(lock, milliseconds(100), [this] {
                                return new_clip_ready && current_clip.pts_in != -1;
                        });
                        new_clip_ready = false;
@@ -331,7 +330,7 @@ void Player::play_clip(const Clip &clip, unsigned stream_idx)
 
 void Player::override_angle(unsigned stream_idx)
 {
-       // Corner case: If a new clip is waiting to be played, change its stream and then we're done. 
+       // Corner case: If a new clip is waiting to be played, change its stream and then we're done.
        {
                unique_lock<mutex> lock(queue_state_mu);
                if (new_clip_ready) {
@@ -362,7 +361,7 @@ void Player::override_angle(unsigned stream_idx)
                }
                pts_out = current_clip.pts_out;
        }
-                       
+
        lock_guard<mutex> lock(frame_mu);
        auto it = upper_bound(frames[stream_idx].begin(), frames[stream_idx].end(), pts_out);
        if (it == frames[stream_idx].end()) {
index 8b6db680a2c31ffa66ce36c799f1475769937033..5604e9e6f8f9a2707c9d2f0e0170d04c3efc688c 100644 (file)
@@ -16,7 +16,7 @@ class RefCountedGLsync : public RefCountedGLsyncBase {
 public:
        RefCountedGLsync() {}
 
-       RefCountedGLsync(GLenum condition, GLbitfield flags) 
+       RefCountedGLsync(GLenum condition, GLbitfield flags)
                : RefCountedGLsyncBase(locked_glFenceSync(condition, flags), glDeleteSync) {}
 
 private:
index 3701d62a3dd19d1f2944f1a3f6856f0ef8dfab3f..061408d7a69781c88adfde4b4fc65e662e686464 100644 (file)
--- a/util.cpp
+++ b/util.cpp
@@ -1,9 +1,8 @@
-#include <assert.h>
-#include <stdio.h>
+#include "util.h"
 
+#include <assert.h>
 #include <memory>
-
-#include "util.h"
+#include <stdio.h>
 
 using namespace std;
 
diff --git a/util.h b/util.h
index 91ed0a20fa7e765760e8507029b4ecee4a893ab0..4a0aed85214805714d680a3a6d6a736586f64257 100644 (file)
--- a/util.h
+++ b/util.h
@@ -1,10 +1,10 @@
 #ifndef _UTIL_H
 #define _UTIL_H 1
 
-#include <math.h>
-#include <stdint.h>
 #include <algorithm>
+#include <math.h>
 #include <memory>
+#include <stdint.h>
 
 struct Vec2 {
        float du, dv;
@@ -22,29 +22,37 @@ inline void flow2rgb(float du, float dv, uint8_t *rr, uint8_t *gg, uint8_t *bb)
 {
        float angle = atan2(dv, du);
        float magnitude = std::min(hypot(du, dv) / 20.0, 1.0);
-       
+
        // HSV to RGB (from Wikipedia). Saturation is 1.
        float c = magnitude;
        float h = (angle + M_PI) * 6.0 / (2.0 * M_PI);
        float X = c * (1.0 - fabs(fmod(h, 2.0) - 1.0));
        float r = 0.0f, g = 0.0f, b = 0.0f;
        if (h <= 1.0f) {
-               r = c; g = X;
+               r = c;
+               g = X;
        } else if (h <= 2.0f) {
-               r = X; g = c;
+               r = X;
+               g = c;
        } else if (h <= 3.0f) {
-               g = c; b = X;
+               g = c;
+               b = X;
        } else if (h <= 4.0f) {
-               g = X; b = c;
+               g = X;
+               b = c;
        } else if (h <= 5.0f) {
-               r = X; b = c;
+               r = X;
+               b = c;
        } else if (h <= 6.0f) {
-               r = c; b = X;
+               r = c;
+               b = X;
        } else {
                // h is NaN, so black is fine.
        }
        float m = magnitude - c;
-       r += m; g += m; b += m;
+       r += m;
+       g += m;
+       b += m;
        r = std::max(std::min(r, 1.0f), 0.0f);
        g = std::max(std::min(g, 1.0f), 0.0f);
        b = std::max(std::min(b, 1.0f), 0.0f);
index b6f9c50f487565137c102400723b1ab02e7a3e8e..70b5f374efc51cca1776cd4fbe51205fdb211454 100644 (file)
@@ -1,33 +1,32 @@
 #include "vaapi_jpeg_decoder.h"
 
+#include "jpeg_frame.h"
+#include "memcpy_interleaved.h"
+
 #include <X11/Xlib.h>
 #include <assert.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <glob.h>
 #include <jpeglib.h>
+#include <list>
+#include <mutex>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <string>
 #include <unistd.h>
 #include <va/va.h>
 #include <va/va_drm.h>
 #include <va/va_x11.h>
 
-#include <list>
-#include <mutex>
-#include <string>
-
-#include "jpeg_frame.h"
-#include "memcpy_interleaved.h"
-
 using namespace std;
 
 static unique_ptr<VADisplayWithCleanup> va_dpy;
 static VAConfigID config_id;
 static VAImageFormat uyvy_format;
 bool vaapi_jpeg_decoding_usable = false;
-       
+
 struct VAResources {
        unsigned width, height;
        VASurfaceID surface;
@@ -108,7 +107,8 @@ class ReleaseVAResources {
 public:
        ReleaseVAResources(const VAResources &resources)
                : resources(resources) {}
-       ~ReleaseVAResources() {
+       ~ReleaseVAResources()
+       {
                if (!committed) {
                        release_va_resources(resources);
                }
@@ -170,7 +170,8 @@ unique_ptr<VADisplayWithCleanup> try_open_va(const string &va_display, string *e
 {
        unique_ptr<VADisplayWithCleanup> va_dpy = va_open_display(va_display);
        if (va_dpy == nullptr) {
-               if (error) *error = "Opening VA display failed";
+               if (error)
+                       *error = "Opening VA display failed";
                return nullptr;
        }
        int major_ver, minor_ver;
@@ -178,14 +179,16 @@ unique_ptr<VADisplayWithCleanup> try_open_va(const string &va_display, string *e
        if (va_status != VA_STATUS_SUCCESS) {
                char buf[256];
                snprintf(buf, sizeof(buf), "vaInitialize() failed with status %d\n", va_status);
-               if (error != nullptr) *error = buf;
+               if (error != nullptr)
+                       *error = buf;
                return nullptr;
        }
 
        int num_entrypoints = vaMaxNumEntrypoints(va_dpy->va_dpy);
        unique_ptr<VAEntrypoint[]> entrypoints(new VAEntrypoint[num_entrypoints]);
        if (entrypoints == nullptr) {
-               if (error != nullptr) *error = "Failed to allocate memory for VA entry points";
+               if (error != nullptr)
+                       *error = "Failed to allocate memory for VA entry points";
                return nullptr;
        }
 
@@ -199,7 +202,8 @@ unique_ptr<VADisplayWithCleanup> try_open_va(const string &va_display, string *e
                return va_dpy;
        }
 
-       if (error != nullptr) *error = "Can't find VAEntrypointVLD for the JPEG profile";
+       if (error != nullptr)
+               *error = "Can't find VAEntrypointVLD for the JPEG profile";
        return nullptr;
 }
 
@@ -422,7 +426,7 @@ shared_ptr<Frame> decode_jpeg_vaapi(const string &filename)
        memset(&parms, 0, sizeof(parms));
        parms.slice_data_size = str.size();
        parms.slice_data_offset = 0;
-       parms.slice_data_flag = VA_SLICE_DATA_FLAG_ALL; 
+       parms.slice_data_flag = VA_SLICE_DATA_FLAG_ALL;
        parms.slice_horizontal_position = 0;
        parms.slice_vertical_position = 0;
        for (int component_idx = 0; component_idx < dinfo.num_components; ++component_idx) {
@@ -431,7 +435,7 @@ shared_ptr<Frame> decode_jpeg_vaapi(const string &filename)
                parms.components[component_idx].dc_table_selector = comp->dc_tbl_no;
                parms.components[component_idx].ac_table_selector = comp->ac_tbl_no;
                if (parms.components[component_idx].dc_table_selector > 1 ||
-                   parms.components[component_idx].ac_table_selector > 1) {
+                   parms.components[component_idx].ac_table_selector > 1) {
                        fprintf(stderr, "Uses too many Huffman tables\n");
                        return nullptr;
                }
index 4ab957e01a9099a7a0b36791da970c2448b9f735..2009a567fc343bceb1ab3ce581dce147a946efaf 100644 (file)
@@ -2,13 +2,12 @@
 #define _VAAPI_JPEG_DECODER_H 1
 
 #include <X11/Xlib.h>
-#include <va/va.h>
-
-#include <string>
 #include <memory>
+#include <string>
+#include <va/va.h>
 
 struct Frame;
-  
+
 struct VADisplayWithCleanup {
        ~VADisplayWithCleanup();
 
@@ -23,5 +22,5 @@ void init_jpeg_vaapi();
 std::shared_ptr<Frame> decode_jpeg_vaapi(const std::string &filename);
 
 extern bool vaapi_jpeg_decoding_usable;
-  
+
 #endif  // !defined(_VAAPI_JPEG_DECODER_H)
index 39b5b6c28985452d412406c0371fb16654f2b336..e89839a6314f963f410f577dc7607f135499a579 100644 (file)
@@ -5,9 +5,6 @@ extern "C" {
 #include <libavformat/avio.h>
 }
 
-#include <jpeglib.h>
-#include <unistd.h>
-
 #include "chroma_subsampler.h"
 #include "context.h"
 #include "flow.h"
@@ -20,6 +17,8 @@ extern "C" {
 #include "ycbcr_converter.h"
 
 #include <epoxy/glx.h>
+#include <jpeglib.h>
+#include <unistd.h>
 
 using namespace std;
 
@@ -134,8 +133,8 @@ vector<uint8_t> encode_jpeg(const uint8_t *y_data, const uint8_t *cb_data, const
        for (unsigned y = 0; y < height; y += 8) {
                for (unsigned yy = 0; yy < 8; ++yy) {
                        yptr[yy] = const_cast<JSAMPROW>(&y_data[(y + yy) * width]);
-                       cbptr[yy] = const_cast<JSAMPROW>(&cb_data[(y + yy) * width/2]);
-                       crptr[yy] = const_cast<JSAMPROW>(&cr_data[(y + yy) * width/2]);
+                       cbptr[yy] = const_cast<JSAMPROW>(&cb_data[(y + yy) * width / 2]);
+                       crptr[yy] = const_cast<JSAMPROW>(&cr_data[(y + yy) * width / 2]);
                }
 
                jpeg_write_raw_data(&cinfo, data, /*num_lines=*/8);
@@ -217,7 +216,7 @@ VideoStream::VideoStream()
                check_error();
                glNamedBufferStorage(resource.pbo, width * height * 4, nullptr, GL_MAP_READ_BIT | GL_MAP_PERSISTENT_BIT);
                check_error();
-               resource.pbo_contents = glMapNamedBufferRange(resource.pbo, 0, width * height * 4, GL_MAP_READ_BIT | GL_MAP_PERSISTENT_BIT); 
+               resource.pbo_contents = glMapNamedBufferRange(resource.pbo, 0, width * height * 4, GL_MAP_READ_BIT | GL_MAP_PERSISTENT_BIT);
                interpolate_resources.push_back(resource);
        }
 
@@ -276,7 +275,7 @@ void VideoStream::schedule_original_frame(int64_t output_pts, unsigned stream_id
        qf.type = QueuedFrame::ORIGINAL;
        qf.output_pts = output_pts;
        qf.stream_idx = stream_idx;
-       qf.input_first_pts = input_pts; 
+       qf.input_first_pts = input_pts;
 
        unique_lock<mutex> lock(queue_lock);
        frame_queue.push_back(qf);
@@ -437,7 +436,6 @@ void VideoStream::schedule_interpolated_frame(int64_t output_pts, unsigned strea
                chroma_subsampler->subsample_chroma(qf.cbcr_tex, 1280, 720, resources.cb_tex, resources.cr_tex);
        }
 
-
        // We could have released qf.flow_tex here, but to make sure we don't cause a stall
        // when trying to reuse it for the next frame, we can just as well hold on to it
        // and release it only when the readback is done.
@@ -618,4 +616,3 @@ int VideoStream::write_packet2(uint8_t *buf, int buf_size, AVIODataMarkerType ty
        }
        return buf_size;
 }
-
index 8ac3bcf70efa1854b6d57dbcdc962fb0453df18f..2bac2ad425bacc196926aca41db998590e9884f1 100644 (file)
@@ -1,25 +1,24 @@
 #ifndef _VIDEO_STREAM_H
 #define _VIDEO_STREAM_H 1
 
-#include <stdint.h>
 #include <epoxy/gl.h>
+#include <stdint.h>
 
 extern "C" {
 #include <libavformat/avio.h>
 }
 
+#include "jpeg_frame_view.h"
+#include "ref_counted_gl_sync.h"
+
 #include <condition_variable>
 #include <deque>
-#include <mutex>
-#include <string>
-#include <thread>
-
 #include <movit/effect_chain.h>
 #include <movit/mix_effect.h>
 #include <movit/ycbcr_input.h>
-
-#include "jpeg_frame_view.h"
-#include "ref_counted_gl_sync.h"
+#include <mutex>
+#include <string>
+#include <thread>
 
 class ChromaSubsampler;
 class DISComputeFlow;
@@ -38,11 +37,10 @@ public:
 
        void schedule_original_frame(int64_t output_pts, unsigned stream_idx, int64_t input_pts);
        void schedule_faded_frame(int64_t output_pts, unsigned stream_idx, int64_t input_pts, int secondary_stream_idx, int64_t secondary_input_pts, float fade_alpha);
-       void schedule_interpolated_frame(int64_t output_pts, unsigned stream_idx, int64_t input_first_pts, int64_t input_second_pts, float alpha, int secondary_stream_idx = -1, int64_t secondary_inputs_pts = -1, float fade_alpha = 0.0f); // -1 = no secondary frame.
+       void schedule_interpolated_frame(int64_t output_pts, unsigned stream_idx, int64_t input_first_pts, int64_t input_second_pts, float alpha, int secondary_stream_idx = -1, int64_t secondary_inputs_pts = -1, float fade_alpha = 0.0f);  // -1 = no secondary frame.
        void schedule_refresh_frame(int64_t output_pts);
 
 private:
-
        void encode_thread_func();
        std::thread encode_thread;
 
@@ -72,7 +70,7 @@ private:
                int64_t output_pts;
                enum Type { ORIGINAL, FADED, INTERPOLATED, FADED_INTERPOLATED } type;
                unsigned stream_idx;
-               int64_t input_first_pts;  // The only pts for original frames.  
+               int64_t input_first_pts;  // The only pts for original frames.
 
                // For fades only (including fades against interpolated frames).
                int secondary_stream_idx = -1;
diff --git a/vis.cpp b/vis.cpp
index 8ecf29749616ceb79f640d3c6fa9d1b314ade3a1..c67a0ccec6278a72b1feed7f4dd57b0e86ddf5eb 100644 (file)
--- a/vis.cpp
+++ b/vis.cpp
@@ -1,11 +1,10 @@
 // Visualize a .flo file.
 
-#include <assert.h>
-#include <stdio.h>
+#include "util.h"
 
+#include <assert.h>
 #include <memory>
-
-#include "util.h"
+#include <stdio.h>
 
 using namespace std;
 
index 40d1a9cd771d04cc1f37d1d809dba47ed000f964..143c4716f5076e0ccfabe5728e464e6a864a1c80 100644 (file)
@@ -1,10 +1,10 @@
 #include "ycbcr_converter.h"
 
+#include "jpeg_frame.h"
+
 #include <movit/mix_effect.h>
 #include <movit/ycbcr_input.h>
 
-#include "jpeg_frame.h"
-
 using namespace std;
 using namespace movit;
 
index a7a6179269fbb60d82a4d24ec9129ec5fec93d21..12dc61c5d097609033ff1dce640925cefd2ff5c4 100644 (file)
@@ -1,9 +1,8 @@
 #ifndef _YCBCR_CONVERTER_H
 #define _YCBCR_CONVERTER_H 1
 
-#include <memory>
-
 #include <epoxy/gl.h>
+#include <memory>
 #include <movit/ycbcr_input.h>
 
 namespace movit {
@@ -58,4 +57,4 @@ private:
 // TODO: make private
 void setup_input_for_frame(std::shared_ptr<Frame> frame, const movit::YCbCrFormat &ycbcr_format, movit::YCbCrInput *input);
 
-#endif   // !defined(_YCBCR_CONVERTER_H)
+#endif  // !defined(_YCBCR_CONVERTER_H)