OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 19 matching lines...) Expand all Loading... |
30 rtp->codecHeader.VP8.nonReference = | 30 rtp->codecHeader.VP8.nonReference = |
31 info->codecSpecific.VP8.nonReference; | 31 info->codecSpecific.VP8.nonReference; |
32 rtp->codecHeader.VP8.temporalIdx = info->codecSpecific.VP8.temporalIdx; | 32 rtp->codecHeader.VP8.temporalIdx = info->codecSpecific.VP8.temporalIdx; |
33 rtp->codecHeader.VP8.layerSync = info->codecSpecific.VP8.layerSync; | 33 rtp->codecHeader.VP8.layerSync = info->codecSpecific.VP8.layerSync; |
34 rtp->codecHeader.VP8.tl0PicIdx = info->codecSpecific.VP8.tl0PicIdx; | 34 rtp->codecHeader.VP8.tl0PicIdx = info->codecSpecific.VP8.tl0PicIdx; |
35 rtp->codecHeader.VP8.keyIdx = info->codecSpecific.VP8.keyIdx; | 35 rtp->codecHeader.VP8.keyIdx = info->codecSpecific.VP8.keyIdx; |
36 rtp->simulcastIdx = info->codecSpecific.VP8.simulcastIdx; | 36 rtp->simulcastIdx = info->codecSpecific.VP8.simulcastIdx; |
37 return; | 37 return; |
38 } | 38 } |
39 case kVideoCodecVP9: { | 39 case kVideoCodecVP9: { |
| 40 RTPVideoHeaderVP9& vp9toHdr = rtp->codecHeader.VP9; |
| 41 const CodecSpecificInfoVP9& vp9fromHdr = info->codecSpecific.VP9; |
| 42 |
40 rtp->codec = kRtpVideoVp9; | 43 rtp->codec = kRtpVideoVp9; |
41 rtp->codecHeader.VP9.InitRTPVideoHeaderVP9(); | 44 vp9toHdr.InitRTPVideoHeaderVP9(); |
42 rtp->codecHeader.VP9.inter_pic_predicted = | 45 vp9toHdr.inter_pic_predicted = vp9fromHdr.inter_pic_predicted; |
43 info->codecSpecific.VP9.inter_pic_predicted; | 46 vp9toHdr.flexible_mode = vp9fromHdr.flexible_mode; |
44 rtp->codecHeader.VP9.flexible_mode = | 47 vp9toHdr.ss_data_available = vp9fromHdr.ss_data_available; |
45 info->codecSpecific.VP9.flexible_mode; | 48 vp9toHdr.picture_id = vp9fromHdr.picture_id; |
46 rtp->codecHeader.VP9.ss_data_available = | 49 vp9toHdr.tl0_pic_idx = vp9fromHdr.tl0_pic_idx; |
47 info->codecSpecific.VP9.ss_data_available; | 50 vp9toHdr.temporal_idx = vp9fromHdr.temporal_idx; |
48 rtp->codecHeader.VP9.picture_id = info->codecSpecific.VP9.picture_id; | 51 vp9toHdr.spatial_idx = vp9fromHdr.spatial_idx; |
49 rtp->codecHeader.VP9.tl0_pic_idx = info->codecSpecific.VP9.tl0_pic_idx; | 52 vp9toHdr.temporal_up_switch = vp9fromHdr.temporal_up_switch; |
50 rtp->codecHeader.VP9.temporal_idx = info->codecSpecific.VP9.temporal_idx; | 53 vp9toHdr.inter_layer_predicted = vp9fromHdr.inter_layer_predicted; |
51 rtp->codecHeader.VP9.spatial_idx = info->codecSpecific.VP9.spatial_idx; | 54 vp9toHdr.gof_idx = vp9fromHdr.gof_idx; |
52 rtp->codecHeader.VP9.temporal_up_switch = | 55 vp9toHdr.num_spatial_layers = vp9fromHdr.num_spatial_layers; |
53 info->codecSpecific.VP9.temporal_up_switch; | |
54 rtp->codecHeader.VP9.inter_layer_predicted = | |
55 info->codecSpecific.VP9.inter_layer_predicted; | |
56 rtp->codecHeader.VP9.gof_idx = info->codecSpecific.VP9.gof_idx; | |
57 | 56 |
58 // Packetizer needs to know the number of spatial layers to correctly set | 57 if (vp9fromHdr.ss_data_available) { |
59 // the marker bit, even when the number won't be written in the packet. | 58 vp9toHdr.spatial_layer_resolution_present = |
60 rtp->codecHeader.VP9.num_spatial_layers = | 59 vp9fromHdr.spatial_layer_resolution_present; |
61 info->codecSpecific.VP9.num_spatial_layers; | 60 if (vp9fromHdr.spatial_layer_resolution_present) { |
62 if (info->codecSpecific.VP9.ss_data_available) { | 61 for (size_t i = 0; i < vp9fromHdr.num_spatial_layers; ++i) { |
63 rtp->codecHeader.VP9.spatial_layer_resolution_present = | 62 vp9toHdr.width[i] = vp9fromHdr.width[i]; |
64 info->codecSpecific.VP9.spatial_layer_resolution_present; | 63 vp9toHdr.height[i] = vp9fromHdr.height[i]; |
65 if (info->codecSpecific.VP9.spatial_layer_resolution_present) { | |
66 for (size_t i = 0; i < info->codecSpecific.VP9.num_spatial_layers; | |
67 ++i) { | |
68 rtp->codecHeader.VP9.width[i] = info->codecSpecific.VP9.width[i]; | |
69 rtp->codecHeader.VP9.height[i] = info->codecSpecific.VP9.height[i]; | |
70 } | 64 } |
71 } | 65 } |
72 rtp->codecHeader.VP9.gof.CopyGofInfoVP9(info->codecSpecific.VP9.gof); | 66 vp9toHdr.gof.CopyGofInfoVP9(vp9fromHdr.gof); |
73 } | 67 } |
| 68 |
| 69 vp9toHdr.num_ref_pics = vp9fromHdr.num_ref_pics; |
| 70 for (int i = 0; i < vp9fromHdr.num_ref_pics; ++i) |
| 71 vp9toHdr.pid_diff[i] = vp9fromHdr.p_diff[i]; |
74 return; | 72 return; |
75 } | 73 } |
76 case kVideoCodecH264: | 74 case kVideoCodecH264: |
77 rtp->codec = kRtpVideoH264; | 75 rtp->codec = kRtpVideoH264; |
78 return; | 76 return; |
79 case kVideoCodecGeneric: | 77 case kVideoCodecGeneric: |
80 rtp->codec = kRtpVideoGeneric; | 78 rtp->codec = kRtpVideoGeneric; |
81 rtp->simulcastIdx = info->codecSpecific.generic.simulcast_idx; | 79 rtp->simulcastIdx = info->codecSpecific.generic.simulcast_idx; |
82 return; | 80 return; |
83 default: | 81 default: |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 } | 328 } |
331 | 329 |
332 void | 330 void |
333 VCMEncodedFrameCallback::SetMediaOpt( | 331 VCMEncodedFrameCallback::SetMediaOpt( |
334 media_optimization::MediaOptimization *mediaOpt) | 332 media_optimization::MediaOptimization *mediaOpt) |
335 { | 333 { |
336 _mediaOpt = mediaOpt; | 334 _mediaOpt = mediaOpt; |
337 } | 335 } |
338 | 336 |
339 } // namespace webrtc | 337 } // namespace webrtc |
OLD | NEW |