OLD | NEW |
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 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 } | 636 } |
637 | 637 |
638 bool RtpPacketizerVp9::WriteHeader(const PacketInfo& packet_info, | 638 bool RtpPacketizerVp9::WriteHeader(const PacketInfo& packet_info, |
639 uint8_t* buffer, | 639 uint8_t* buffer, |
640 size_t* header_length) const { | 640 size_t* header_length) const { |
641 // Required payload descriptor byte. | 641 // Required payload descriptor byte. |
642 bool i_bit = PictureIdPresent(hdr_); | 642 bool i_bit = PictureIdPresent(hdr_); |
643 bool p_bit = hdr_.inter_pic_predicted; | 643 bool p_bit = hdr_.inter_pic_predicted; |
644 bool l_bit = LayerInfoPresent(hdr_); | 644 bool l_bit = LayerInfoPresent(hdr_); |
645 bool f_bit = hdr_.flexible_mode; | 645 bool f_bit = hdr_.flexible_mode; |
646 bool b_bit = hdr_.beginning_of_frame && packet_info.layer_begin; | 646 bool b_bit = packet_info.layer_begin; |
647 bool e_bit = hdr_.end_of_frame && packet_info.layer_end; | 647 bool e_bit = packet_info.layer_end; |
648 bool v_bit = hdr_.ss_data_available && b_bit; | 648 bool v_bit = hdr_.ss_data_available && b_bit; |
649 | 649 |
650 rtc::BitBufferWriter writer(buffer, max_payload_length_); | 650 rtc::BitBufferWriter writer(buffer, max_payload_length_); |
651 RETURN_FALSE_ON_ERROR(writer.WriteBits(i_bit ? 1 : 0, 1)); | 651 RETURN_FALSE_ON_ERROR(writer.WriteBits(i_bit ? 1 : 0, 1)); |
652 RETURN_FALSE_ON_ERROR(writer.WriteBits(p_bit ? 1 : 0, 1)); | 652 RETURN_FALSE_ON_ERROR(writer.WriteBits(p_bit ? 1 : 0, 1)); |
653 RETURN_FALSE_ON_ERROR(writer.WriteBits(l_bit ? 1 : 0, 1)); | 653 RETURN_FALSE_ON_ERROR(writer.WriteBits(l_bit ? 1 : 0, 1)); |
654 RETURN_FALSE_ON_ERROR(writer.WriteBits(f_bit ? 1 : 0, 1)); | 654 RETURN_FALSE_ON_ERROR(writer.WriteBits(f_bit ? 1 : 0, 1)); |
655 RETURN_FALSE_ON_ERROR(writer.WriteBits(b_bit ? 1 : 0, 1)); | 655 RETURN_FALSE_ON_ERROR(writer.WriteBits(b_bit ? 1 : 0, 1)); |
656 RETURN_FALSE_ON_ERROR(writer.WriteBits(e_bit ? 1 : 0, 1)); | 656 RETURN_FALSE_ON_ERROR(writer.WriteBits(e_bit ? 1 : 0, 1)); |
657 RETURN_FALSE_ON_ERROR(writer.WriteBits(v_bit ? 1 : 0, 1)); | 657 RETURN_FALSE_ON_ERROR(writer.WriteBits(v_bit ? 1 : 0, 1)); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 if (parsed_payload->payload_length == 0) { | 755 if (parsed_payload->payload_length == 0) { |
756 LOG(LS_ERROR) << "Failed parsing VP9 payload data."; | 756 LOG(LS_ERROR) << "Failed parsing VP9 payload data."; |
757 return false; | 757 return false; |
758 } | 758 } |
759 parsed_payload->payload = | 759 parsed_payload->payload = |
760 payload + payload_length - parsed_payload->payload_length; | 760 payload + payload_length - parsed_payload->payload_length; |
761 | 761 |
762 return true; | 762 return true; |
763 } | 763 } |
764 } // namespace webrtc | 764 } // namespace webrtc |
OLD | NEW |