X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=fake_capture.cpp;h=fbcfeddbf14bffc9b020a41772db44eb0e629561;hb=9053593313b47bd5fd6b888bec9809bf4aacc8a9;hp=5f53e95079db2553f39d6472afaf59c3e81980b0;hpb=a765e066b74ac52ff0abf239d430d6f8d83f792e;p=bmusb diff --git a/fake_capture.cpp b/fake_capture.cpp index 5f53e95..fbcfedd 100644 --- a/fake_capture.cpp +++ b/fake_capture.cpp @@ -13,6 +13,7 @@ #if __SSE2__ #include #endif +#include #include #include "bmusb/bmusb.h" @@ -26,6 +27,7 @@ constexpr uint8_t cbs[NUM_COLORS] = { 90, 54, 240, 128 }; constexpr uint8_t crs[NUM_COLORS] = { 240, 34, 110, 128 }; using namespace std; +using namespace std::chrono; namespace bmusb { namespace { @@ -255,6 +257,7 @@ void FakeCapture::producer_thread_func() memset4(video_frame.data, ycbcr, width * height / 2); } video_frame.len = width * height * 2; + video_frame.received_timestamp = steady_clock::now(); } AudioFormat audio_format; @@ -266,6 +269,7 @@ void FakeCapture::producer_thread_func() const unsigned num_stereo_samples = audio_sample_frequency / fps; assert(audio_frame.size >= audio_format.num_channels * sizeof(int32_t) * num_stereo_samples); audio_frame.len = audio_format.num_channels * sizeof(int32_t) * num_stereo_samples; + audio_frame.received_timestamp = steady_clock::now(); if (audio_sin == 0.0f) { // Silence.