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 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
741 if (!ParseSsData(&parser, vp9)) { | 741 if (!ParseSsData(&parser, vp9)) { |
742 LOG(LS_ERROR) << "Failed parsing VP9 SS data."; | 742 LOG(LS_ERROR) << "Failed parsing VP9 SS data."; |
743 return false; | 743 return false; |
744 } | 744 } |
745 if (vp9->spatial_layer_resolution_present) { | 745 if (vp9->spatial_layer_resolution_present) { |
746 // TODO(asapersson): Add support for spatial layers. | 746 // TODO(asapersson): Add support for spatial layers. |
747 parsed_payload->type.Video.width = vp9->width[0]; | 747 parsed_payload->type.Video.width = vp9->width[0]; |
748 parsed_payload->type.Video.height = vp9->height[0]; | 748 parsed_payload->type.Video.height = vp9->height[0]; |
749 } | 749 } |
750 } | 750 } |
751 parsed_payload->type.Video.isFirstPacket = b_bit && (vp9->spatial_idx == 0); | 751 parsed_payload->type.Video.isFirstPacket = |
752 b_bit && (!l_bit || !vp9->inter_layer_predicted); | |
stefan-webrtc
2015/10/28 13:59:04
Add a test for this
philipel1
2015/10/29 14:49:26
Hmm... if I add a function to test this we either
| |
752 | 753 |
753 uint64_t rem_bits = parser.RemainingBitCount(); | 754 uint64_t rem_bits = parser.RemainingBitCount(); |
754 assert(rem_bits % 8 == 0); | 755 assert(rem_bits % 8 == 0); |
755 parsed_payload->payload_length = rem_bits / 8; | 756 parsed_payload->payload_length = rem_bits / 8; |
756 if (parsed_payload->payload_length == 0) { | 757 if (parsed_payload->payload_length == 0) { |
757 LOG(LS_ERROR) << "Failed parsing VP9 payload data."; | 758 LOG(LS_ERROR) << "Failed parsing VP9 payload data."; |
758 return false; | 759 return false; |
759 } | 760 } |
760 parsed_payload->payload = | 761 parsed_payload->payload = |
761 payload + payload_length - parsed_payload->payload_length; | 762 payload + payload_length - parsed_payload->payload_length; |
762 | 763 |
763 return true; | 764 return true; |
764 } | 765 } |
765 } // namespace webrtc | 766 } // namespace webrtc |
OLD | NEW |