Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / libjingle / source / talk / media / base / filemediaengine.h
index 9cdfe83..ba29ab3 100644 (file)
 #include <string>
 #include <vector>
 
-#include "talk/base/scoped_ptr.h"
-#include "talk/base/stream.h"
 #include "talk/media/base/codec.h"
 #include "talk/media/base/mediachannel.h"
 #include "talk/media/base/mediaengine.h"
+#include "webrtc/base/scoped_ptr.h"
+#include "webrtc/base/stream.h"
 
-namespace talk_base {
+namespace rtc {
 class StreamInterface;
 }
 
@@ -50,7 +50,7 @@ namespace cricket {
 // only the RTP dump packets. TODO(whyuan): Enable RTCP packets.
 class FileMediaEngine : public MediaEngineInterface {
  public:
-  FileMediaEngine() {}
+  FileMediaEngine() : rtp_sender_thread_(NULL) {}
   virtual ~FileMediaEngine() {}
 
   // Set the file name of the input or output RTP dump for voice or video.
@@ -78,24 +78,21 @@ class FileMediaEngine : public MediaEngineInterface {
   }
 
   // Implement pure virtual methods of MediaEngine.
-  virtual bool Init(talk_base::Thread* worker_thread) {
+  virtual bool Init(rtc::Thread* worker_thread) {
     return true;
   }
   virtual void Terminate() {}
   virtual int GetCapabilities();
   virtual VoiceMediaChannel* CreateChannel();
-  virtual VideoMediaChannel* CreateVideoChannel(VoiceMediaChannel* voice_ch);
+  virtual VideoMediaChannel* CreateVideoChannel(const VideoOptions& options,
+                                                VoiceMediaChannel* voice_ch);
   virtual SoundclipMedia* CreateSoundclip() { return NULL; }
   virtual AudioOptions GetAudioOptions() const { return AudioOptions(); }
   virtual bool SetAudioOptions(const AudioOptions& options) { return true; }
-  virtual bool SetVideoOptions(const VideoOptions& options) { return true; }
   virtual bool SetAudioDelayOffset(int offset) { return true; }
   virtual bool SetDefaultVideoEncoderConfig(const VideoEncoderConfig& config) {
     return true;
   }
-  virtual VideoEncoderConfig GetDefaultVideoEncoderConfig() const {
-    return VideoEncoderConfig();
-  }
   virtual bool SetSoundDevices(const Device* in_dev, const Device* out_dev) {
     return true;
   }
@@ -113,7 +110,6 @@ class FileMediaEngine : public MediaEngineInterface {
   virtual bool SetOutputVolume(int level) { return true; }
   virtual int GetInputLevel() { return 0; }
   virtual bool SetLocalMonitor(bool enable) { return true; }
-  virtual bool SetLocalRenderer(VideoRenderer* renderer) { return true; }
   // TODO(whyuan): control channel send?
   virtual bool SetVideoCapture(bool capture) { return true; }
   virtual const std::vector<AudioCodec>& audio_codecs() {
@@ -133,6 +129,7 @@ class FileMediaEngine : public MediaEngineInterface {
   virtual bool FindVideoCodec(const VideoCodec& codec) { return true; }
   virtual void SetVoiceLogging(int min_sev, const char* filter) {}
   virtual void SetVideoLogging(int min_sev, const char* filter) {}
+  virtual bool StartAecDump(rtc::PlatformFile) { return false; }
 
   virtual bool RegisterVideoProcessor(VideoProcessor* processor) {
     return true;
@@ -159,6 +156,10 @@ class FileMediaEngine : public MediaEngineInterface {
     return signal_state_change_;
   }
 
+  void set_rtp_sender_thread(rtc::Thread* thread) {
+    rtp_sender_thread_ = thread;
+  }
+
  private:
   std::string voice_input_filename_;
   std::string voice_output_filename_;
@@ -170,6 +171,7 @@ class FileMediaEngine : public MediaEngineInterface {
   std::vector<RtpHeaderExtension> video_rtp_header_extensions_;
   sigslot::repeater2<VideoCapturer*, CaptureState>
      signal_state_change_;
+  rtc::Thread* rtp_sender_thread_;
 
   DISALLOW_COPY_AND_ASSIGN(FileMediaEngine);
 };
@@ -178,8 +180,9 @@ class RtpSenderReceiver;  // Forward declaration. Defined in the .cc file.
 
 class FileVoiceChannel : public VoiceMediaChannel {
  public:
-  FileVoiceChannel(talk_base::StreamInterface* input_file_stream,
-      talk_base::StreamInterface* output_file_stream);
+  FileVoiceChannel(rtc::StreamInterface* input_file_stream,
+      rtc::StreamInterface* output_file_stream,
+      rtc::Thread* rtp_sender_thread);
   virtual ~FileVoiceChannel();
 
   // Implement pure virtual methods of VoiceMediaChannel.
@@ -226,15 +229,17 @@ class FileVoiceChannel : public VoiceMediaChannel {
   virtual bool GetStats(VoiceMediaInfo* info) { return true; }
 
   // Implement pure virtual methods of MediaChannel.
-  virtual void OnPacketReceived(talk_base::Buffer* packet);
-  virtual void OnRtcpReceived(talk_base::Buffer* packet) {}
+  virtual void OnPacketReceived(rtc::Buffer* packet,
+                                const rtc::PacketTime& packet_time);
+  virtual void OnRtcpReceived(rtc::Buffer* packet,
+                              const rtc::PacketTime& packet_time) {}
   virtual void OnReadyToSend(bool ready) {}
   virtual bool AddSendStream(const StreamParams& sp);
   virtual bool RemoveSendStream(uint32 ssrc);
   virtual bool AddRecvStream(const StreamParams& sp) { return true; }
   virtual bool RemoveRecvStream(uint32 ssrc) { return true; }
   virtual bool MuteStream(uint32 ssrc, bool on) { return false; }
-  virtual bool SetSendBandwidth(bool autobw, int bps) { return true; }
+  virtual bool SetMaxSendBandwidth(int bps) { return true; }
   virtual bool SetOptions(const AudioOptions& options) {
     options_ = options;
     return true;
@@ -246,7 +251,7 @@ class FileVoiceChannel : public VoiceMediaChannel {
 
  private:
   uint32 send_ssrc_;
-  talk_base::scoped_ptr<RtpSenderReceiver> rtp_sender_receiver_;
+  rtc::scoped_ptr<RtpSenderReceiver> rtp_sender_receiver_;
   AudioOptions options_;
 
   DISALLOW_COPY_AND_ASSIGN(FileVoiceChannel);
@@ -254,8 +259,9 @@ class FileVoiceChannel : public VoiceMediaChannel {
 
 class FileVideoChannel : public VideoMediaChannel {
  public:
-  FileVideoChannel(talk_base::StreamInterface* input_file_stream,
-      talk_base::StreamInterface* output_file_stream);
+  FileVideoChannel(rtc::StreamInterface* input_file_stream,
+      rtc::StreamInterface* output_file_stream,
+      rtc::Thread* rtp_sender_thread);
   virtual ~FileVideoChannel();
 
   // Implement pure virtual methods of VideoMediaChannel.
@@ -286,20 +292,24 @@ class FileVideoChannel : public VideoMediaChannel {
   virtual bool SetCapturer(uint32 ssrc, VideoCapturer* capturer) {
     return false;
   }
-  virtual bool GetStats(VideoMediaInfo* info) { return true; }
+  virtual bool GetStats(const StatsOptions& options, VideoMediaInfo* info) {
+    return true;
+  }
   virtual bool SendIntraFrame() { return false; }
   virtual bool RequestIntraFrame() { return false; }
 
   // Implement pure virtual methods of MediaChannel.
-  virtual void OnPacketReceived(talk_base::Buffer* packet);
-  virtual void OnRtcpReceived(talk_base::Buffer* packet) {}
+  virtual void OnPacketReceived(rtc::Buffer* packet,
+                                const rtc::PacketTime& packet_time);
+  virtual void OnRtcpReceived(rtc::Buffer* packet,
+                              const rtc::PacketTime& packet_time) {}
   virtual void OnReadyToSend(bool ready) {}
   virtual bool AddSendStream(const StreamParams& sp);
   virtual bool RemoveSendStream(uint32 ssrc);
   virtual bool AddRecvStream(const StreamParams& sp) { return true; }
   virtual bool RemoveRecvStream(uint32 ssrc) { return true; }
   virtual bool MuteStream(uint32 ssrc, bool on) { return false; }
-  virtual bool SetSendBandwidth(bool autobw, int bps) { return true; }
+  virtual bool SetMaxSendBandwidth(int bps) { return true; }
   virtual bool SetOptions(const VideoOptions& options) {
     options_ = options;
     return true;
@@ -312,7 +322,7 @@ class FileVideoChannel : public VideoMediaChannel {
 
  private:
   uint32 send_ssrc_;
-  talk_base::scoped_ptr<RtpSenderReceiver> rtp_sender_receiver_;
+  rtc::scoped_ptr<RtpSenderReceiver> rtp_sender_receiver_;
   VideoOptions options_;
 
   DISALLOW_COPY_AND_ASSIGN(FileVideoChannel);