Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(391)

Issue 387933005: Cast: Refactor RTCP handling (Closed)

Created:
6 years, 5 months ago by Alpha Left Google
Modified:
6 years, 5 months ago
Reviewers:
Tom Sepez, miu
CC:
chromium-reviews, hclam+watch_chromium.org, cbentzel+watch_chromium.org, imcheng+watch_chromium.org, posciak+watch_chromium.org, jasonroberts+watch_google.com, avayvod+watch_chromium.org, mcasas+watch_chromium.org, pwestin+watch_google.com, feature-media-reviews_chromium.org, hguihot+watch_chromium.org, miu+watch_chromium.org, wjia+watch_chromium.org, hubbe+watch_chromium.org, mikhal+watch_chromium.org
Project:
chromium
Visibility:
Public.

Description

Cast: Refactor RTCP handling OBJECTIVES This change is to refactor RTCP handling in media/cast such that RTCP message parsing is done in CastTransportSender. This side effect of this refactoring is much cleaner code: RTCP handling code are grouped under one module. VideoSender and AudioSender do not handle packets directly. This also affect the architectutre in Chrome that RTCP message parsing is now done in the browser process. A parsed RTCP message is passed to the renderer instead of raw packets. REATIONALE RTCP is used as a feedback mechanism in Cast Streaming. It used to be parsed and handled by VideoSender and AudioSender in the render process. This was very ineffective because packetization and sending is done in the browser process. This created inefficiencies in packet retransmission. It also made improvement to the transport protocol / algorithm much more difficult. A side effect is very messy code. DETAILS Rtcp - This class is responsibile for maintaining a bi-directional RTCP session. It is now owned by CastTransportSender. CastTransportSender - It now performs packetization and also parsing of incoming RTCP packets. RTCP packets are small UDP packets for signaling only. Eventually retransmission can also be moved to this class. It will handle all packet level send transport. AudioSender / VideoSender - They don't handle packet directly any more. Which means render process doesn't see raw packets. FrameSender - Base class for AudioSender and VideoSender to share code for RTCP message handling. Eventually AudioSender and VideoSender will merge here but it is not the point of this change. RtcpBuilder - Removed and merged with RtcpSender. Net deleted 400 lines of code and simulation shows the same results. BUG=393042 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=284363

Patch Set 1 : smaller diff #

Patch Set 2 : smaller diff #

Total comments: 73

Patch Set 3 : merged #

Patch Set 4 : ipc changes #

Total comments: 12

Patch Set 5 : comments #

Patch Set 6 : merged #

Patch Set 7 : fix compile #

Patch Set 8 : fixed test #

