OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 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 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1105 info.codecSpecific.VP9.gof_idx = | 1105 info.codecSpecific.VP9.gof_idx = |
1106 static_cast<uint8_t>(gof_idx_++ % gof_.num_frames_in_gof); | 1106 static_cast<uint8_t>(gof_idx_++ % gof_.num_frames_in_gof); |
1107 info.codecSpecific.VP9.num_spatial_layers = 1; | 1107 info.codecSpecific.VP9.num_spatial_layers = 1; |
1108 info.codecSpecific.VP9.spatial_layer_resolution_present = false; | 1108 info.codecSpecific.VP9.spatial_layer_resolution_present = false; |
1109 if (info.codecSpecific.VP9.ss_data_available) { | 1109 if (info.codecSpecific.VP9.ss_data_available) { |
1110 info.codecSpecific.VP9.spatial_layer_resolution_present = true; | 1110 info.codecSpecific.VP9.spatial_layer_resolution_present = true; |
1111 info.codecSpecific.VP9.width[0] = width_; | 1111 info.codecSpecific.VP9.width[0] = width_; |
1112 info.codecSpecific.VP9.height[0] = height_; | 1112 info.codecSpecific.VP9.height[0] = height_; |
1113 info.codecSpecific.VP9.gof.CopyGofInfoVP9(gof_); | 1113 info.codecSpecific.VP9.gof.CopyGofInfoVP9(gof_); |
1114 } | 1114 } |
| 1115 } else if (codecType_ == kVideoCodecH264) { |
| 1116 info.codecSpecific.H264.packetization_mode = |
| 1117 webrtc::kH264PacketizationMode1; |
1115 } | 1118 } |
1116 picture_id_ = (picture_id_ + 1) & 0x7FFF; | 1119 picture_id_ = (picture_id_ + 1) & 0x7FFF; |
1117 | 1120 |
1118 // Generate a header describing a single fragment. | 1121 // Generate a header describing a single fragment. |
1119 webrtc::RTPFragmentationHeader header; | 1122 webrtc::RTPFragmentationHeader header; |
1120 memset(&header, 0, sizeof(header)); | 1123 memset(&header, 0, sizeof(header)); |
1121 if (codecType_ == kVideoCodecVP8 || codecType_ == kVideoCodecVP9) { | 1124 if (codecType_ == kVideoCodecVP8 || codecType_ == kVideoCodecVP9) { |
1122 header.VerifyAndAllocateFragmentationHeader(1); | 1125 header.VerifyAndAllocateFragmentationHeader(1); |
1123 header.fragmentationOffset[0] = 0; | 1126 header.fragmentationOffset[0] = 0; |
1124 header.fragmentationLength[0] = image->_length; | 1127 header.fragmentationLength[0] = image->_length; |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1371 return supported_codecs_; | 1374 return supported_codecs_; |
1372 } | 1375 } |
1373 | 1376 |
1374 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( | 1377 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( |
1375 webrtc::VideoEncoder* encoder) { | 1378 webrtc::VideoEncoder* encoder) { |
1376 ALOGD << "Destroy video encoder."; | 1379 ALOGD << "Destroy video encoder."; |
1377 delete encoder; | 1380 delete encoder; |
1378 } | 1381 } |
1379 | 1382 |
1380 } // namespace webrtc_jni | 1383 } // namespace webrtc_jni |
OLD | NEW |