1 #ifndef __DALI_INTERNAL_VSYNC_MONITOR_IMPL_H__
2 #define __DALI_INTERNAL_VSYNC_MONITOR_IMPL_H__
5 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
25 #include <base/interfaces/vsync-monitor-interface.h>
37 * Tizen interface for monitoring VSync
39 class VSyncMonitor : public VSyncMonitorInterface
50 virtual ~VSyncMonitor();
55 * Set the use hardware flag
56 * @param[in] useHardware The new state for the use hardware flag.
58 void SetUseHardwareVSync( bool useHardware );
61 * Set whether the vsync hardware is available.
62 * (This is public to allow callback method to work...)
64 void SetHardwareVSyncAvailable(bool available);
66 private: // From Dali::Internal::Adaptor::VSyncMonitorInterface
69 * copydoc Dali::Internal::Adaptor::VSyncMonitorInterface::Initialize
71 virtual void Initialize();
74 * copydoc Dali::Internal::Adaptor::VSyncMonitorInterface::Terminate
76 virtual void Terminate();
79 * copydoc Dali::Internal::Adaptor::VSyncMonitorInterface::UseHardware
81 virtual bool UseHardware();
84 * copydoc Dali::Internal::Adaptor::VSyncMonitorInterface::DoSync
86 virtual bool DoSync( unsigned int& frameNumber, unsigned int& seconds, unsigned int& microseconds );
90 int mFileDescriptor; ///< DRM dev node file descriptor
91 drmVBlank mVBlankInfo;
92 // NOTE cannot use booleans as these are used from multiple threads, must use variable with machine word size for atomic read/write
93 unsigned int mUseHardwareVSync; ///< Whether to use hardware vsync
94 unsigned int mHardwareVSyncAvailable; ///< Whether hardware vsync is available
97 } // namespace Adaptor
99 } // namespace Internal
103 #endif // __DALI_INTERNAL_VSYNC_MONITOR_IMPL_H__