OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #include <iostream> | 11 #include <iostream> |
12 #include <map> | |
12 #include <sstream> | 13 #include <sstream> |
13 #include <string> | 14 #include <string> |
15 #include <utility> // pair | |
14 | 16 |
15 #include "gflags/gflags.h" | 17 #include "gflags/gflags.h" |
16 #include "webrtc/base/checks.h" | 18 #include "webrtc/base/checks.h" |
17 #include "webrtc/common_types.h" | 19 #include "webrtc/common_types.h" |
18 #include "webrtc/logging/rtc_event_log/rtc_event_log_parser.h" | 20 #include "webrtc/logging/rtc_event_log/rtc_event_log_parser.h" |
19 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/bye.h" | 21 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/bye.h" |
20 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/common_header.h" | 22 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/common_header.h" |
21 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/extended_reports.h" | 23 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/extended_reports.h" |
22 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/fir.h" | 24 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/fir.h" |
23 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/nack.h" | 25 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/nack.h" |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
432 << ", rtx_payload_type: " << codec.rtx_payload_type << "}"; | 434 << ", rtx_payload_type: " << codec.rtx_payload_type << "}"; |
433 } | 435 } |
434 std::cout << "}" << std::endl; | 436 std::cout << "}" << std::endl; |
435 } | 437 } |
436 if (!FLAGS_nortp && | 438 if (!FLAGS_nortp && |
437 parsed_stream.GetEventType(i) == webrtc::ParsedRtcEventLog::RTP_EVENT) { | 439 parsed_stream.GetEventType(i) == webrtc::ParsedRtcEventLog::RTP_EVENT) { |
438 size_t header_length; | 440 size_t header_length; |
439 size_t total_length; | 441 size_t total_length; |
440 uint8_t header[IP_PACKET_SIZE]; | 442 uint8_t header[IP_PACKET_SIZE]; |
441 webrtc::PacketDirection direction; | 443 webrtc::PacketDirection direction; |
442 | 444 webrtc::RtpHeaderExtensionMap* extension_map = parsed_stream.GetRtpHeader( |
perkj_webrtc
2017/06/07 16:49:57
Why can't this return a webrtc::RtpHeader directly
ilnik
2017/06/08 08:43:43
I don't know why it was done like that. Maybe desi
terelius
2017/06/08 09:40:28
RTPHeader doesn't contain direction, media_type or
ilnik
2017/06/08 09:44:16
Looks like there'll be a massive overhaul of rtp_l
| |
443 parsed_stream.GetRtpHeader(i, &direction, header, &header_length, | 445 i, &direction, header, &header_length, &total_length); |
444 &total_length); | |
445 | 446 |
446 // Parse header to get SSRC and RTP time. | 447 // Parse header to get SSRC and RTP time. |
447 webrtc::RtpUtility::RtpHeaderParser rtp_parser(header, header_length); | 448 webrtc::RtpUtility::RtpHeaderParser rtp_parser(header, header_length); |
448 webrtc::RTPHeader parsed_header; | 449 webrtc::RTPHeader parsed_header; |
449 rtp_parser.Parse(&parsed_header); | 450 rtp_parser.Parse(&parsed_header, extension_map); |
450 MediaType media_type = | 451 MediaType media_type = |
451 parsed_stream.GetMediaType(parsed_header.ssrc, direction); | 452 parsed_stream.GetMediaType(parsed_header.ssrc, direction); |
452 | 453 |
453 if (ExcludePacket(direction, media_type, parsed_header.ssrc)) | 454 if (ExcludePacket(direction, media_type, parsed_header.ssrc)) |
454 continue; | 455 continue; |
455 | 456 |
456 std::cout << parsed_stream.GetTimestamp(i) << "\tRTP" | 457 std::cout << parsed_stream.GetTimestamp(i) << "\tRTP" |
457 << StreamInfo(direction, media_type) | 458 << StreamInfo(direction, media_type) |
458 << "\tssrc=" << parsed_header.ssrc | 459 << "\tssrc=" << parsed_header.ssrc |
459 << "\ttimestamp=" << parsed_header.timestamp << std::endl; | 460 << "\ttimestamp=" << parsed_header.timestamp; |
461 if (parsed_header.extension.hasAbsoluteSendTime) { | |
462 std::cout << "\tAbsSendTime=" | |
463 << parsed_header.extension.absoluteSendTime; | |
464 } | |
465 if (parsed_header.extension.hasVideoContentType) { | |
466 std::cout << "\tContentType=" | |
467 << static_cast<int>(parsed_header.extension.videoContentType); | |
468 } | |
469 if (parsed_header.extension.hasVideoRotation) { | |
470 std::cout << "\tRotation=" | |
471 << static_cast<int>(parsed_header.extension.videoRotation); | |
472 } | |
473 if (parsed_header.extension.hasTransportSequenceNumber) { | |
474 std::cout << "\tTransportSeq=" | |
475 << parsed_header.extension.transportSequenceNumber; | |
476 } | |
477 if (parsed_header.extension.hasTransmissionTimeOffset) { | |
478 std::cout << "\tTransmTimeOffset=" | |
479 << parsed_header.extension.transmissionTimeOffset; | |
480 } | |
481 if (parsed_header.extension.hasAudioLevel) { | |
482 std::cout << "\tAudioLevel=" << parsed_header.extension.audioLevel; | |
483 } | |
484 std::cout << std::endl; | |
460 } | 485 } |
461 if (!FLAGS_nortcp && | 486 if (!FLAGS_nortcp && |
462 parsed_stream.GetEventType(i) == | 487 parsed_stream.GetEventType(i) == |
463 webrtc::ParsedRtcEventLog::RTCP_EVENT) { | 488 webrtc::ParsedRtcEventLog::RTCP_EVENT) { |
464 size_t length; | 489 size_t length; |
465 uint8_t packet[IP_PACKET_SIZE]; | 490 uint8_t packet[IP_PACKET_SIZE]; |
466 webrtc::PacketDirection direction; | 491 webrtc::PacketDirection direction; |
467 parsed_stream.GetRtcpPacket(i, &direction, packet, &length); | 492 parsed_stream.GetRtcpPacket(i, &direction, packet, &length); |
468 | 493 |
469 webrtc::rtcp::CommonHeader rtcp_block; | 494 webrtc::rtcp::CommonHeader rtcp_block; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
504 direction); | 529 direction); |
505 break; | 530 break; |
506 default: | 531 default: |
507 break; | 532 break; |
508 } | 533 } |
509 } | 534 } |
510 } | 535 } |
511 } | 536 } |
512 return 0; | 537 return 0; |
513 } | 538 } |
OLD | NEW |