class TimeCalculatingVideoContentHandlerWrapper extends AbstractVideoContentHandler<T> {

    @Override
    public synchronized void handleContent(T image, long ptsMillis)
    {
        if (myFirstPtsMillis == Long.MIN_VALUE)
        {
            myFirstPtsMillis = ptsMillis;
        }

        long ptsOffsetMillis = ptsMillis - myFirstPtsMillis;
        myVideoContentHandler.handleContent(image, ptsMillis);

        myLatestPtsMillis = ptsMillis;
        myLatestTime = TimeInstant.get(myStartTime.getEpochMillis() + ptsOffsetMillis);
        if (myLatestFrameTimeConsumer != null)
        {
            myLatestFrameTimeConsumer.accept(myLatestTime);
        }
        if (LOGGER.isTraceEnabled())
        {
            if (image == null)
            {
                LOGGER.trace("No image produced for time " + TimeInstant.get(myStartTime.getEpochMillis() + ptsOffsetMillis));
            }
            else
            {
                LOGGER.trace("Decoded image for time " + TimeInstant.get(myStartTime.getEpochMillis() + ptsOffsetMillis));
            }
        }
    }

    public  TimeCalculatingVideoContentHandlerWrapper(VideoContentHandler<? super T> videoContentHandler, TimeInstant startTime,
            Consumer<TimeInstant> latestFrameTimeConsumer);

}