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-Original-Commit-Position: refs/heads/master@{#14920}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: 88488287086bfada4c4cfe9b1119a4459b359b9d
diff --git a/modules/video_coding/frame_object.h b/modules/video_coding/frame_object.h
index 5427972..915224e 100644
--- a/modules/video_coding/frame_object.h
+++ b/modules/video_coding/frame_object.h
@@ -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 @@
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_;