summaryrefslogtreecommitdiff
path: root/media/cast/cast_environment.h
diff options
context:
space:
mode:
authorTorne (Richard Coles) <torne@google.com>2014-02-21 12:16:55 +0000
committerTorne (Richard Coles) <torne@google.com>2014-02-21 12:16:55 +0000
commit5d1f7b1de12d16ceb2c938c56701a3e8bfa558f7 (patch)
tree5d4ae202b870bd86673f596f0d424bc4b3e55ebe /media/cast/cast_environment.h
parente862bac9c33104a29d98631d62668ae7b6676510 (diff)
downloadchromium_org-5d1f7b1de12d16ceb2c938c56701a3e8bfa558f7.tar.gz
Merge from Chromium at DEPS revision 251904
This commit was generated by merge_to_master.py. Change-Id: I1f9543259d7d2a57d81aa41a1b84f85837439d21
Diffstat (limited to 'media/cast/cast_environment.h')
-rw-r--r--media/cast/cast_environment.h47
1 files changed, 30 insertions, 17 deletions
diff --git a/media/cast/cast_environment.h b/media/cast/cast_environment.h
index 8a135733c0..5abb5c7376 100644
--- a/media/cast/cast_environment.h
+++ b/media/cast/cast_environment.h
@@ -8,7 +8,7 @@
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
-#include "base/task_runner.h"
+#include "base/single_thread_task_runner.h"
#include "base/time/tick_clock.h"
#include "base/time/time.h"
#include "media/cast/logging/logging_defines.h"
@@ -34,15 +34,19 @@ class CastEnvironment : public base::RefCountedThreadSafe<CastEnvironment> {
VIDEO_ENCODER,
// The video decoder thread is where the video decode processing is done.
VIDEO_DECODER,
+ // The transport thread is where the transport processing is done.
+ TRANSPORT,
};
- CastEnvironment(base::TickClock* clock,
- scoped_refptr<base::TaskRunner> main_thread_proxy,
- scoped_refptr<base::TaskRunner> audio_encode_thread_proxy,
- scoped_refptr<base::TaskRunner> audio_decode_thread_proxy,
- scoped_refptr<base::TaskRunner> video_encode_thread_proxy,
- scoped_refptr<base::TaskRunner> video_decode_thread_proxy,
- const CastLoggingConfig& config);
+ CastEnvironment(
+ scoped_ptr<base::TickClock> clock,
+ scoped_refptr<base::SingleThreadTaskRunner> main_thread_proxy,
+ scoped_refptr<base::SingleThreadTaskRunner> audio_encode_thread_proxy,
+ scoped_refptr<base::SingleThreadTaskRunner> audio_decode_thread_proxy,
+ scoped_refptr<base::SingleThreadTaskRunner> video_encode_thread_proxy,
+ scoped_refptr<base::SingleThreadTaskRunner> video_decode_thread_proxy,
+ scoped_refptr<base::SingleThreadTaskRunner> transport_thread_proxy,
+ const CastLoggingConfig& config);
// These are the same methods in message_loop.h, but are guaranteed to either
// get posted to the MessageLoop if it's still alive, or be deleted otherwise.
@@ -65,21 +69,30 @@ class CastEnvironment : public base::RefCountedThreadSafe<CastEnvironment> {
// Logging is not thread safe. Should always be called from the main thread.
LoggingImpl* Logging();
+ scoped_refptr<base::SingleThreadTaskRunner>
+ GetMessageSingleThreadTaskRunnerForThread(ThreadId identifier);
+
+ bool HasAudioEncoderThread() {
+ return audio_encode_thread_proxy_ ? true : false;
+ }
+
+ bool HasVideoEncoderThread() {
+ return video_encode_thread_proxy_ ? true : false;
+ }
+
protected:
virtual ~CastEnvironment();
private:
friend class base::RefCountedThreadSafe<CastEnvironment>;
- scoped_refptr<base::TaskRunner> GetMessageTaskRunnerForThread(
- ThreadId identifier);
-
- base::TickClock* const clock_; // Not owned by this class.
- scoped_refptr<base::TaskRunner> main_thread_proxy_;
- scoped_refptr<base::TaskRunner> audio_encode_thread_proxy_;
- scoped_refptr<base::TaskRunner> audio_decode_thread_proxy_;
- scoped_refptr<base::TaskRunner> video_encode_thread_proxy_;
- scoped_refptr<base::TaskRunner> video_decode_thread_proxy_;
+ scoped_ptr<base::TickClock> clock_;
+ scoped_refptr<base::SingleThreadTaskRunner> main_thread_proxy_;
+ scoped_refptr<base::SingleThreadTaskRunner> audio_encode_thread_proxy_;
+ scoped_refptr<base::SingleThreadTaskRunner> audio_decode_thread_proxy_;
+ scoped_refptr<base::SingleThreadTaskRunner> video_encode_thread_proxy_;
+ scoped_refptr<base::SingleThreadTaskRunner> video_decode_thread_proxy_;
+ scoped_refptr<base::SingleThreadTaskRunner> transport_thread_proxy_;
scoped_ptr<LoggingImpl> logging_;