Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Side by Side Diff: modules/rtp_rtcp/source/rtp_format.cc

Issue 2951033003: [EXPERIMENTAL] Generic stereo codec with index header sending single frames
Patch Set: Rebase and add external codec support. Created 3 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "modules/rtp_rtcp/source/rtp_format.h" 11 #include "modules/rtp_rtcp/source/rtp_format.h"
12 12
13 #include <utility> 13 #include <utility>
14 14
15 #include "modules/rtp_rtcp/source/rtp_format_h264.h" 15 #include "modules/rtp_rtcp/source/rtp_format_h264.h"
16 #include "modules/rtp_rtcp/source/rtp_format_video_generic.h" 16 #include "modules/rtp_rtcp/source/rtp_format_video_generic.h"
17 #include "modules/rtp_rtcp/source/rtp_format_video_stereo.h"
17 #include "modules/rtp_rtcp/source/rtp_format_vp8.h" 18 #include "modules/rtp_rtcp/source/rtp_format_vp8.h"
18 #include "modules/rtp_rtcp/source/rtp_format_vp9.h" 19 #include "modules/rtp_rtcp/source/rtp_format_vp9.h"
20 #include "rtc_base/logging.h"
19 21
20 namespace webrtc { 22 namespace webrtc {
21 RtpPacketizer* RtpPacketizer::Create(RtpVideoCodecTypes type, 23 RtpPacketizer* RtpPacketizer::Create(RtpVideoCodecTypes type,
22 size_t max_payload_len, 24 size_t max_payload_len,
23 size_t last_packet_reduction_len, 25 size_t last_packet_reduction_len,
24 const RTPVideoTypeHeader* rtp_type_header, 26 const RTPVideoTypeHeader* rtp_type_header,
27 const RTPVideoStereoInfo* stereoInfo,
25 FrameType frame_type) { 28 FrameType frame_type) {
26 switch (type) { 29 switch (type) {
27 case kRtpVideoH264: 30 case kRtpVideoH264:
28 RTC_CHECK(rtp_type_header); 31 RTC_CHECK(rtp_type_header);
29 return new RtpPacketizerH264(max_payload_len, last_packet_reduction_len, 32 return new RtpPacketizerH264(max_payload_len, last_packet_reduction_len,
30 rtp_type_header->H264.packetization_mode); 33 rtp_type_header->H264.packetization_mode);
31 case kRtpVideoVp8: 34 case kRtpVideoVp8:
32 RTC_CHECK(rtp_type_header); 35 RTC_CHECK(rtp_type_header);
33 return new RtpPacketizerVp8(rtp_type_header->VP8, max_payload_len, 36 return new RtpPacketizerVp8(rtp_type_header->VP8, max_payload_len,
34 last_packet_reduction_len); 37 last_packet_reduction_len);
35 case kRtpVideoVp9: 38 case kRtpVideoVp9:
36 RTC_CHECK(rtp_type_header); 39 RTC_CHECK(rtp_type_header);
37 return new RtpPacketizerVp9(rtp_type_header->VP9, max_payload_len, 40 return new RtpPacketizerVp9(rtp_type_header->VP9, max_payload_len,
38 last_packet_reduction_len); 41 last_packet_reduction_len);
39 case kRtpVideoGeneric: 42 case kRtpVideoGeneric:
40 return new RtpPacketizerGeneric(frame_type, max_payload_len, 43 return new RtpPacketizerGeneric(frame_type, max_payload_len,
41 last_packet_reduction_len); 44 last_packet_reduction_len);
45 case kRtpVideoStereo:
46 return new RtpPacketizerStereo(max_payload_len, last_packet_reduction_len,
47 rtp_type_header, stereoInfo);
42 case kRtpVideoNone: 48 case kRtpVideoNone:
43 RTC_NOTREACHED(); 49 RTC_NOTREACHED();
44 } 50 }
45 return nullptr; 51 return nullptr;
46 } 52 }
47 53
48 RtpDepacketizer* RtpDepacketizer::Create(RtpVideoCodecTypes type) { 54 RtpDepacketizer* RtpDepacketizer::Create(RtpVideoCodecTypes type) {
49 switch (type) { 55 switch (type) {
50 case kRtpVideoH264: 56 case kRtpVideoH264:
51 return new RtpDepacketizerH264(); 57 return new RtpDepacketizerH264();
52 case kRtpVideoVp8: 58 case kRtpVideoVp8:
53 return new RtpDepacketizerVp8(); 59 return new RtpDepacketizerVp8();
54 case kRtpVideoVp9: 60 case kRtpVideoVp9:
55 return new RtpDepacketizerVp9(); 61 return new RtpDepacketizerVp9();
56 case kRtpVideoGeneric: 62 case kRtpVideoGeneric:
57 return new RtpDepacketizerGeneric(); 63 return new RtpDepacketizerGeneric();
64 case kRtpVideoStereo:
65 return new RtpDepacketizerStereo();
58 case kRtpVideoNone: 66 case kRtpVideoNone:
59 assert(false); 67 assert(false);
60 } 68 }
61 return nullptr; 69 return nullptr;
62 } 70 }
63 } // namespace webrtc 71 } // namespace webrtc
OLDNEW
« no previous file with comments | « modules/rtp_rtcp/source/rtp_format.h ('k') | modules/rtp_rtcp/source/rtp_format_h264_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698