FrameObject inherit from VCMEncodedFrame.
Let the FrameObject class inherit from VCMEncodedFrame since the rest of the
decoding pipeline use VCMEncodedFrame.
BUG=webrtc:5514
R=stefan@webrtc.org
Review URL: https://codereview.webrtc.org/2110543005 .
Cr-Commit-Position: refs/heads/master@{#13380}
diff --git a/webrtc/modules/video_coding/frame_object.cc b/webrtc/modules/video_coding/frame_object.cc
index b46f816..c33fdf7 100644
--- a/webrtc/modules/video_coding/frame_object.cc
+++ b/webrtc/modules/video_coding/frame_object.cc
@@ -34,8 +34,25 @@
size = frame_size;
VCMPacket* packet = packet_buffer_->GetPacket(first_seq_num);
if (packet) {
+ // TODO(philipel): Remove when encoded image is replaced by FrameObject.
+ // VCMEncodedFrame members
+ CopyCodecSpecific(&packet->video_header);
+ _completeFrame = true;
+ _payloadType = packet->payloadType;
+ _timeStamp = packet->timestamp;
+ ntp_time_ms_ = packet->ntp_time_ms_;
+ _buffer = new uint8_t[frame_size]();
+ _size = frame_size;
+ _length = frame_size;
+ _frameType = packet->frameType;
+ GetBitstream(_buffer);
+
+ // RtpFrameObject members
frame_type_ = packet->frameType;
codec_type_ = packet->codec;
+
+ // FrameObject members
+ timestamp = packet->timestamp;
}
}
diff --git a/webrtc/modules/video_coding/frame_object.h b/webrtc/modules/video_coding/frame_object.h
index 02d7342..b0d0d12 100644
--- a/webrtc/modules/video_coding/frame_object.h
+++ b/webrtc/modules/video_coding/frame_object.h
@@ -13,11 +13,12 @@
#include "webrtc/common_types.h"
#include "webrtc/modules/include/module_common_types.h"
+#include "webrtc/modules/video_coding/encoded_frame.h"
namespace webrtc {
namespace video_coding {
-class FrameObject {
+class FrameObject : public webrtc::VCMEncodedFrame {
public:
static const uint8_t kMaxFrameReferences = 5;
@@ -54,14 +55,14 @@
uint16_t first_seq_num() const;
uint16_t last_seq_num() const;
int times_nacked() const;
- FrameType frame_type() const;
+ enum FrameType frame_type() const;
VideoCodecType codec_type() const;
bool GetBitstream(uint8_t* destination) const override;
RTPVideoTypeHeader* GetCodecHeader() const;
private:
PacketBuffer* packet_buffer_;
- FrameType frame_type_;
+ enum FrameType frame_type_;
VideoCodecType codec_type_;
uint16_t first_seq_num_;
uint16_t last_seq_num_;