OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
mikhal1
2014/01/23 21:04:38
new line
hubbe
2014/02/03 22:58:59
Done.
| |
4 #ifndef CHROME_RENDERER_MEDIA_CAST_IPC_HELPER_H_ | |
5 #define CHROME_RENDERER_MEDIA_CAST_IPC_HELPER_H_ | |
6 | |
7 #include "base/callback.h" | |
8 #include "base/id_map.h" | |
9 #include "content/common/cast_messages.h" | |
10 #include "content/public/renderer/render_view_observer.h" | |
11 #include "media/cast/cast_sender.h" | |
12 #include "media/cast/transport/cast_transport_sender.h" | |
13 | |
14 namespace cast { | |
15 | |
16 class CastIPCDispatcher; | |
17 | |
18 class CastIPCNet : public media::cast::transport::CastTransportSender { | |
19 public: | |
20 CastIPCNet(const media::cast::transport::CastTransportConfig& config, | |
21 CastIPCDispatcher* dispatcher); | |
22 virtual ~CastIPCNet(); | |
23 | |
24 // media::cast::transport::CastNetSender implementation | |
25 virtual void InsertCodedAudioFrame( | |
26 const media::cast::transport::EncodedAudioFrame* audio_frame, | |
27 const base::TimeTicks& recorded_time) OVERRIDE; | |
28 virtual void InsertCodedVideoFrame( | |
29 const media::cast::transport::EncodedVideoFrame* video_frame, | |
30 const base::TimeTicks& capture_time) OVERRIDE; | |
31 | |
32 virtual void SendRtcpFromRtpSender( | |
33 uint32 packet_type_flags, | |
34 const media::cast::transport::RtcpSenderInfo& sender_info, | |
35 const media::cast::transport::RtcpDlrrReportBlock& dlrr, | |
36 const media::cast::transport::RtcpSenderLogMessage& sender_log, | |
37 uint32 sending_ssrc, | |
38 const std::string& c_name) OVERRIDE; | |
39 | |
40 // Retransmission request. | |
41 virtual void ResendPackets( | |
42 bool is_audio, | |
43 const media::cast::MissingFramesAndPacketsMap& missing_packets) OVERRIDE; | |
44 | |
45 // Retrieves audio RTP statistics. | |
46 virtual void RtpAudioStatistics( | |
47 const base::TimeTicks& now, | |
48 media::cast::transport::RtcpSenderInfo* sender_info) OVERRIDE; | |
49 | |
50 // Retrieves video RTP statistics. | |
51 virtual void RtpVideoStatistics( | |
52 const base::TimeTicks& now, | |
53 media::cast::transport::RtcpSenderInfo* sender_info) OVERRIDE; | |
54 | |
55 | |
56 private: | |
57 bool Send(IPC::Message *message); | |
58 | |
59 friend class CastIPCDispatcher; | |
60 int32 channel_id_; | |
61 CastIPCDispatcher* dispatcher_; | |
62 base::Callback<void(const media::cast::Packet&)> packet_callback_; | |
63 media::cast::transport::CastTransportStatusCallback status_callback_; | |
64 }; | |
65 | |
66 class CastIPCDispatcher : public content::RenderViewObserver { | |
67 public: | |
68 explicit CastIPCDispatcher(content::RenderView* render_view); | |
69 virtual ~CastIPCDispatcher(); | |
70 // RenderViewObserver implementation | |
71 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | |
72 | |
73 void OnRtpStatisticsUpdate( | |
74 int32 channel_id, | |
75 const base::TimeTicks& now, | |
76 const media::cast::transport::RtcpSenderInfo& sender_info); | |
77 void OnGotPacket(int32 channel_id, const media::cast::Packet& packet); | |
78 void OnNotifyStatusChange( | |
79 int32 channel_id, | |
80 media::cast::transport::CastTransportStatus status); | |
81 | |
82 private: | |
83 friend CastIPCNet; | |
84 IDMap<CastIPCNet> id_map_; | |
85 }; | |
86 | |
87 } // namespace cast | |
88 | |
89 #endif // CHROME_RENDERER_MEDIA_CAST_IPC_HELPER_H_ | |
OLD | NEW |