Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / media / cast / cast_environment.h
index f7f9b7e..5abb5c7 100644 (file)
@@ -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,18 +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.
+    // The transport thread is where the transport processing is done.
     TRANSPORT,
   };
 
-  CastEnvironment(scoped_ptr<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,
-                  scoped_refptr<base::TaskRunner> transport_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.
@@ -68,8 +69,16 @@ class CastEnvironment : public base::RefCountedThreadSafe<CastEnvironment> {
   // Logging is not thread safe. Should always be called from the main thread.
   LoggingImpl* Logging();
 
-  scoped_refptr<base::TaskRunner> GetMessageTaskRunnerForThread(
-      ThreadId identifier);
+  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();
@@ -78,12 +87,12 @@ class CastEnvironment : public base::RefCountedThreadSafe<CastEnvironment> {
   friend class base::RefCountedThreadSafe<CastEnvironment>;
 
   scoped_ptr<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_;
-  scoped_refptr<base::TaskRunner> transport_thread_proxy_;
+  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_;