#include <thread>
#include <vector>
-#include "bmusb.h"
+#include "bmusb/bmusb.h"
#include "context.h"
#include "pbo_frame_allocator.h"
#include "ref_counted_frame.h"
};
void
#endif
+ void add_audio(int64_t pts, std::vector<float> audio); // Needs to come before end_frame() of same pts.
bool begin_frame(GLuint *y_tex, GLuint *cbcr_tex);
- void end_frame(RefCountedGLsync fence, std::vector<float> audio, const std::vector<RefCountedFrame> &input_frames);
+ void end_frame(RefCountedGLsync fence, int64_t pts, const std::vector<RefCountedFrame> &input_frames);
private:
struct storage_task {
struct PendingFrame {
RefCountedGLsync fence;
std::vector<RefCountedFrame> input_frames;
- std::vector<float> audio;
};
- std::map<int, PendingFrame> pending_frames;
+ std::map<int, PendingFrame> pending_video_frames; // under frame_queue_mutex
+ std::map<int64_t, std::vector<float>> pending_audio_frames; // under frame_queue_mutex
+ std::map<int, int64_t> timestamps; // under frame_queue_mutex
QSurface *surface;
AVFormatContext *avctx;