| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 ++seq_num; | 200 ++seq_num; |
| 201 } | 201 } |
| 202 return true; | 202 return true; |
| 203 } | 203 } |
| 204 | 204 |
| 205 void PacketBuffer::ManageFrame(std::unique_ptr<RtpFrameObject> frame) { | 205 void PacketBuffer::ManageFrame(std::unique_ptr<RtpFrameObject> frame) { |
| 206 size_t start_index = frame->first_seq_num() % size_; | 206 size_t start_index = frame->first_seq_num() % size_; |
| 207 VideoCodecType codec_type = data_buffer_[start_index].codec; | 207 VideoCodecType codec_type = data_buffer_[start_index].codec; |
| 208 | 208 |
| 209 switch (codec_type) { | 209 switch (codec_type) { |
| 210 case kVideoCodecULPFEC : | 210 case kVideoCodecULPFEC: |
| 211 case kVideoCodecRED : | 211 case kVideoCodecRED: |
| 212 case kVideoCodecUnknown : { | 212 case kVideoCodecUnknown: |
| 213 RTC_NOTREACHED(); | 213 RTC_NOTREACHED(); |
| 214 } | 214 break; |
| 215 case kVideoCodecVP8 : { | 215 case kVideoCodecVP8: |
| 216 ManageFrameVp8(std::move(frame)); | 216 ManageFrameVp8(std::move(frame)); |
| 217 break; | 217 break; |
| 218 } | 218 case kVideoCodecVP9: |
| 219 case kVideoCodecVP9 : { | |
| 220 // TODO(philipel): ManageFrameVp9(std::move(frame)); | 219 // TODO(philipel): ManageFrameVp9(std::move(frame)); |
| 221 break; | 220 break; |
| 222 } | 221 case kVideoCodecH264: |
| 223 case kVideoCodecH264 : | 222 case kVideoCodecI420: |
| 224 case kVideoCodecI420 : | 223 case kVideoCodecGeneric: |
| 225 case kVideoCodecGeneric : | |
| 226 default : { | |
| 227 ManageFrameGeneric(std::move(frame)); | 224 ManageFrameGeneric(std::move(frame)); |
| 228 } | 225 break; |
| 229 } | 226 } |
| 230 } | 227 } |
| 231 | 228 |
| 232 void PacketBuffer::RetryStashedFrames() { | 229 void PacketBuffer::RetryStashedFrames() { |
| 233 size_t num_stashed_frames = stashed_frames_.size(); | 230 size_t num_stashed_frames = stashed_frames_.size(); |
| 234 | 231 |
| 235 // Clean up stashed frames if there are too many. | 232 // Clean up stashed frames if there are too many. |
| 236 while (stashed_frames_.size() > kMaxStashedFrames) | 233 while (stashed_frames_.size() > kMaxStashedFrames) |
| 237 stashed_frames_.pop(); | 234 stashed_frames_.pop(); |
| 238 | 235 |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 last_seq_num_gop_.clear(); | 456 last_seq_num_gop_.clear(); |
| 460 while (!stashed_frames_.empty()) | 457 while (!stashed_frames_.empty()) |
| 461 stashed_frames_.pop(); | 458 stashed_frames_.pop(); |
| 462 not_yet_received_frames_.clear(); | 459 not_yet_received_frames_.clear(); |
| 463 | 460 |
| 464 first_packet_received_ = false; | 461 first_packet_received_ = false; |
| 465 } | 462 } |
| 466 | 463 |
| 467 } // namespace video_coding | 464 } // namespace video_coding |
| 468 } // namespace webrtc | 465 } // namespace webrtc |
| OLD | NEW |