Fixing a number of issues in VCM and codec tests
Issues come from previous change to routing of CodecSpecificInfo. A few tests are asserted out, and will be until the corresponding routing has been made on the decoder side. Review URL: http://webrtc-codereview.appspot.com/60007 git-svn-id: http://webrtc.googlecode.com/svn/trunk@184 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
12c9df1a69
commit
edac1733e2
@ -176,8 +176,6 @@ FrameQueueTuple::~FrameQueueTuple()
|
||||
{
|
||||
if (_codecSpecificInfo != NULL)
|
||||
{
|
||||
// TODO(holmer): implement virtual function for deleting this and
|
||||
// remove warnings
|
||||
delete _codecSpecificInfo;
|
||||
}
|
||||
if (_frame != NULL)
|
||||
@ -187,7 +185,7 @@ FrameQueueTuple::~FrameQueueTuple()
|
||||
}
|
||||
|
||||
void FrameQueue::PushFrame(TestVideoEncodedBuffer *frame,
|
||||
void* codecSpecificInfo)
|
||||
webrtc::CodecSpecificInfo* codecSpecificInfo)
|
||||
{
|
||||
WriteLockScoped cs(_queueRWLock);
|
||||
_frameBufferQueue.push(new FrameQueueTuple(frame, codecSpecificInfo));
|
||||
@ -218,7 +216,7 @@ WebRtc_UWord32 VideoEncodeCompleteCallback::EncodedBytes()
|
||||
|
||||
WebRtc_Word32
|
||||
VideoEncodeCompleteCallback::Encoded(EncodedImage& encodedImage,
|
||||
const void* codecSpecificInfo,
|
||||
const webrtc::CodecSpecificInfo* codecSpecificInfo,
|
||||
const webrtc::RTPFragmentationHeader*
|
||||
fragmentation)
|
||||
{
|
||||
@ -231,7 +229,7 @@ VideoEncodeCompleteCallback::Encoded(EncodedImage& encodedImage,
|
||||
// it for an empty frame and then just do:
|
||||
// emptyFrame->SwapBuffers(encodedBuffer);
|
||||
// This is how it should be done in Video Engine to save in on memcpys
|
||||
void* codecSpecificInfoCopy =
|
||||
webrtc::CodecSpecificInfo* codecSpecificInfoCopy =
|
||||
_test.CopyCodecSpecificInfo(codecSpecificInfo);
|
||||
_test.CopyEncodedImage(*newBuffer, encodedImage, codecSpecificInfoCopy);
|
||||
if (_encodedFile != NULL)
|
||||
@ -447,12 +445,10 @@ NormalAsyncTest::Encode()
|
||||
_hasReceivedSLI = false; // don't trigger both at once
|
||||
}
|
||||
|
||||
void* codecSpecificInfo = CreateEncoderSpecificInfo();
|
||||
webrtc::CodecSpecificInfo* codecSpecificInfo = CreateEncoderSpecificInfo();
|
||||
int ret = _encoder->Encode(rawImage, codecSpecificInfo, frameType);
|
||||
if (codecSpecificInfo != NULL)
|
||||
{
|
||||
// TODO(holmer): implement virtual function for deleting this and
|
||||
// remove warnings
|
||||
delete codecSpecificInfo;
|
||||
codecSpecificInfo = NULL;
|
||||
}
|
||||
|
@ -23,14 +23,14 @@ class FrameQueueTuple
|
||||
{
|
||||
public:
|
||||
FrameQueueTuple(TestVideoEncodedBuffer *frame,
|
||||
const void* codecSpecificInfo = NULL)
|
||||
const webrtc::CodecSpecificInfo* codecSpecificInfo = NULL)
|
||||
:
|
||||
_frame(frame),
|
||||
_codecSpecificInfo(codecSpecificInfo)
|
||||
{};
|
||||
~FrameQueueTuple();
|
||||
TestVideoEncodedBuffer* _frame;
|
||||
const void* _codecSpecificInfo;
|
||||
TestVideoEncodedBuffer* _frame;
|
||||
const webrtc::CodecSpecificInfo* _codecSpecificInfo;
|
||||
};
|
||||
|
||||
class FrameQueue
|
||||
@ -49,7 +49,7 @@ public:
|
||||
}
|
||||
|
||||
void PushFrame(TestVideoEncodedBuffer *frame,
|
||||
void* codecSpecificInfo = NULL);
|
||||
webrtc::CodecSpecificInfo* codecSpecificInfo = NULL);
|
||||
FrameQueueTuple* PopFrame();
|
||||
bool Empty();
|
||||
|
||||
@ -83,13 +83,17 @@ public:
|
||||
virtual void Perform();
|
||||
virtual void Encoded(const webrtc::EncodedImage& encodedImage);
|
||||
virtual void Decoded(const webrtc::RawImage& decodedImage);
|
||||
virtual void*
|
||||
CopyCodecSpecificInfo(const void* /*codecSpecificInfo */) const
|
||||
virtual webrtc::CodecSpecificInfo*
|
||||
CopyCodecSpecificInfo(
|
||||
const webrtc::CodecSpecificInfo* /*codecSpecificInfo */) const
|
||||
{ return NULL; };
|
||||
virtual void CopyEncodedImage(TestVideoEncodedBuffer& dest,
|
||||
webrtc::EncodedImage& src,
|
||||
void* /*codecSpecificInfo*/) const;
|
||||
virtual void* CreateEncoderSpecificInfo() const { return NULL; };
|
||||
virtual webrtc::CodecSpecificInfo* CreateEncoderSpecificInfo() const
|
||||
{
|
||||
return NULL;
|
||||
};
|
||||
virtual WebRtc_Word32
|
||||
ReceivedDecodedReferenceFrame(const WebRtc_UWord64 pictureId) { return 0;};
|
||||
virtual WebRtc_Word32
|
||||
@ -149,7 +153,7 @@ public:
|
||||
|
||||
WebRtc_Word32
|
||||
Encoded(webrtc::EncodedImage& encodedImage,
|
||||
const void* codecSpecificInfo = NULL,
|
||||
const webrtc::CodecSpecificInfo* codecSpecificInfo = NULL,
|
||||
const webrtc::RTPFragmentationHeader* fragmentation = NULL);
|
||||
WebRtc_UWord32 EncodedBytes();
|
||||
private:
|
||||
|
@ -267,11 +267,10 @@ bool PerformanceTest::Encode()
|
||||
{
|
||||
frameType = kKeyFrame;
|
||||
}
|
||||
void* codecSpecificInfo = CreateEncoderSpecificInfo();
|
||||
webrtc::CodecSpecificInfo* codecSpecificInfo = CreateEncoderSpecificInfo();
|
||||
int ret = _encoder->Encode(rawImage, codecSpecificInfo, frameType);
|
||||
if (codecSpecificInfo != NULL)
|
||||
{
|
||||
// TODO(holmer): implement virtual function for deleting this and remove warnings
|
||||
delete codecSpecificInfo;
|
||||
codecSpecificInfo = NULL;
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ UnitTest::~UnitTest()
|
||||
|
||||
WebRtc_Word32
|
||||
UnitTestEncodeCompleteCallback::Encoded(EncodedImage& encodedImage,
|
||||
const void* codecSpecificInfo,
|
||||
const webrtc::CodecSpecificInfo* codecSpecificInfo,
|
||||
const webrtc::RTPFragmentationHeader*
|
||||
fragmentation)
|
||||
{
|
||||
|
@ -103,7 +103,7 @@ public:
|
||||
_decoderSpecificInfo(decoderSpecificInfo),
|
||||
_encodeComplete(false) {}
|
||||
WebRtc_Word32 Encoded(webrtc::EncodedImage& encodedImage,
|
||||
const void* codecSpecificInfo,
|
||||
const webrtc::CodecSpecificInfo* codecSpecificInfo,
|
||||
const webrtc::RTPFragmentationHeader*
|
||||
fragmentation = NULL);
|
||||
bool EncodeComplete();
|
||||
|
@ -66,7 +66,7 @@ VP8NormalAsyncTest::ReceivedDecodedReferenceFrame(const WebRtc_UWord64 pictureId
|
||||
return 0;
|
||||
}
|
||||
|
||||
void*
|
||||
CodecSpecificInfo*
|
||||
VP8NormalAsyncTest::CreateEncoderSpecificInfo() const
|
||||
{
|
||||
CodecSpecificInfo* vp8CodecSpecificInfo = new CodecSpecificInfo();
|
||||
|
@ -23,7 +23,7 @@ protected:
|
||||
VP8NormalAsyncTest(std::string name, std::string description, unsigned int testNo) : NormalAsyncTest(name, description, testNo) {}
|
||||
virtual void CodecSpecific_InitBitrate();
|
||||
virtual void CodecSettings(int width, int height, WebRtc_UWord32 frameRate=30, WebRtc_UWord32 bitRate=0);
|
||||
virtual void* CreateEncoderSpecificInfo() const;
|
||||
virtual webrtc::CodecSpecificInfo* CreateEncoderSpecificInfo() const;
|
||||
virtual WebRtc_Word32 ReceivedDecodedReferenceFrame(const WebRtc_UWord64 pictureId);
|
||||
private:
|
||||
mutable bool _hasReceivedRPSI;
|
||||
|
@ -582,5 +582,8 @@ VCMEncComplete_KeyReqTest::SendData(
|
||||
_timeStamp += 3000;
|
||||
rtpInfo.type.Video.isFirstPacket = false;
|
||||
rtpInfo.frameType = kVideoFrameKey;
|
||||
// TODO(hlundin): Remove assert once we've piped PictureID into VCM
|
||||
// through the WebRtcRTPHeader.
|
||||
assert(rtpInfo.type.Video.codec != kRTPVideoVP8);
|
||||
return _vcm.IncomingPacket(payloadData, payloadSize, rtpInfo);
|
||||
}
|
||||
|
@ -113,6 +113,9 @@ VCMNTEncodeCompleteCallback::SendData(
|
||||
{
|
||||
_skipCnt++;
|
||||
}
|
||||
// TODO(hlundin): Remove assert once we've piped PictureID into VCM
|
||||
// through the WebRtcRTPHeader.
|
||||
assert(rtpInfo.type.Video.codec != kRTPVideoVP8);
|
||||
_VCMReceiver->IncomingPacket(payloadData, payloadSize, rtpInfo);
|
||||
return 0;
|
||||
}
|
||||
|
@ -80,6 +80,9 @@ VCMEncodeCompleteCallback::SendData(
|
||||
|
||||
_encodedBytes += payloadSize;
|
||||
// directly to receiver
|
||||
// TODO(hlundin): Remove assert once we've piped PictureID into VCM
|
||||
// through the WebRtcRTPHeader.
|
||||
assert(rtpInfo.type.Video.codec != kRTPVideoVP8);
|
||||
_VCMReceiver->IncomingPacket(payloadData, payloadSize, rtpInfo);
|
||||
_encodeComplete = true;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user