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

Issue 1295753003: Convenience functions to convert RtcEvents to webrtc types. (Closed)

Created:
5 years, 4 months ago by terelius
Modified:
3 years, 9 months ago
Reviewers:
ivoc, hlundin-webrtc
CC:
webrtc-reviews_webrtc.org, yujie_mao (webrtc), Andrew MacDonald, stefan-webrtc, tterriberry_mozilla.com, qiang.lu, niklas.enbom, mflodman, perkj_webrtc, andresp
Base URL:
https://chromium.googlesource.com/external/webrtc.git@master
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

Creates convenience functions to convert stored RtcEvents to the original webrtc types. Moves all parsing of RtcEventLog to a separate class.

Patch Set 1 #

Total comments: 20

Patch Set 2 : Comments from hlundin@ #

Total comments: 22

Patch Set 3 : Reviewer comments #

Patch Set 4 : Rebase and change CHECK to RTC_CHECK #

Unified diffs Side-by-side diffs Delta from patch set Stats (+381 lines, -55 lines) Patch
M webrtc/BUILD.gn View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/tools/rtc_event_log_source.cc View 1 2 3 2 chunks +2 lines, -1 line 0 comments Download
M webrtc/video/rtc_event_log.h View 1 2 3 2 chunks +0 lines, -12 lines 0 comments Download
M webrtc/video/rtc_event_log.cc View 1 2 3 3 chunks +3 lines, -15 lines 0 comments Download
M webrtc/video/rtc_event_log2rtp_dump.cc View 1 2 3 2 chunks +2 lines, -1 line 0 comments Download
A webrtc/video/rtc_event_log_parser.h View 1 2 1 chunk +92 lines, -0 lines 0 comments Download
A webrtc/video/rtc_event_log_parser.cc View 1 2 3 1 chunk +262 lines, -0 lines 0 comments Download
M webrtc/video/rtc_event_log_unittest.cc View 1 2 3 6 chunks +10 lines, -26 lines 0 comments Download
M webrtc/webrtc.gyp View 1 2 3 2 chunks +6 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (2 generated)
terelius
I have not added unit tests in this CL because the existing unit tests for ...
5 years, 4 months ago (2015-08-14 12:47:31 UTC) #2
hlundin-webrtc
Nice. But see comments. https://codereview.webrtc.org/1295753003/diff/1/webrtc/video/rtc_event_log.cc File webrtc/video/rtc_event_log.cc (right): https://codereview.webrtc.org/1295753003/diff/1/webrtc/video/rtc_event_log.cc#newcode13 webrtc/video/rtc_event_log.cc:13: #include <cstring> string.h We tend ...
5 years, 4 months ago (2015-08-18 09:22:59 UTC) #3
terelius
https://codereview.webrtc.org/1295753003/diff/1/webrtc/video/rtc_event_log.cc File webrtc/video/rtc_event_log.cc (right): https://codereview.webrtc.org/1295753003/diff/1/webrtc/video/rtc_event_log.cc#newcode13 webrtc/video/rtc_event_log.cc:13: #include <cstring> On 2015/08/18 09:22:59, hlundin-webrtc wrote: > string.h ...
5 years, 4 months ago (2015-08-18 16:06:51 UTC) #4
ivoc
https://codereview.webrtc.org/1295753003/diff/20001/webrtc/video/rtc_event_log.cc File webrtc/video/rtc_event_log.cc (right): https://codereview.webrtc.org/1295753003/diff/20001/webrtc/video/rtc_event_log.cc#newcode13 webrtc/video/rtc_event_log.cc:13: #include <string> I don't think this include is needed ...
5 years, 4 months ago (2015-08-25 15:25:55 UTC) #5
hlundin-webrtc
Looks good, but please, address Ivo's comments. https://codereview.webrtc.org/1295753003/diff/20001/webrtc/video/rtc_event_log.cc File webrtc/video/rtc_event_log.cc (right): https://codereview.webrtc.org/1295753003/diff/20001/webrtc/video/rtc_event_log.cc#newcode13 webrtc/video/rtc_event_log.cc:13: #include <string> ...
5 years, 3 months ago (2015-08-28 10:37:16 UTC) #6
terelius
https://codereview.webrtc.org/1295753003/diff/20001/webrtc/video/rtc_event_log.cc File webrtc/video/rtc_event_log.cc (right): https://codereview.webrtc.org/1295753003/diff/20001/webrtc/video/rtc_event_log.cc#newcode13 webrtc/video/rtc_event_log.cc:13: #include <string> On 2015/08/25 15:25:55, ivoc wrote: > I ...
5 years, 3 months ago (2015-09-23 11:41:17 UTC) #7
ivoc
5 years, 2 months ago (2015-09-25 14:16:34 UTC) #8
https://codereview.webrtc.org/1295753003/diff/20001/webrtc/video/rtc_event_lo...
File webrtc/video/rtc_event_log_parser.cc (right):

