RtpFrameObject::GetCodecHeader now return rtc::Optional<RTPVideoTypeHeader>

Since it is unsafe to hand out a pointer to a packet that might be removed/
overwritten at any time we now return a copy of the header if it exist.

BUG=webrtc:5514

Review-Url: https://codereview.webrtc.org/2468183002
Cr-Commit-Position: refs/heads/master@{#14920}
This commit is contained in:
philipel
2016-11-03 08:56:54 -07:00
committed by Commit bot
parent 0a4c1616bf
commit 8848828708
3 changed files with 9 additions and 8 deletions

View File

@ -11,6 +11,7 @@
#ifndef WEBRTC_MODULES_VIDEO_CODING_FRAME_OBJECT_H_
#define WEBRTC_MODULES_VIDEO_CODING_FRAME_OBJECT_H_
#include "webrtc/base/optional.h"
#include "webrtc/common_types.h"
#include "webrtc/modules/include/module_common_types.h"
#include "webrtc/modules/video_coding/encoded_frame.h"
@ -71,7 +72,7 @@ class RtpFrameObject : public FrameObject {
uint32_t Timestamp() const override;
int64_t ReceivedTime() const override;
int64_t RenderTime() const override;
RTPVideoTypeHeader* GetCodecHeader() const;
rtc::Optional<RTPVideoTypeHeader> GetCodecHeader() const;
private:
rtc::scoped_refptr<PacketBuffer> packet_buffer_;