-#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;
video_stream.reset(new VideoStream);
video_stream->start();
}
-
+
check_error();
constexpr double output_framerate = 60000.0 / 1001.0; // FIXME: make configurable
// 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;
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) {
}
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()) {