Hello and thanks in advance
I’m trying to write a MIP driver instance to use for my specific device.
I used the DemoDriver software as an initial example.
I can receive live stream audio and video correctly, but
I have a problem with the delayed video.
I try to explain better:
If I get some bit of video late, I try to send the Bitmap packets with
the timestamp (Sync and Picture) and sequence number ahead of its original
correct time position to the driver.
In Live mode I can see the video and then the delayed part.
In playback mode I see the interruption of missing packets, but
that interval was not filled with delayed packets.
My idea was to put in Queue the bitmaps and send the packets one after the other. If same packets is on delay, then I correct their information of timestamp and sequence to restore the order.
My solution refers to "protected override bool GetLiveFrameInternal(TimeSpan timeout, out BaseDataHeader header, out byte[] data) in the driver code;
_sequence = _sequence +appo;//appo is an offset (+/-) relative to delayed video, newDT is the correct timestamp real or delayed
DateTime dt = newDt;//DateTime.UtcNow;
header = new VideoHeader()
{
CodecType = VideoCodecType.JPEG,
Length = (ulong)data.Length,
SequenceNumber = \_sequence++,
SyncFrame = true,
TimestampSync = dt,
TimestampFrame = dt
};
return true;
From Device side I modified the “private byte[] MediaProviderGetMediaData()” as the example of the test device to send the Bitmap with the relative timestamp and sequence value.
Is there a better idea or I suppose I have to use better the interface?
Gabriele Palmieri