Index: chrome/renderer/media/cast_ipc_helper.h |
diff --git a/chrome/renderer/media/cast_ipc_helper.h b/chrome/renderer/media/cast_ipc_helper.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..fa96593a931f5aa72669badf65138dfee021bc1a |
--- /dev/null |
+++ b/chrome/renderer/media/cast_ipc_helper.h |
@@ -0,0 +1,89 @@ |
+// Copyright (c) 2013 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. |
mikhal1
2014/01/23 21:04:38
new line
hubbe
2014/02/03 22:58:59
Done.
|
+#ifndef CHROME_RENDERER_MEDIA_CAST_IPC_HELPER_H_ |
+#define CHROME_RENDERER_MEDIA_CAST_IPC_HELPER_H_ |
+ |
+#include "base/callback.h" |
+#include "base/id_map.h" |
+#include "content/common/cast_messages.h" |
+#include "content/public/renderer/render_view_observer.h" |
+#include "media/cast/cast_sender.h" |
+#include "media/cast/transport/cast_transport_sender.h" |
+ |
+namespace cast { |
+ |
+class CastIPCDispatcher; |
+ |
+class CastIPCNet : public media::cast::transport::CastTransportSender { |
+ public: |
+ CastIPCNet(const media::cast::transport::CastTransportConfig& config, |
+ CastIPCDispatcher* dispatcher); |
+ virtual ~CastIPCNet(); |
+ |
+ // media::cast::transport::CastNetSender implementation |
+ virtual void InsertCodedAudioFrame( |
+ const media::cast::transport::EncodedAudioFrame* audio_frame, |
+ const base::TimeTicks& recorded_time) OVERRIDE; |
+ virtual void InsertCodedVideoFrame( |
+ const media::cast::transport::EncodedVideoFrame* video_frame, |
+ const base::TimeTicks& capture_time) OVERRIDE; |
+ |
+ virtual void SendRtcpFromRtpSender( |
+ uint32 packet_type_flags, |
+ const media::cast::transport::RtcpSenderInfo& sender_info, |
+ const media::cast::transport::RtcpDlrrReportBlock& dlrr, |
+ const media::cast::transport::RtcpSenderLogMessage& sender_log, |
+ uint32 sending_ssrc, |
+ const std::string& c_name) OVERRIDE; |
+ |
+ // Retransmission request. |
+ virtual void ResendPackets( |
+ bool is_audio, |
+ const media::cast::MissingFramesAndPacketsMap& missing_packets) OVERRIDE; |
+ |
+ // Retrieves audio RTP statistics. |
+ virtual void RtpAudioStatistics( |
+ const base::TimeTicks& now, |
+ media::cast::transport::RtcpSenderInfo* sender_info) OVERRIDE; |
+ |
+ // Retrieves video RTP statistics. |
+ virtual void RtpVideoStatistics( |
+ const base::TimeTicks& now, |
+ media::cast::transport::RtcpSenderInfo* sender_info) OVERRIDE; |
+ |
+ |
+ private: |
+ bool Send(IPC::Message *message); |
+ |
+ friend class CastIPCDispatcher; |
+ int32 channel_id_; |
+ CastIPCDispatcher* dispatcher_; |
+ base::Callback<void(const media::cast::Packet&)> packet_callback_; |
+ media::cast::transport::CastTransportStatusCallback status_callback_; |
+}; |
+ |
+class CastIPCDispatcher : public content::RenderViewObserver { |
+ public: |
+ explicit CastIPCDispatcher(content::RenderView* render_view); |
+ virtual ~CastIPCDispatcher(); |
+ // RenderViewObserver implementation |
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
+ |
+ void OnRtpStatisticsUpdate( |
+ int32 channel_id, |
+ const base::TimeTicks& now, |
+ const media::cast::transport::RtcpSenderInfo& sender_info); |
+ void OnGotPacket(int32 channel_id, const media::cast::Packet& packet); |
+ void OnNotifyStatusChange( |
+ int32 channel_id, |
+ media::cast::transport::CastTransportStatus status); |
+ |
+ private: |
+ friend CastIPCNet; |
+ IDMap<CastIPCNet> id_map_; |
+}; |
+ |
+} // namespace cast |
+ |
+#endif // CHROME_RENDERER_MEDIA_CAST_IPC_HELPER_H_ |