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}
This commit is contained in:
philipel
2016-07-04 16:18:55 +02:00
parent 14d5dbe5b3
commit 552866c402
2 changed files with 21 additions and 3 deletions

View File

@ -34,8 +34,25 @@ RtpFrameObject::RtpFrameObject(PacketBuffer* packet_buffer,
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;
}
}

View File

@ -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 @@ class RtpFrameObject : public FrameObject {
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_;