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

Side by Side Diff: webrtc/logging/rtc_event_log/rtc_event_log.cc

Issue 2850793002: Replace VideoReceiveStream::Config with new rtclog::StreamConfig in RtcEventLog. (Closed)
Patch Set: Fix merge. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 class RtcEventLogImpl final : public RtcEventLog { 55 class RtcEventLogImpl final : public RtcEventLog {
56 public: 56 public:
57 RtcEventLogImpl(); 57 RtcEventLogImpl();
58 ~RtcEventLogImpl() override; 58 ~RtcEventLogImpl() override;
59 59
60 bool StartLogging(const std::string& file_name, 60 bool StartLogging(const std::string& file_name,
61 int64_t max_size_bytes) override; 61 int64_t max_size_bytes) override;
62 bool StartLogging(rtc::PlatformFile platform_file, 62 bool StartLogging(rtc::PlatformFile platform_file,
63 int64_t max_size_bytes) override; 63 int64_t max_size_bytes) override;
64 void StopLogging() override; 64 void StopLogging() override;
65 void LogVideoReceiveStreamConfig( 65 void LogVideoReceiveStreamConfig(const rtclog::StreamConfig& config) override;
66 const VideoReceiveStream::Config& config) override;
67 void LogVideoSendStreamConfig(const VideoSendStream::Config& config) override; 66 void LogVideoSendStreamConfig(const VideoSendStream::Config& config) override;
68 void LogAudioReceiveStreamConfig( 67 void LogAudioReceiveStreamConfig(
69 const AudioReceiveStream::Config& config) override; 68 const AudioReceiveStream::Config& config) override;
70 void LogAudioSendStreamConfig(const AudioSendStream::Config& config) override; 69 void LogAudioSendStreamConfig(const AudioSendStream::Config& config) override;
71 void LogRtpHeader(PacketDirection direction, 70 void LogRtpHeader(PacketDirection direction,
72 MediaType media_type, 71 MediaType media_type,
73 const uint8_t* header, 72 const uint8_t* header,
74 size_t packet_length) override; 73 size_t packet_length) override;
75 void LogRtpHeader(PacketDirection direction, 74 void LogRtpHeader(PacketDirection direction,
76 MediaType media_type, 75 MediaType media_type,
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 // time, we require that all calls to StopLogging are made on the same 269 // time, we require that all calls to StopLogging are made on the same
271 // thread. 270 // thread.
272 LOG(LS_ERROR) << "Message queue full. Clearing queue to stop logging."; 271 LOG(LS_ERROR) << "Message queue full. Clearing queue to stop logging.";
273 message_queue_.Clear(); 272 message_queue_.Clear();
274 } 273 }
275 LOG(LS_INFO) << "Stopping WebRTC event log."; 274 LOG(LS_INFO) << "Stopping WebRTC event log.";
276 helper_thread_.WaitForFileFinished(); 275 helper_thread_.WaitForFileFinished();
277 } 276 }
278 277
279 void RtcEventLogImpl::LogVideoReceiveStreamConfig( 278 void RtcEventLogImpl::LogVideoReceiveStreamConfig(
280 const VideoReceiveStream::Config& config) { 279 const rtclog::StreamConfig& config) {
281 std::unique_ptr<rtclog::Event> event(new rtclog::Event()); 280 std::unique_ptr<rtclog::Event> event(new rtclog::Event());
282 event->set_timestamp_us(rtc::TimeMicros()); 281 event->set_timestamp_us(rtc::TimeMicros());
283 event->set_type(rtclog::Event::VIDEO_RECEIVER_CONFIG_EVENT); 282 event->set_type(rtclog::Event::VIDEO_RECEIVER_CONFIG_EVENT);
284 283
285 rtclog::VideoReceiveConfig* receiver_config = 284 rtclog::VideoReceiveConfig* receiver_config =
286 event->mutable_video_receiver_config(); 285 event->mutable_video_receiver_config();
287 receiver_config->set_remote_ssrc(config.rtp.remote_ssrc); 286 receiver_config->set_remote_ssrc(config.remote_ssrc);
288 receiver_config->set_local_ssrc(config.rtp.local_ssrc); 287 receiver_config->set_local_ssrc(config.local_ssrc);
289 288
290 receiver_config->set_rtcp_mode(ConvertRtcpMode(config.rtp.rtcp_mode)); 289 // TODO(perkj): Add field for rsid.
291 receiver_config->set_remb(config.rtp.remb); 290 receiver_config->set_rtcp_mode(ConvertRtcpMode(config.rtcp_mode));
291 receiver_config->set_remb(config.remb);
292 292
293 for (const auto& kv : config.rtp.rtx_payload_types) { 293 for (const auto& e : config.rtp_extensions) {
294 rtclog::RtxMap* rtx = receiver_config->add_rtx_map();
295 rtx->set_payload_type(kv.first);
296 rtx->mutable_config()->set_rtx_ssrc(config.rtp.rtx_ssrc);
297 rtx->mutable_config()->set_rtx_payload_type(kv.second);
298 }
299
300 for (const auto& e : config.rtp.extensions) {
301 rtclog::RtpHeaderExtension* extension = 294 rtclog::RtpHeaderExtension* extension =
302 receiver_config->add_header_extensions(); 295 receiver_config->add_header_extensions();
303 extension->set_name(e.uri); 296 extension->set_name(e.uri);
304 extension->set_id(e.id); 297 extension->set_id(e.id);
305 } 298 }
306 299
307 for (const auto& d : config.decoders) { 300 for (const auto& d : config.codecs) {
308 rtclog::DecoderConfig* decoder = receiver_config->add_decoders(); 301 rtclog::DecoderConfig* decoder = receiver_config->add_decoders();
309 decoder->set_name(d.payload_name); 302 decoder->set_name(d.payload_name);
310 decoder->set_payload_type(d.payload_type); 303 decoder->set_payload_type(d.payload_type);
304 if (d.rtx_payload_type != 0) {
305 rtclog::RtxMap* rtx = receiver_config->add_rtx_map();
306 rtx->set_payload_type(d.payload_type);
307 rtx->mutable_config()->set_rtx_ssrc(config.rtx_ssrc);
308 rtx->mutable_config()->set_rtx_payload_type(d.rtx_payload_type);
309 }
311 } 310 }
312 StoreEvent(&event); 311 StoreEvent(&event);
313 } 312 }
314 313
315 void RtcEventLogImpl::LogVideoSendStreamConfig( 314 void RtcEventLogImpl::LogVideoSendStreamConfig(
316 const VideoSendStream::Config& config) { 315 const VideoSendStream::Config& config) {
317 std::unique_ptr<rtclog::Event> event(new rtclog::Event()); 316 std::unique_ptr<rtclog::Event> event(new rtclog::Event());
318 event->set_timestamp_us(rtc::TimeMicros()); 317 event->set_timestamp_us(rtc::TimeMicros());
319 event->set_type(rtclog::Event::VIDEO_SENDER_CONFIG_EVENT); 318 event->set_type(rtclog::Event::VIDEO_SENDER_CONFIG_EVENT);
320 319
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 #else 613 #else
615 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); 614 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl());
616 #endif // ENABLE_RTC_EVENT_LOG 615 #endif // ENABLE_RTC_EVENT_LOG
617 } 616 }
618 617
619 std::unique_ptr<RtcEventLog> RtcEventLog::CreateNull() { 618 std::unique_ptr<RtcEventLog> RtcEventLog::CreateNull() {
620 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); 619 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl());
621 } 620 }
622 621
623 } // namespace webrtc 622 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/logging/rtc_event_log/rtc_event_log.h ('k') | webrtc/logging/rtc_event_log/rtc_event_log2text.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698