#include <string.h>
#include "webrtc/modules/video_coding/main/source/packet.h"
+#include "webrtc/system_wrappers/interface/logging.h"
namespace webrtc {
int64_t timeInMs,
VCMDecodeErrorMode decode_error_mode,
const FrameData& frame_data) {
- // Is this packet part of this frame?
- if (TimeStamp() && (TimeStamp() != packet.timestamp)) {
- return kTimeStampError;
- }
-
- // sanity checks
- if (_size + packet.sizeBytes +
- (packet.insertStartCode ? kH264StartCodeLengthBytes : 0 )
- > kMaxJBFrameSizeBytes) {
- return kSizeError;
- }
- if (NULL == packet.dataPtr && packet.sizeBytes > 0) {
- return kSizeError;
- }
+ assert(!(NULL == packet.dataPtr && packet.sizeBytes > 0));
if (packet.dataPtr != NULL) {
_payloadType = packet.payloadType;
}
// First packet (empty and/or media) inserted into this frame.
// store some info and set some initial values.
_timeStamp = packet.timestamp;
+ // We only take the ntp timestamp of the first packet of a frame.
+ ntp_time_ms_ = packet.ntp_time_ms_;
_codec = packet.codec;
if (packet.frameType != kFrameEmpty) {
// first media packet
const uint32_t newSize = _size +
increments * kBufferIncStepSizeBytes;
if (newSize > kMaxJBFrameSizeBytes) {
+ LOG(LS_ERROR) << "Failed to insert packet due to frame being too "
+ "big.";
return kSizeError;
}
- if (VerifyAndAllocate(newSize) == -1) {
- return kSizeError;
- }
+ VerifyAndAllocate(newSize);
_sessionInfo.UpdateDataPointers(prevBuffer, _buffer);
}