Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chromecast / media / cma / backend / media_clock_device_default.h
blobe895354207961006866f24cdbde7e8059a3a6168
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROMECAST_MEDIA_CMA_BACKEND_MEDIA_CLOCK_DEVICE_DEFAULT_H_
6 #define CHROMECAST_MEDIA_CMA_BACKEND_MEDIA_CLOCK_DEVICE_DEFAULT_H_
8 #include "base/macros.h"
9 #include "base/threading/thread_checker.h"
10 #include "base/time/time.h"
11 #include "chromecast/public/media/media_clock_device.h"
13 namespace chromecast {
14 namespace media {
16 class MediaClockDeviceDefault : public MediaClockDevice {
17 public:
18 MediaClockDeviceDefault();
19 ~MediaClockDeviceDefault() override;
21 // MediaClockDevice implementation.
22 State GetState() const override;
23 bool SetState(State new_state) override;
24 bool ResetTimeline(int64_t time_microseconds) override;
25 bool SetRate(float rate) override;
26 int64_t GetTimeMicroseconds() override;
28 private:
29 State state_;
31 // Media time sampled at STC time |stc_|.
32 base::TimeDelta media_time_;
33 base::TimeTicks stc_;
35 float rate_;
37 base::ThreadChecker thread_checker_;
39 DISALLOW_COPY_AND_ASSIGN(MediaClockDeviceDefault);
42 } // namespace media
43 } // namespace chromecast
45 #endif // CHROMECAST_MEDIA_CMA_BACKEND_MEDIA_CLOCK_DEVICE_DEFAULT_H_