Patch Set 9 : fix test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1505 lines, -1353 lines) Patch
M chrome/browser/media/cast_transport_host_filter.h View 1 2 3 4 4 chunks +19 lines, -7 lines 0 comments Download
M chrome/browser/media/cast_transport_host_filter.cc View 1 2 3 4 7 chunks +56 lines, -31 lines 0 comments Download
M chrome/browser/media/cast_transport_host_filter_unittest.cc View 1 2 3 4 5 6 7 2 chunks +6 lines, -9 lines 0 comments Download
M chrome/common/cast_messages.h View 1 2 3 3 chunks +44 lines, -17 lines 0 comments Download
M chrome/renderer/media/cast_ipc_dispatcher.h View 1 2 3 2 chunks +8 lines, -2 lines 0 comments Download
M chrome/renderer/media/cast_ipc_dispatcher.cc View 1 2 3 3 chunks +28 lines, -15 lines 0 comments Download
M chrome/renderer/media/cast_ipc_dispatcher_unittest.cc View 1 2 3 4 2 chunks +14 lines, -3 lines 0 comments Download
M chrome/renderer/media/cast_session_delegate.h View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M chrome/renderer/media/cast_session_delegate.cc View 1 2 3 3 chunks +12 lines, -2 lines 0 comments Download
M chrome/renderer/media/cast_transport_sender_ipc.h View 1 2 3 4 3 chunks +27 lines, -15 lines 0 comments Download
M chrome/renderer/media/cast_transport_sender_ipc.cc View 1 2 3 4 4 chunks +54 lines, -40 lines 0 comments Download
M media/cast/cast.gyp View 2 chunks +2 lines, -2 lines 0 comments Download
M media/cast/cast_config.h View 3 chunks +0 lines, -6 lines 0 comments Download
M media/cast/cast_config.cc View 3 chunks +0 lines, -3 lines 0 comments Download
M media/cast/cast_sender.h View 1 chunk +0 lines, -4 lines 0 comments Download
M media/cast/cast_sender_impl.h View 1 chunk +0 lines, -2 lines 0 comments Download
M media/cast/cast_sender_impl.cc View 3 chunks +1 line, -67 lines 0 comments Download
M media/cast/cast_testing.gypi View 1 2 1 chunk +0 lines, -2 lines 0 comments Download
M media/cast/net/cast_transport_config.h View 1 2 3 3 chunks +6 lines, -18 lines 0 comments Download
M media/cast/net/cast_transport_config.cc View 1 2 3 2 chunks +1 line, -5 lines 0 comments Download
M media/cast/net/cast_transport_sender.h View 1 2 3 6 chunks +22 lines, -24 lines 0 comments Download
M media/cast/net/cast_transport_sender_impl.h View 1 2 3 6 chunks +58 lines, -21 lines 0 comments Download
M media/cast/net/cast_transport_sender_impl.cc View 1 2 3 4 5 6 chunks +143 lines, -40 lines 0 comments Download
M media/cast/net/cast_transport_sender_impl_unittest.cc View 1 2 3 3 chunks +5 lines, -17 lines 0 comments Download
M media/cast/net/rtcp/mock_rtcp_receiver_feedback.h View 1 2 2 chunks +6 lines, -10 lines 0 comments Download
M media/cast/net/rtcp/mock_rtcp_receiver_feedback.cc View 1 2 1 chunk +0 lines, -4 lines 0 comments Download
M media/cast/net/rtcp/rtcp.h View 1 2 9 chunks +39 lines, -67 lines 0 comments Download
M media/cast/net/rtcp/rtcp.cc View 1 2 3 4 5 6 7 8 10 chunks +92 lines, -153 lines 0 comments Download
M media/cast/net/rtcp/rtcp_defines.h View 1 2 3 2 chunks +25 lines, -11 lines 0 comments Download
M media/cast/net/rtcp/rtcp_defines.cc View 1 2 3 2 chunks +7 lines, -9 lines 0 comments Download
M media/cast/net/rtcp/rtcp_receiver.h View 1 2 3 chunks +12 lines, -19 lines 0 comments Download
M media/cast/net/rtcp/rtcp_receiver.cc View 1 2 3 11 chunks +47 lines, -46 lines 0 comments Download
M media/cast/net/rtcp/rtcp_receiver_unittest.cc View 1 2 3 21 chunks +73 lines, -120 lines 0 comments Download
M media/cast/net/rtcp/rtcp_sender.h View 1 2 7 chunks +22 lines, -11 lines 0 comments Download
M media/cast/net/rtcp/rtcp_sender.cc View 1 2 3 10 chunks +119 lines, -17 lines 0 comments Download
M media/cast/net/rtcp/rtcp_sender_unittest.cc View 1 2 3 5 chunks +63 lines, -13 lines 0 comments Download
M media/cast/net/rtcp/rtcp_unittest.cc View 1 2 3 15 chunks +120 lines, -178 lines 0 comments Download
M media/cast/net/rtp/cast_message_builder.cc View 1 2 3 6 chunks +10 lines, -10 lines 0 comments Download
M media/cast/net/rtp/cast_message_builder_unittest.cc View 1 2 3 1 chunk +4 lines, -4 lines 0 comments Download
M media/cast/receiver/cast_receiver_impl.cc View 2 chunks +3 lines, -2 lines 0 comments Download
M media/cast/receiver/frame_receiver.h View 1 chunk +3 lines, -0 lines 0 comments Download
M media/cast/receiver/frame_receiver.cc View 1 2 3 6 chunks +14 lines, -17 lines 0 comments Download
M media/cast/sender/audio_sender.h View 1 2 6 chunks +3 lines, -31 lines 0 comments Download
M media/cast/sender/audio_sender.cc View 1 2 3 8 chunks +24 lines, -78 lines 0 comments Download
M media/cast/sender/audio_sender_unittest.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
A media/cast/sender/frame_sender.h View 1 2 1 chunk +77 lines, -0 lines 0 comments Download
A media/cast/sender/frame_sender.cc View 1 2 1 chunk +72 lines, -0 lines 0 comments Download
M media/cast/sender/video_sender.h View 1 2 7 chunks +3 lines, -32 lines 0 comments Download
M media/cast/sender/video_sender.cc View 1 2 3 9 chunks +43 lines, -85 lines 0 comments Download
M media/cast/sender/video_sender_unittest.cc View 1 2 3 14 chunks +30 lines, -29 lines 0 comments Download
M media/cast/test/cast_benchmarks.cc View 1 2 3 4 5 6 6 chunks +35 lines, -36 lines 0 comments Download
M media/cast/test/end2end_unittest.cc View 1 2 3 5 chunks +22 lines, -11 lines 0 comments Download
M media/cast/test/sender.cc View 3 chunks +13 lines, -2 lines 0 comments Download
M media/cast/test/simulator.cc View 3 chunks +14 lines, -3 lines 0 comments Download

