< prev index next > modules/javafx.media/src/main/native/jfxmedia/platform/osx/avf/AVFMediaPlayer.mm
Print this page
/*
- * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
#define TRACK_LOG(...) {}
#endif
@implementation AVFMediaPlayer
- static void SpectrumCallbackProc(void *context, double duration);
+ static void SpectrumCallbackProc(void *context, double duration, double timestamp);
static CVReturn displayLinkCallback(CVDisplayLinkRef displayLink,
const CVTimeStamp *inNow,
const CVTimeStamp *inOutputTime,
CVOptionFlags flagsIn,
eventHandler->SendFrameSizeChangedEvent(previousWidth, previousHeight);
}
eventHandler->SendNewFrameEvent(frame);
}
- - (void) sendSpectrumEventDuration:(double)duration {
+ - (void) sendSpectrumEventDuration:(double)duration timestamp:(double)timestamp {
if (eventHandler) {
- double timestamp = self.currentTime;
+ if (timestamp < 0) {
+ timestamp = self.currentTime;
+ }
eventHandler->SendAudioSpectrumEvent(timestamp, duration);
}
}
@end
- static void SpectrumCallbackProc(void *context, double duration) {
+ static void SpectrumCallbackProc(void *context, double duration, double timestamp) {
if (context) {
AVFMediaPlayer *player = (__bridge AVFMediaPlayer*)context;
- [player sendSpectrumEventDuration:duration];
+ [player sendSpectrumEventDuration:duration timestamp:timestamp];
}
}
static CVReturn displayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp *inNow, const CVTimeStamp *inOutputTime, CVOptionFlags flagsIn, CVOptionFlags *flagsOut, void *displayLinkContext)
{
< prev index next >