https://codereview.webrtc.org/1295753003/diff/20001/webrtc/video/rtc_event_lo...
webrtc/video/rtc_event_log_parser.cc:105: memcpy(header,
rtp_packet.header().data(), rtp_packet.header().size());
On 2015/09/23 11:41:17, terelius wrote:
> On 2015/08/25 15:25:55, ivoc wrote:
> > Another option here would be to allocate the data here, and pass ownership
to
> > the caller. You could do this by changing the header argument to uint8_t**
> type,
> > if it's set to nullptr, don't allocate a header, otherwise, allocate from
here
> > and fill the buffer. 
> 
> The problem is that doing that would force a new allocation for each packet,
> even if the application only want to check the header for an absolute send
time.
> I prefer doing it this way since ownership is more explicit and the same
buffer
> can be reused for multiple headers.

Acknowledged.

https://codereview.webrtc.org/1295753003/diff/20001/webrtc/video/rtc_event_lo...
File webrtc/video/rtc_event_log_parser.h (right):

https://codereview.webrtc.org/1295753003/diff/20001/webrtc/video/rtc_event_lo...
webrtc/video/rtc_event_log_parser.h:22: #include
"webrtc/video/rtc_event_log.pb.h"
On 2015/09/23 11:41:17, terelius wrote:
> On 2015/08/25 15:25:55, ivoc wrote:
> > I wonder if there is a way to hide the protobuf internals completely. Maybe
it
> > could be enough to add these two functions: 
> > int GetNumberOfEvents(EventStream&) 
> > and
> > void GetEvent(EventStream&, int index, Event*)
> > What do you think?
> 
> I agree that it would be very nice to hide the protobuf internals. I have
added
> the functions you suggested, but  it does not completely hide the protobuf. We
> are still manipulating the protobuf data structures and in particular, we
still
> have to use the protobuf EventType constants, e.g. rtclog::Event::RTP_EVENT
> 

I think that it is possible to completely hide the internals if we really want
to. Those protobuf enums can be translated to different ones that are defined in
this header, and the Event and EventStream themselves can be just forward
declared in the header (which works fine as long as the "user" doesn't need to
call any functions on it, and they only appear as references or pointers in the
header). I'm not sure if it's worth it though, what do you think?

https://codereview.webrtc.org/1295753003/diff/20001/webrtc/video/rtc_event_lo...
webrtc/video/rtc_event_log_parser.h:33: static MediaType
GetRuntimeMediaType(rtclog::MediaType media_type);
On 2015/09/23 11:41:17, terelius wrote:
> On 2015/08/25 15:25:55, ivoc wrote:
> > Does this function need to be public? Might be better to move it to an
> anonymous
> > namespace in the .cc file.
> 
> This function is used in the unit test. (In fact it was moved here from the
unit
> test.)
> 
> One solution would be to rewrite the unit test using the parser code, but then
a
> lot of the verifications will be done with CHECK rather than ASSERT/EXPECT. I
am
> open to suggestions.

Okay, good point. I guess it's fine to leave it here then.

Powered by Google App Engine
This is Rietveld 408576698