| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/cast/video_sender/video_sender.h" | 5 #include "media/cast/video_sender/video_sender.h" |
| 6 | 6 |
| 7 #include <cstring> | 7 #include <cstring> |
| 8 #include <list> | 8 #include <list> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 scoped_ptr<transport::EncodedVideoFrame> encoded_frame, | 161 scoped_ptr<transport::EncodedVideoFrame> encoded_frame, |
| 162 const base::TimeTicks& capture_time) { | 162 const base::TimeTicks& capture_time) { |
| 163 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 163 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
| 164 last_send_time_ = cast_environment_->Clock()->NowTicks(); | 164 last_send_time_ = cast_environment_->Clock()->NowTicks(); |
| 165 if (encoded_frame->key_frame) { | 165 if (encoded_frame->key_frame) { |
| 166 VLOG(1) << "Send encoded key frame; frame_id:" | 166 VLOG(1) << "Send encoded key frame; frame_id:" |
| 167 << static_cast<int>(encoded_frame->frame_id); | 167 << static_cast<int>(encoded_frame->frame_id); |
| 168 } | 168 } |
| 169 | 169 |
| 170 uint32 frame_id = encoded_frame->frame_id; | 170 uint32 frame_id = encoded_frame->frame_id; |
| 171 cast_environment_->Logging()->InsertFrameEvent(last_send_time_, | 171 cast_environment_->Logging()->InsertEncodedFrameEvent( |
| 172 kVideoFrameEncoded, | 172 last_send_time_, kVideoFrameEncoded, encoded_frame->rtp_timestamp, |
| 173 encoded_frame->rtp_timestamp, | 173 frame_id, static_cast<int>(encoded_frame->data.size()), |
| 174 frame_id); | 174 encoded_frame->key_frame); |
| 175 | 175 |
| 176 // Used by chrome/browser/extension/api/cast_streaming/performance_test.cc | 176 // Used by chrome/browser/extension/api/cast_streaming/performance_test.cc |
| 177 TRACE_EVENT_INSTANT1( | 177 TRACE_EVENT_INSTANT1( |
| 178 "cast_perf_test", "VideoFrameEncoded", | 178 "cast_perf_test", "VideoFrameEncoded", |
| 179 TRACE_EVENT_SCOPE_THREAD, | 179 TRACE_EVENT_SCOPE_THREAD, |
| 180 "rtp_timestamp", GetVideoRtpTimestamp(capture_time)); | 180 "rtp_timestamp", GetVideoRtpTimestamp(capture_time)); |
| 181 | 181 |
| 182 // Only use lowest 8 bits as key. | 182 // Only use lowest 8 bits as key. |
| 183 frame_id_to_rtp_timestamp_[frame_id & 0xff] = encoded_frame->rtp_timestamp; | 183 frame_id_to_rtp_timestamp_[frame_id & 0xff] = encoded_frame->rtp_timestamp; |
| 184 | 184 |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 459 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
| 460 MissingFramesAndPacketsMap missing_frames_and_packets; | 460 MissingFramesAndPacketsMap missing_frames_and_packets; |
| 461 PacketIdSet missing; | 461 PacketIdSet missing; |
| 462 missing_frames_and_packets.insert(std::make_pair(resend_frame_id, missing)); | 462 missing_frames_and_packets.insert(std::make_pair(resend_frame_id, missing)); |
| 463 last_send_time_ = cast_environment_->Clock()->NowTicks(); | 463 last_send_time_ = cast_environment_->Clock()->NowTicks(); |
| 464 transport_sender_->ResendPackets(false, missing_frames_and_packets); | 464 transport_sender_->ResendPackets(false, missing_frames_and_packets); |
| 465 } | 465 } |
| 466 | 466 |
| 467 } // namespace cast | 467 } // namespace cast |
| 468 } // namespace media | 468 } // namespace media |
| OLD | NEW |