Messages

Total messages: 44 (0 generated)
Alpha Left Google
Please review before I start to change the IPC layer.
6 years, 5 months ago (2014-07-13 02:29:48 UTC) #1
miu
Still working on the review. First round comments on the first half or so: https://codereview.chromium.org/387933005/diff/100001/media/cast/net/cast_transport_sender.h ...
6 years, 5 months ago (2014-07-16 00:09:32 UTC) #2
miu
...and I'm now finished reviewing PS2: https://codereview.chromium.org/387933005/diff/100001/media/cast/net/rtcp/rtcp_sender.cc File media/cast/net/rtcp/rtcp_sender.cc (right): https://codereview.chromium.org/387933005/diff/100001/media/cast/net/rtcp/rtcp_sender.cc#newcode235 media/cast/net/rtcp/rtcp_sender.cc:235: return; // Sanity ...
6 years, 5 months ago (2014-07-16 19:58:03 UTC) #3
miu
BTW--I really like this change, on the whole. It's moving the structure/factoring of a lot ...
6 years, 5 months ago (2014-07-16 19:59:25 UTC) #4
Alpha Left Google
https://codereview.chromium.org/387933005/diff/100001/media/cast/net/cast_transport_sender.h File media/cast/net/cast_transport_sender.h (right): https://codereview.chromium.org/387933005/diff/100001/media/cast/net/cast_transport_sender.h#newcode82 media/cast/net/cast_transport_sender.h:82: virtual void SendRtcpFromRtpSender( On 2014/07/16 00:09:30, miu wrote: > ...
6 years, 5 months ago (2014-07-17 01:01:47 UTC) #5
Alpha Left Google
+palmer +tsepez for reviewing IPC changes and overall security review. Patch Set 4 contains the ...
6 years, 5 months ago (2014-07-17 04:41:16 UTC) #6
Alpha Left Google
> RTCP packet parsing happens in these files: > * media/cast/net/rtcp/rtcp_parser.cc > * media/cast/net/rtcp/rtcp_receiver.cc Correction. ...
6 years, 5 months ago (2014-07-17 04:43:24 UTC) #7
Tom Sepez
Forgive my ignorance, but parsing anything in the browser seems like a bad idea from ...
6 years, 5 months ago (2014-07-17 16:35:20 UTC) #8
Alpha Left Google
On 2014/07/17 16:35:20, Tom Sepez wrote: > Forgive my ignorance, but parsing anything in the ...
6 years, 5 months ago (2014-07-17 17:48:26 UTC) #9
Alpha Left Google
> I would like to know if we can do anything to alleviate the risk ...
6 years, 5 months ago (2014-07-17 17:50:38 UTC) #10
Tom Sepez
On 2014/07/17 17:50:38, Alpha wrote: > > I would like to know if we can ...
6 years, 5 months ago (2014-07-17 18:46:37 UTC) #11
Tom Sepez
On 2014/07/17 17:50:38, Alpha wrote: > > I would like to know if we can ...
6 years, 5 months ago (2014-07-17 18:46:40 UTC) #12
Tom Sepez
So much for tablet Thursday. S/prices/process/ S/coffee/code. Sorry :(
6 years, 5 months ago (2014-07-17 18:57:21 UTC) #13
Tom Sepez
So much for tablet Thursday. S/prices/process/ S/coffee/code. Sorry :(
6 years, 5 months ago (2014-07-17 18:57:24 UTC) #14
Alpha Left Google
> I'm trying to balance the sheer terror of being only one bug removed from ...
6 years, 5 months ago (2014-07-17 21:53:17 UTC) #15
Alpha Left Google
> The packets that are read off the UDP socket have rigid wire format and ...
6 years, 5 months ago (2014-07-17 22:34:28 UTC) #16
Tom Sepez
Ok. One more thing that will have to move to a utility process when the ...
6 years, 5 months ago (2014-07-17 23:07:54 UTC) #17
Alpha Left Google
On 2014/07/17 23:07:54, Tom Sepez wrote: > Ok. One more thing that will have to ...
6 years, 5 months ago (2014-07-17 23:11:07 UTC) #18
Alpha Left Google
> Heh about this networking utility process. This was the idea I proposed (but > ...
6 years, 5 months ago (2014-07-17 23:20:01 UTC) #19
Tom Sepez
Messages LGTM.
6 years, 5 months ago (2014-07-17 23:21:46 UTC) #20
miu
lgtm % a few things to address before commit: https://codereview.chromium.org/387933005/diff/100001/media/cast/sender/frame_sender.h File media/cast/sender/frame_sender.h (right): https://codereview.chromium.org/387933005/diff/100001/media/cast/sender/frame_sender.h#newcode65 media/cast/sender/frame_sender.h:65: ...
6 years, 5 months ago (2014-07-18 00:06:23 UTC) #21
Alpha Left Google
https://codereview.chromium.org/387933005/diff/140001/chrome/browser/media/cast_transport_host_filter.cc File chrome/browser/media/cast_transport_host_filter.cc (right): https://codereview.chromium.org/387933005/diff/140001/chrome/browser/media/cast_transport_host_filter.cc#newcode124 chrome/browser/media/cast_transport_host_filter.cc:124: base::Bind(&CastTransportHostFilter::CastMessage, On 2014/07/18 00:06:22, miu wrote: > The base::Unretained() ...
6 years, 5 months ago (2014-07-18 01:14:31 UTC) #22
Alpha Left Google
The CQ bit was checked by hclam@chromium.org
6 years, 5 months ago (2014-07-18 01:14:45 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hclam@chromium.org/387933005/160001
6 years, 5 months ago (2014-07-18 01:17:54 UTC) #24
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_aosp on tryserver.chromium ...
6 years, 5 months ago (2014-07-18 03:05:41 UTC) #25
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 5 months ago (2014-07-18 03:07:41 UTC) #26
commit-bot: I haz the power
Try jobs failed on following builders: mac_gpu on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/mac_gpu/builds/30158)
6 years, 5 months ago (2014-07-18 03:07:42 UTC) #27
Alpha Left Google
The CQ bit was checked by hclam@chromium.org
6 years, 5 months ago (2014-07-18 18:39:06 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hclam@chromium.org/387933005/180001
6 years, 5 months ago (2014-07-18 18:40:56 UTC) #29
Alpha Left Google
The CQ bit was checked by hclam@chromium.org
6 years, 5 months ago (2014-07-18 20:05:40 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hclam@chromium.org/387933005/200001
6 years, 5 months ago (2014-07-18 20:07:35 UTC) #31
Alpha Left Google
The CQ bit was checked by hclam@chromium.org
6 years, 5 months ago (2014-07-18 23:14:23 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hclam@chromium.org/387933005/220001
6 years, 5 months ago (2014-07-18 23:15:31 UTC) #33
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: win_chromium_rel on tryserver.chromium ...
6 years, 5 months ago (2014-07-19 02:48:58 UTC) #34
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 5 months ago (2014-07-19 05:06:49 UTC) #35
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/win_chromium_rel/builds/40833)
6 years, 5 months ago (2014-07-19 05:06:50 UTC) #36
Alpha Left Google
The CQ bit was checked by hclam@chromium.org
6 years, 5 months ago (2014-07-19 23:34:05 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hclam@chromium.org/387933005/240001
6 years, 5 months ago (2014-07-19 23:34:52 UTC) #38
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: win_chromium_compile_dbg on tryserver.chromium ...
6 years, 5 months ago (2014-07-20 04:30:55 UTC) #39
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 5 months ago (2014-07-20 04:42:52 UTC) #40
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_compile_dbg on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/win_chromium_compile_dbg/builds/39756)
6 years, 5 months ago (2014-07-20 04:42:54 UTC) #41
Alpha Left Google
The CQ bit was checked by hclam@chromium.org
6 years, 5 months ago (2014-07-20 05:05:14 UTC) #42
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hclam@chromium.org/387933005/240001
6 years, 5 months ago (2014-07-20 05:06:10 UTC) #43
commit-bot: I haz the power
6 years, 5 months ago (2014-07-20 07:13:32 UTC) #44
Message was sent while issue was closed.
Change committed as 284363

Powered by Google App Engine
This is Rietveld 408576698