Bug 1187118 - [WIP] debug log
MozReview-Commit-ID: AarQUPGJTPG
--- a/dom/media/gif/GIFDemuxer.cpp
+++ b/dom/media/gif/GIFDemuxer.cpp
@@ -343,16 +343,18 @@ already_AddRefed<MediaRawData>
GIFTrackDemuxer::ConvertFrameToMediaRawData(RawAccessFrameRef& aFrame)
{
// Kaku: This is a hard copy of the underlying data, we should do something
// more efficient.
uint8_t* data = nullptr;
uint32_t length = -1;
aFrame->GetImageData(&data, &length);
RefPtr<MediaRawData> sample = new MediaRawData(data, length);
+printf_stderr("New frame: ----------------\n");
+printf_stderr("New frame: length = %d, aFrame->GetIsPaletted() = %d\n", length, aFrame->GetIsPaletted());
// We insert the frame header in mExtraData
sample->mExtraData = new MediaByteBuffer();
{
gfx::IntSize size = aFrame->GetSize();
uint8_t* p = reinterpret_cast<uint8_t*>(&size);
for (uint32_t i = 0; i < sizeof(aFrame->GetSize()); i++, p++) {
sample->mExtraData->AppendElement(*p);
@@ -363,16 +365,18 @@ GIFTrackDemuxer::ConvertFrameToMediaRawD
// Kaku: am I using the right information?
const AnimationData animationData = aFrame->GetAnimationData();
media::TimeUnit time = media::TimeUnit::FromMicroseconds((int64_t)animationData.mTimeout.AsMilliseconds() * 1000);
sample->mDuration = time.ToMicroseconds();
sample->mTime = mTime;
sample->mKeyframe = true;
sample->mTimecode = mTime;
+printf_stderr("New frame: sample->mTime = %lld, sample->mDuration = %lld\n", sample->mTime, sample->mDuration);
+printf_stderr("New frame: width = %d, height = %d\n", aFrame->GetSize().width, aFrame->GetSize().height);
// Update the decoded range.
mTime += time.ToMicroseconds();
return sample.forget();
}
} // namespace mozilla
--- a/dom/media/platforms/agnostic/GIFDataDecoder.cpp
+++ b/dom/media/platforms/agnostic/GIFDataDecoder.cpp
@@ -50,16 +50,19 @@ GIFDataDecoder::Decode(MediaRawData* aSa
RefPtr<MediaDataDecoder::DecodePromise>
GIFDataDecoder::ProcessDecode(MediaRawData* aSample)
{
MOZ_ASSERT(aSample->mExtraData->Length() == 8,
"Something is wrong about the size of mExtraData");
gfx::IntSize frameSize = *(reinterpret_cast<gfx::IntSize*>(aSample->mExtraData->Elements()));
+
+printf_stderr("GIFDataDecoder::ProcessDecode: width = %d, height = %d\n", frameSize.width, frameSize.height);
+
RefPtr<Image> image = CreateSharedRGBImage(mImageContainer, frameSize, gfxImageFormat::A8R8G8B8);
RefPtr<SharedRGBImage> sharedRGBImage = static_cast<SharedRGBImage*>(image.get());
memcpy(sharedRGBImage->GetBuffer(), aSample->Data(), aSample->Size());
const IntRect picture(0, 0, frameSize.width, frameSize.height);
RefPtr<VideoData> v = VideoData::CreateFromImage(mInfo,
aSample->mOffset,
aSample->mTime,