fake_receiver_time_offset_estimator.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // Copyright 2014 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.
  4. #ifndef MEDIA_CAST_TEST_FAKE_RECEIVER_TIME_OFFSET_ESTIMATOR_H_
  5. #define MEDIA_CAST_TEST_FAKE_RECEIVER_TIME_OFFSET_ESTIMATOR_H_
  6. #include "base/time/time.h"
  7. #include "base/threading/thread_checker.h"
  8. #include "media/cast/logging/logging_defines.h"
  9. #include "media/cast/logging/receiver_time_offset_estimator.h"
  10. namespace media {
  11. namespace cast {
  12. namespace test {
  13. // This class is used for testing. It will always return the |offset| value
  14. // provided during construction as offset bounds.
  15. class FakeReceiverTimeOffsetEstimator final
  16. : public ReceiverTimeOffsetEstimator {
  17. public:
  18. FakeReceiverTimeOffsetEstimator(base::TimeDelta offset);
  19. FakeReceiverTimeOffsetEstimator(const FakeReceiverTimeOffsetEstimator&) =
  20. delete;
  21. FakeReceiverTimeOffsetEstimator& operator=(
  22. const FakeReceiverTimeOffsetEstimator&) = delete;
  23. ~FakeReceiverTimeOffsetEstimator() final;
  24. // RawReventSubscriber implementations.
  25. void OnReceiveFrameEvent(const FrameEvent& frame_event) final;
  26. void OnReceivePacketEvent(const PacketEvent& packet_event) final;
  27. // ReceiverTimeOffsetEstimator
  28. bool GetReceiverOffsetBounds(base::TimeDelta* lower_bound,
  29. base::TimeDelta* upper_bound) final;
  30. private:
  31. const base::TimeDelta offset_;
  32. };
  33. } // namespace test
  34. } // namespace cast
  35. } // namespace media
  36. #endif // MEDIA_CAST_TEST_FAKE_RECEIVER_TIME_OFFSET_ESTIMATOR_H_