| 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 16 matching lines...) Expand all Loading... |
| 27 uint16_t last_seq_num, | 27 uint16_t last_seq_num, |
| 28 size_t frame_size, | 28 size_t frame_size, |
| 29 int times_nacked) | 29 int times_nacked) |
| 30 : packet_buffer_(packet_buffer), | 30 : packet_buffer_(packet_buffer), |
| 31 first_seq_num_(first_seq_num), | 31 first_seq_num_(first_seq_num), |
| 32 last_seq_num_(last_seq_num), | 32 last_seq_num_(last_seq_num), |
| 33 times_nacked_(times_nacked) { | 33 times_nacked_(times_nacked) { |
| 34 size = frame_size; | 34 size = frame_size; |
| 35 VCMPacket* packet = packet_buffer_->GetPacket(first_seq_num); | 35 VCMPacket* packet = packet_buffer_->GetPacket(first_seq_num); |
| 36 if (packet) { | 36 if (packet) { |
| 37 // TODO(philipel): Remove when encoded image is replaced by FrameObject. |
| 38 // VCMEncodedFrame members |
| 39 CopyCodecSpecific(&packet->video_header); |
| 40 _completeFrame = true; |
| 41 _payloadType = packet->payloadType; |
| 42 _timeStamp = packet->timestamp; |
| 43 ntp_time_ms_ = packet->ntp_time_ms_; |
| 44 _buffer = new uint8_t[frame_size](); |
| 45 _size = frame_size; |
| 46 _length = frame_size; |
| 47 _frameType = packet->frameType; |
| 48 GetBitstream(_buffer); |
| 49 |
| 50 // RtpFrameObject members |
| 37 frame_type_ = packet->frameType; | 51 frame_type_ = packet->frameType; |
| 38 codec_type_ = packet->codec; | 52 codec_type_ = packet->codec; |
| 53 |
| 54 // FrameObject members |
| 55 timestamp = packet->timestamp; |
| 39 } | 56 } |
| 40 } | 57 } |
| 41 | 58 |
| 42 RtpFrameObject::~RtpFrameObject() { | 59 RtpFrameObject::~RtpFrameObject() { |
| 43 packet_buffer_->ReturnFrame(this); | 60 packet_buffer_->ReturnFrame(this); |
| 44 } | 61 } |
| 45 | 62 |
| 46 uint16_t RtpFrameObject::first_seq_num() const { | 63 uint16_t RtpFrameObject::first_seq_num() const { |
| 47 return first_seq_num_; | 64 return first_seq_num_; |
| 48 } | 65 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 69 | 86 |
| 70 RTPVideoTypeHeader* RtpFrameObject::GetCodecHeader() const { | 87 RTPVideoTypeHeader* RtpFrameObject::GetCodecHeader() const { |
| 71 VCMPacket* packet = packet_buffer_->GetPacket(first_seq_num_); | 88 VCMPacket* packet = packet_buffer_->GetPacket(first_seq_num_); |
| 72 if (!packet) | 89 if (!packet) |
| 73 return nullptr; | 90 return nullptr; |
| 74 return &packet->video_header.codecHeader; | 91 return &packet->video_header.codecHeader; |
| 75 } | 92 } |
| 76 | 93 |
| 77 } // namespace video_coding | 94 } // namespace video_coding |
| 78 } // namespace webrtc | 95 } // namespace webrtc |
| OLD | NEW |