1. Introduction of device clock
- Each capture channel of capture device has an independent hardware clock;
- Each captured A/V frame will be marked as a timestamp with a unit of nanosecond;
1. The function of device clock
- Can synchronize the captured frames of audio and video;
- Can simultaneously display the captured images from multiple channels;
1. The setting and calibration of device clock
- Clock setting. Since the clocks for different capture channels are independent, you need to set the same value before use;
MWGetDeviceTime() → MWSetDeviceTime()
Before capturing, firstly to obtain the current clock value of a certain capture channel, then set this clock value as value for other capture channels
- Clock calibration. When all capture channels are processing, their clocks value will gradually become different due to accumulated minor deviation. Therefore, it’s necessary to calibrate the clock values periodically;
MWGetDeviceTime() → MWRegulateDeviceTime()
Carlibration method is similar to setting method. After a period of time, users should obtain the current clock value from a certain channel, and carlibrate other clock values according to the obtained value
- The difference of clock setting and calibration
Clock setting is mandatory, and all clocks will abruptly become standard clock, and start to process with a standard value, the fame info will be affected.
Clock calibration is a changing process. The clocks will calculate the difference from the standard clock and gradually change its value making it close to standard clock
In all, it’s not necessary to set or calibrate the clock value to synchronize A/V frames in a single channel, because they use the same clock.
But if many channels are involved, and need to synchronize A/V frames, it’s necessary to set and calibrate clock values. Before capturing, use MWSetDeviceTime() to synchronize clock values in different capture channels, and during the process of capturing, use MWRegulateDeviceTime() to calibrate the clock values periodically.
“Examples \ Applications \ XICaptureQuad” contains a demo for clock function.