#include "clip_list.h"
-#include <condition_variable>
-#include <functional>
-#include <mutex>
-
extern "C" {
#include <libavformat/avio.h>
}
+#include <condition_variable>
+#include <functional>
+#include <mutex>
+
class JPEGFrameView;
-class Mux;
+class VideoStream;
+class QSurface;
+class QSurfaceFormat;
class Player {
public:
- Player(JPEGFrameView *destination);
+ Player(JPEGFrameView *destination, bool also_output_to_stream);
void play_clip(const Clip &clip, unsigned stream_idx);
void override_angle(unsigned stream_idx); // For the current clip only.
void set_done_callback(done_callback_func cb) { done_callback = cb; }
private:
- void thread_func();
+ void thread_func(bool also_output_to_stream);
void open_output_stream();
static int write_packet2_thunk(void *opaque, uint8_t *buf, int buf_size, AVIODataMarkerType type, int64_t time);
int write_packet2(uint8_t *buf, int buf_size, AVIODataMarkerType type, int64_t time);
bool playing = false; // Under queue_state_mu.
int override_stream_idx = -1; // Under queue_state_mu.
- // For streaming.
- std::unique_ptr<Mux> stream_mux; // To HTTP.
- std::string stream_mux_header;
- bool seen_sync_markers = false;
+ std::unique_ptr<VideoStream> video_stream; // Can be nullptr.
};
#endif // !defined(_PLAYER_H)