OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 |
| 11 #include <memory> |
| 12 #include <utility> |
| 13 |
11 #include "webrtc/modules/rtp_rtcp/source/rtp_format.h" | 14 #include "webrtc/modules/rtp_rtcp/source/rtp_format.h" |
12 | 15 |
13 #include "webrtc/modules/rtp_rtcp/source/rtp_format_h264.h" | 16 #include "webrtc/modules/rtp_rtcp/source/rtp_format_h264.h" |
14 #include "webrtc/modules/rtp_rtcp/source/rtp_format_video_generic.h" | 17 #include "webrtc/modules/rtp_rtcp/source/rtp_format_video_generic.h" |
15 #include "webrtc/modules/rtp_rtcp/source/rtp_format_vp8.h" | 18 #include "webrtc/modules/rtp_rtcp/source/rtp_format_vp8.h" |
16 #include "webrtc/modules/rtp_rtcp/source/rtp_format_vp9.h" | 19 #include "webrtc/modules/rtp_rtcp/source/rtp_format_vp9.h" |
17 | 20 |
18 namespace webrtc { | 21 namespace webrtc { |
19 RtpPacketizer* RtpPacketizer::Create(RtpVideoCodecTypes type, | 22 RtpPacketizer* RtpPacketizer::Create(RtpVideoCodecTypes type, |
20 size_t max_payload_len, | 23 size_t max_payload_len, |
21 const RTPVideoTypeHeader* rtp_type_header, | 24 const RTPVideoTypeHeader* rtp_type_header, |
22 FrameType frame_type) { | 25 FrameType frame_type) { |
23 switch (type) { | 26 switch (type) { |
24 case kRtpVideoH264: | 27 case kRtpVideoH264: |
25 return new RtpPacketizerH264(frame_type, max_payload_len); | 28 assert(rtp_type_header != NULL); |
| 29 return new RtpPacketizerH264(rtp_type_header->H264, max_payload_len); |
26 case kRtpVideoVp8: | 30 case kRtpVideoVp8: |
27 assert(rtp_type_header != NULL); | 31 assert(rtp_type_header != NULL); |
28 return new RtpPacketizerVp8(rtp_type_header->VP8, max_payload_len); | 32 return new RtpPacketizerVp8(rtp_type_header->VP8, max_payload_len); |
29 case kRtpVideoVp9: | 33 case kRtpVideoVp9: |
30 assert(rtp_type_header != NULL); | 34 assert(rtp_type_header != NULL); |
31 return new RtpPacketizerVp9(rtp_type_header->VP9, max_payload_len); | 35 return new RtpPacketizerVp9(rtp_type_header->VP9, max_payload_len); |
32 case kRtpVideoGeneric: | 36 case kRtpVideoGeneric: |
33 return new RtpPacketizerGeneric(frame_type, max_payload_len); | 37 return new RtpPacketizerGeneric(frame_type, max_payload_len); |
34 case kRtpVideoNone: | 38 case kRtpVideoNone: |
35 assert(false); | 39 assert(false); |
(...skipping 10 matching lines...) Expand all Loading... |
46 case kRtpVideoVp9: | 50 case kRtpVideoVp9: |
47 return new RtpDepacketizerVp9(); | 51 return new RtpDepacketizerVp9(); |
48 case kRtpVideoGeneric: | 52 case kRtpVideoGeneric: |
49 return new RtpDepacketizerGeneric(); | 53 return new RtpDepacketizerGeneric(); |
50 case kRtpVideoNone: | 54 case kRtpVideoNone: |
51 assert(false); | 55 assert(false); |
52 } | 56 } |
53 return NULL; | 57 return NULL; |
54 } | 58 } |
55 } // namespace webrtc | 59 } // namespace webrtc |
OLD | NEW |