michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "VideoSegment.h" michael@0: michael@0: #include "gfx2DGlue.h" michael@0: #include "ImageContainer.h" michael@0: michael@0: namespace mozilla { michael@0: michael@0: using namespace layers; michael@0: michael@0: VideoFrame::VideoFrame(already_AddRefed& aImage, michael@0: const gfxIntSize& aIntrinsicSize) michael@0: : mImage(aImage), mIntrinsicSize(aIntrinsicSize), mForceBlack(false) michael@0: {} michael@0: michael@0: VideoFrame::VideoFrame() michael@0: : mIntrinsicSize(0, 0), mForceBlack(false) michael@0: {} michael@0: michael@0: VideoFrame::~VideoFrame() michael@0: {} michael@0: michael@0: void michael@0: VideoFrame::SetNull() { michael@0: mImage = nullptr; michael@0: mIntrinsicSize = gfxIntSize(0, 0); michael@0: } michael@0: michael@0: void michael@0: VideoFrame::TakeFrom(VideoFrame* aFrame) michael@0: { michael@0: mImage = aFrame->mImage.forget(); michael@0: mIntrinsicSize = aFrame->mIntrinsicSize; michael@0: mForceBlack = aFrame->GetForceBlack(); michael@0: } michael@0: michael@0: VideoChunk::VideoChunk() michael@0: {} michael@0: michael@0: VideoChunk::~VideoChunk() michael@0: {} michael@0: michael@0: void michael@0: VideoSegment::AppendFrame(already_AddRefed&& aImage, michael@0: TrackTicks aDuration, michael@0: const IntSize& aIntrinsicSize) michael@0: { michael@0: VideoChunk* chunk = AppendChunk(aDuration); michael@0: VideoFrame frame(aImage, ThebesIntSize(aIntrinsicSize)); michael@0: chunk->mFrame.TakeFrom(&frame); michael@0: } michael@0: michael@0: VideoSegment::VideoSegment() michael@0: : MediaSegmentBase(VIDEO) michael@0: {} michael@0: michael@0: VideoSegment::~VideoSegment() michael@0: {} michael@0: michael@0: }