
Changes include, 1) Introduce class RtpPacketizerGeneric & RtpDePacketizerGeneric. 2) Introduce class RtpDepacketizerVp8. 3) Make RTPSenderVideo::SendH264 generic and used by all packetizers. 4) Move codec specific functions from RTPSenderVideo/RTPReceiverVideo to RtpPacketizer/RtpDePacketizer sub-classes. R=pbos@webrtc.org, stefan@webrtc.org Review URL: https://webrtc-codereview.appspot.com/26399004 Patch from Changbin Shao <changbin.shao@intel.com>. git-svn-id: http://webrtc.googlecode.com/svn/trunk@7163 4adac7df-926f-26a2-2b94-8c16560cd09d
51 lines
1.8 KiB
C++
51 lines
1.8 KiB
C++
/*
|
|
* Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
|
|
#include "webrtc/modules/rtp_rtcp/source/rtp_format.h"
|
|
|
|
#include "webrtc/modules/rtp_rtcp/source/rtp_format_h264.h"
|
|
#include "webrtc/modules/rtp_rtcp/source/rtp_format_video_generic.h"
|
|
#include "webrtc/modules/rtp_rtcp/source/rtp_format_vp8.h"
|
|
|
|
namespace webrtc {
|
|
RtpPacketizer* RtpPacketizer::Create(RtpVideoCodecTypes type,
|
|
size_t max_payload_len,
|
|
const RTPVideoTypeHeader* rtp_type_header,
|
|
FrameType frame_type) {
|
|
switch (type) {
|
|
case kRtpVideoH264:
|
|
return new RtpPacketizerH264(frame_type, max_payload_len);
|
|
case kRtpVideoVp8:
|
|
assert(rtp_type_header != NULL);
|
|
return new RtpPacketizerVp8(rtp_type_header->VP8, max_payload_len);
|
|
case kRtpVideoGeneric:
|
|
return new RtpPacketizerGeneric(frame_type, max_payload_len);
|
|
case kRtpVideoNone:
|
|
assert(false);
|
|
}
|
|
return NULL;
|
|
}
|
|
|
|
RtpDepacketizer* RtpDepacketizer::Create(RtpVideoCodecTypes type,
|
|
RtpData* const callback) {
|
|
switch (type) {
|
|
case kRtpVideoH264:
|
|
return new RtpDepacketizerH264(callback);
|
|
case kRtpVideoVp8:
|
|
return new RtpDepacketizerVp8(callback);
|
|
case kRtpVideoGeneric:
|
|
return new RtpDepacketizerGeneric(callback);
|
|
case kRtpVideoNone:
|
|
assert(false);
|
|
}
|
|
return NULL;
|
|
}
|
|
} // namespace webrtc
|