summaryrefslogtreecommitdiffstats
path: root/media/cast/test/utility/standalone_cast_environment.h
diff options
context:
space:
mode:
Diffstat (limited to 'media/cast/test/utility/standalone_cast_environment.h')
-rw-r--r--media/cast/test/utility/standalone_cast_environment.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/media/cast/test/utility/standalone_cast_environment.h b/media/cast/test/utility/standalone_cast_environment.h
new file mode 100644
index 0000000..39c6e7c
--- /dev/null
+++ b/media/cast/test/utility/standalone_cast_environment.h
@@ -0,0 +1,42 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_CAST_TEST_UTILITY_STANDALONE_CAST_ENVIRONMENT_H_
+#define MEDIA_CAST_TEST_UTILITY_STANDALONE_CAST_ENVIRONMENT_H_
+
+#include "base/threading/thread.h"
+#include "base/threading/thread_checker.h"
+#include "media/cast/cast_environment.h"
+
+namespace media {
+namespace cast {
+
+// A complete CastEnvironment where all task runners are spurned from
+// internally-owned threads. Uses base::DefaultTickClock as a clock.
+class StandaloneCastEnvironment : public CastEnvironment,
+ public base::ThreadChecker {
+ public:
+ explicit StandaloneCastEnvironment(const CastLoggingConfig& logging_config);
+
+ // Stops all threads backing the task runners, blocking the caller until
+ // complete.
+ void Shutdown();
+
+ private:
+ virtual ~StandaloneCastEnvironment();
+
+ base::Thread main_thread_;
+ base::Thread audio_encode_thread_;
+ base::Thread audio_decode_thread_;
+ base::Thread video_encode_thread_;
+ base::Thread video_decode_thread_;
+ base::Thread transport_thread_;
+
+ DISALLOW_COPY_AND_ASSIGN(StandaloneCastEnvironment);
+};
+
+} // namespace cast
+} // namespace media
+
+#endif // MEDIA_CAST_TEST_UTILITY_STANDALONE_CAST_ENVIRONMENT_H_