]> git.sesse.net Git - nageru/commitdiff
Combine timebase.h from Nageru and Futatabi.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 1 Dec 2018 23:37:43 +0000 (00:37 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 1 Dec 2018 23:37:50 +0000 (00:37 +0100)
27 files changed:
futatabi/clip_list.cpp
futatabi/disk_space_estimator.cpp
futatabi/disk_space_estimator.h
futatabi/main.cpp
futatabi/mainwindow.cpp
futatabi/mux.cpp
futatabi/mux.h
futatabi/player.cpp
nageru/alsa_input.cpp
nageru/audio_encoder.cpp
nageru/audio_mixer.cpp
nageru/benchmark_audio_mixer.cpp
nageru/decklink_output.cpp
nageru/disk_space_estimator.cpp
nageru/disk_space_estimator.h
nageru/ffmpeg_capture.cpp
nageru/kaeru.cpp
nageru/mixer.cpp
nageru/mixer.h
nageru/mux.cpp
nageru/mux.h
nageru/quicksync_encoder.cpp
nageru/quicksync_encoder_impl.h
nageru/timebase.h [deleted file]
nageru/video_encoder.cpp
nageru/x264_encoder.cpp
shared/timebase.h [moved from futatabi/timebase.h with 100% similarity]

index 14f083e91268984c043ac652cd74ff19b39cccc9..9ccbb71367be6a8a4376822262fc7197dbcc2706 100644 (file)
@@ -1,7 +1,7 @@
 #include "clip_list.h"
 
 #include "mainwindow.h"
-#include "timebase.h"
+#include "shared/timebase.h"
 #include "ui_mainwindow.h"
 
 #include <math.h>
index 69de4d5578d24877664ff45ddb70b5972911e3fe..073e57e447905a4ad3e9c3f2e69aa4997b90a3cb 100644 (file)
@@ -1,6 +1,6 @@
 #include "disk_space_estimator.h"
 
-#include "timebase.h"
+#include "shared/timebase.h"
 
 #include <memory>
 #include <stdio.h>
index f02cb9c616f804003818e522ff4aa001eb72ff8c..e4b2c51d637f6fffe17f1b20af3d9e49f7e19881 100644 (file)
@@ -9,7 +9,7 @@
 //
 // The bitrate is measured over a simple 30-second sliding window.
 
-#include "timebase.h"
+#include "shared/timebase.h"
 
 #include <deque>
 #include <functional>
@@ -25,7 +25,7 @@ public:
        // Report that a video frame with the given pts and size has just been
        // written (possibly appended) to the given file.
        //
-       // <pts> is taken to be in TIMEBASE units (see timebase.h).
+       // <pts> is taken to be in TIMEBASE units (see shared/timebase.h).
        void report_write(const std::string &filename, size_t bytes, uint64_t pts);
 
 private:
index 14bc12ac3a35edf87103449f67e3ab731cb92211..41bbb82b41d165a34b4446b87673f814f673def6 100644 (file)
@@ -32,7 +32,7 @@ extern "C" {
 #include "player.h"
 #include "shared/post_to_main_thread.h"
 #include "ref_counted_gl_sync.h"
-#include "timebase.h"
+#include "shared/timebase.h"
 #include "ui_mainwindow.h"
 #include "vaapi_jpeg_decoder.h"
 
index b9dee2755bedcebd4e99c9519efa33d65eb8fe74..85a86a8a6f7bf5e2e6a621ddfbeacd97d2d646f9 100644 (file)
@@ -6,7 +6,7 @@
 #include "frame_on_disk.h"
 #include "player.h"
 #include "shared/post_to_main_thread.h"
-#include "timebase.h"
+#include "shared/timebase.h"
 #include "ui_mainwindow.h"
 
 #include <QMouseEvent>
index bcbbef3c1c7ba429a534c6cda6b4e98cf9852005..34a2bddf0031f01e5b3c006c553715151df70f89 100644 (file)
@@ -22,7 +22,7 @@ extern "C" {
 }
 
 #include "defs.h"
-#include "timebase.h"
+#include "shared/timebase.h"
 
 using namespace std;
 
index 53e553915c91e15a9f6b991e6eb6c8a219964167..dca6be55fc8f030a49aa3208ae6fb2ab605819d7 100644 (file)
@@ -18,7 +18,7 @@ extern "C" {
 #include <thread>
 #include <vector>
 
-#include "timebase.h"
+#include "shared/timebase.h"
 
 struct MuxMetrics {
        // “written” will usually be equal video + audio + mux overhead,
index 918b61dbef6cf64ebede07abfd7502a63202425c..19b04826138d39cdb3101f43cfed1ca91e2a0c6c 100644 (file)
@@ -8,7 +8,7 @@
 #include "httpd.h"
 #include "jpeg_frame_view.h"
 #include "mux.h"
-#include "timebase.h"
+#include "shared/timebase.h"
 #include "video_stream.h"
 
 #include <algorithm>
index 08a67f7fa7837ccabeb18a414eeaacf61d404bb3..90a440f68bd84c1e65be1cc6a1609df2501c9999 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "alsa_pool.h"
 #include "bmusb/bmusb.h"
-#include "timebase.h"
+#include "shared/timebase.h"
 
 using namespace std;
 using namespace std::chrono;
index e33d2181b46a5465a648bceead3636ba9872b535..daeb8a81b72eb2e7a13a8f6a7b3c9833003d9805 100644 (file)
@@ -23,7 +23,7 @@ extern "C" {
 
 #include "defs.h"
 #include "mux.h"
-#include "timebase.h"
+#include "shared/timebase.h"
 
 using namespace std;
 
index 9e7dd59a0dbc64ab6398e30824c8dae6d676b912..193ae6fdaf7bcfa641a6f4188448c407d300a7ad 100644 (file)
@@ -22,7 +22,7 @@
 #include "flags.h"
 #include "metrics.h"
 #include "state.pb.h"
-#include "timebase.h"
+#include "shared/timebase.h"
 
 using namespace bmusb;
 using namespace std;
index b47c3405eb7002fe0ec5001d93a60059eedcf42e..f140a512c299f848187fdab4e594266aab9f3e1b 100644 (file)
@@ -17,7 +17,7 @@
 #include "defs.h"
 #include "input_mapping.h"
 #include "resampling_queue.h"
-#include "timebase.h"
+#include "shared/timebase.h"
 
 #define NUM_BENCHMARK_CARDS 4
 #define NUM_WARMUP_FRAMES 100
index 28f433a8872945b3191608cc7283eea5fea4669e..8d7c47f34a1000fb066262d764aa702a2498aaa5 100644 (file)
@@ -14,7 +14,7 @@
 #include "flags.h"
 #include "metrics.h"
 #include "print_latency.h"
-#include "timebase.h"
+#include "shared/timebase.h"
 #include "v210_converter.h"
 
 using namespace movit;
index 86e5e877f65aeaad39cd7423cc3c0577ed499a94..5c4c41bc021fa7306b35db7bea6b9b2e3aad8b58 100644 (file)
@@ -6,7 +6,7 @@
 #include <memory>
 
 #include "metrics.h"
-#include "timebase.h"
+#include "shared/timebase.h"
 
 DiskSpaceEstimator::DiskSpaceEstimator(DiskSpaceEstimator::callback_t callback)
        : callback(callback)
index 73b392cc586e43c57c82fa4c6195d20d294c82bf..ce81321638e2350adc9626d2d347fa8c3daa0b2e 100644 (file)
@@ -16,7 +16,7 @@
 #include <functional>
 #include <string>
 
-#include "timebase.h"
+#include "shared/timebase.h"
 
 class DiskSpaceEstimator
 {
@@ -30,7 +30,7 @@ public:
        // responsible for writing to the stream on disk.
        //
        // If the filename changed since last time, the estimation is reset.
-       // <pts> is taken to be in TIMEBASE units (see timebase.h).
+       // <pts> is taken to be in TIMEBASE units (see shared/timebase.h).
        void report_write(const std::string &filename, uint64_t pts);
 
 private:
index 2ecdf64c4096d8db46f11d1eb185ed93f79d2ac0..7081da823d61f952b2140fe980136b6a021272ec 100644 (file)
@@ -33,7 +33,7 @@ extern "C" {
 #include "flags.h"
 #include "image_input.h"
 #include "ref_counted_frame.h"
-#include "timebase.h"
+#include "shared/timebase.h"
 
 #define FRAME_SIZE (8 << 20)  // 8 MB.
 
index 10f1e9394b2a5c0ddab4e42a226b0ff7af4ccc73..0e555862969234246087ed4f2436015d95db35db 100644 (file)
@@ -8,7 +8,7 @@
 #include "mixer.h"
 #include "mux.h"
 #include "quittable_sleeper.h"
-#include "timebase.h"
+#include "shared/timebase.h"
 #include "x264_encoder.h"
 
 #include <assert.h>
index deaa8e73079710b7f13b8dffd6a9f084f0ae9b4c..79966b5d95be1f9dfa2371f646be11a0c527dd7e 100644 (file)
@@ -49,7 +49,7 @@
 #include "pbo_frame_allocator.h"
 #include "ref_counted_gl_sync.h"
 #include "resampling_queue.h"
-#include "timebase.h"
+#include "shared/timebase.h"
 #include "timecode_renderer.h"
 #include "v210_converter.h"
 #include "video_encoder.h"
index 32a1ea476f21547137e680fb13675c80b6b42835..992bcb9b182e08d8fcfb19ffc82f0bd143914b4c 100644 (file)
@@ -35,7 +35,7 @@
 #include "ref_counted_frame.h"
 #include "ref_counted_gl_sync.h"
 #include "theme.h"
-#include "timebase.h"
+#include "shared/timebase.h"
 #include "video_encoder.h"
 #include "ycbcr_interpretation.h"
 
index b1b9db683081528e8aa15c640288e0d8a2d5b9e6..cb4d0bad5179786feffa919f2fbb515b701a6313 100644 (file)
@@ -24,7 +24,7 @@ extern "C" {
 #include "defs.h"
 #include "flags.h"
 #include "metrics.h"
-#include "timebase.h"
+#include "shared/timebase.h"
 
 using namespace std;
 
index 9614bffbb5ae6603d1ef0d50353ef61b27715679..ed742ff92a064bb9b1865335efac06b2f88ef3ba 100644 (file)
@@ -18,7 +18,7 @@ extern "C" {
 #include <thread>
 #include <vector>
 
-#include "timebase.h"
+#include "shared/timebase.h"
 
 struct MuxMetrics {
        // “written” will usually be equal video + audio + mux overhead,
index c4f8aef817a59c63ccc1239a3048ed7145a67baa..cc3818d336b0dd061f5a91f35a89c61a0e9ed405 100644 (file)
@@ -54,7 +54,7 @@ extern "C" {
 #include "print_latency.h"
 #include "quicksync_encoder_impl.h"
 #include "ref_counted_frame.h"
-#include "timebase.h"
+#include "shared/timebase.h"
 #include "x264_encoder.h"
 
 using namespace movit;
index 7645b99b6b34edf5e8afd83b91a6a9e7f981ba10..6e6e759c9c351d4bcf95bc533472d9e2633274c7 100644 (file)
@@ -17,7 +17,7 @@
 
 #include "audio_encoder.h"
 #include "defs.h"
-#include "timebase.h"
+#include "shared/timebase.h"
 #include "print_latency.h"
 #include "ref_counted_gl_sync.h"
 
diff --git a/nageru/timebase.h b/nageru/timebase.h
deleted file mode 100644 (file)
index dbc4402..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef _TIMEBASE_H
-#define _TIMEBASE_H 1
-
-// Common timebase that allows us to represent one frame exactly in all the
-// relevant frame rates:
-//
-//   Timebase:                1/120000
-//   Frame at 50fps:       2400/120000
-//   Frame at 60fps:       2000/120000
-//   Frame at 59.94fps:    2002/120000
-//   Frame at 23.976fps:   5005/120000
-//
-// If we also wanted to represent one sample at 48000 Hz, we'd need
-// to go to 300000. Also supporting one sample at 44100 Hz would mean
-// going to 44100000; probably a bit excessive.
-#define TIMEBASE 120000
-
-// Some muxes, like MP4 (or at least avformat's implementation of it),
-// are not too fond of values above 2^31. At timebase 120000, that's only
-// about five hours or so, so we define a coarser timebase that doesn't
-// get 59.94 precisely (so there will be a marginal amount of pts jitter),
-// but can do at least 50 and 60 precisely, and months of streaming.
-#define COARSE_TIMEBASE 300
-
-#endif  // !defined(_TIMEBASE_H)
index 42247e9cd0bda138ca49a1615ee58acc7cdb66ab..e7dd8a74cb92adff59918067c822e318ce1d3708 100644 (file)
@@ -18,7 +18,7 @@ extern "C" {
 #include "httpd.h"
 #include "mux.h"
 #include "quicksync_encoder.h"
-#include "timebase.h"
+#include "shared/timebase.h"
 #include "x264_encoder.h"
 
 class RefCountedFrame;
index 8463d1bae285744a420aa47a1155504eb3f07b00..e061a58b9d6157a79cb040fe53ab1fdcd06896d1 100644 (file)
@@ -17,7 +17,7 @@
 #include "metrics.h"
 #include "mux.h"
 #include "print_latency.h"
-#include "timebase.h"
+#include "shared/timebase.h"
 #include "x264_dynamic.h"
 #include "x264_speed_control.h"
 
similarity index 100%
rename from futatabi/timebase.h
rename to shared/timebase.h