Backed out changeset bb2103358f84 (bug 1343140) for build bustage. r=backout on a CLOSED TREE

This commit is contained in:
Sebastian Hengst 2017-03-06 19:34:25 +01:00
Родитель d28c90112d
Коммит 945e8d94fc
4 изменённых файлов: 2 добавлений и 43 удалений

Просмотреть файл

@ -78,7 +78,7 @@ WidevineVideoDecoder::InitDecode(const GMPVideoCodec& aCodecSettings,
return;
}
config.format = kYv12;
config.coded_size = mCodedSize = Size(aCodecSettings.mWidth, aCodecSettings.mHeight);
config.coded_size = Size(aCodecSettings.mWidth, aCodecSettings.mHeight);
nsTArray<uint8_t> extraData;
if (aCodecSpecificLength > 0) {
// The first byte is the WebRTC packetization mode, which can be ignored.
@ -128,18 +128,7 @@ WidevineVideoDecoder::Decode(GMPVideoEncodedFrame* aInputFrame,
aInputFrame->Destroy();
aInputFrame = nullptr;
if (rv == kSuccess || rv == kNoKey) {
if (rv == kNoKey) {
CDM_LOG("NoKey for sample at time=%lld!", sample.timestamp);
// Somehow our key became unusable. Typically this would happen when
// a stream requires output protection, and the configuration changed
// such that output protection is no longer available. For example, a
// non-compliant monitor was attached. The JS player should notice the
// key status changing to "output-restricted", and is supposed to switch
// to a stream that doesn't require OP. In order to keep the playback
// pipeline rolling, just output a black frame. See bug 1343140.
frame.InitToBlack(mCodedSize.width, mCodedSize.height, sample.timestamp);
}
if (rv == kSuccess) {
if (!ReturnOutput(frame)) {
CDM_LOG("WidevineVideoDecoder::Decode() Failed in ReturnOutput()");
mCallback->Error(GMPDecodeErr);

Просмотреть файл

@ -73,7 +73,6 @@ private:
// If a reset is being performed. Used to track if ReturnOutput should
// dump current frame.
bool mResetInProgress;
cdm::Size mCodedSize;
};
} // namespace mozilla

Просмотреть файл

@ -124,31 +124,4 @@ WidevineVideoFrame::Timestamp() const
return mTimestamp;
}
void
WidevineVideoFrame::InitToBlack(uint32_t aWidth, uint32_t aHeight, int64_t aTimeStamp)
{
SetFormat(VideoFormat::kI420);
SetSize(cdm::Size(aWidth, aHeight));
size_t ySize = aWidth * aHeight;
size_t uSize = ((aWidth + 1) / 2) * ((aHeight + 1) / 2);
WidevineBuffer* buffer = new WidevineBuffer(ySize + uSize);
// Black in YCbCr is (0,128,128).
memset(buffer->Data(), 0, ySize);
memset(buffer->Data() + ySize, 128, uSize);
if (mBuffer) {
mBuffer->Destroy();
mBuffer = nullptr;
}
SetFrameBuffer(buffer);
SetPlaneOffset(VideoFrame::kYPlane, 0);
SetStride(VideoFrame::kYPlane, aWidth);
// Note: U and V planes are stored at the same place in order to
// save memory since their contents are the same.
SetPlaneOffset(VideoFrame::kUPlane, ySize);
SetStride(VideoFrame::kUPlane, (aWidth + 1) / 2);
SetPlaneOffset(VideoFrame::kVPlane, ySize);
SetStride(VideoFrame::kVPlane, (aWidth + 1) / 2);
SetTimestamp(aTimeStamp);
}
} // namespace mozilla

Просмотреть файл

@ -36,8 +36,6 @@ public:
void SetTimestamp(int64_t aTimestamp) override;
int64_t Timestamp() const override;
void InitToBlack(uint32_t aWidth, uint32_t aHeight, int64_t aTimeStamp);
protected:
cdm::VideoFormat mFormat;
cdm::Size mSize;