diff options
Diffstat (limited to 'dom/media/DOMMediaStream.cpp')
-rwxr-xr-x | dom/media/DOMMediaStream.cpp | 102 |
1 files changed, 2 insertions, 100 deletions
diff --git a/dom/media/DOMMediaStream.cpp b/dom/media/DOMMediaStream.cpp index c1d451035..118d845a3 100755 --- a/dom/media/DOMMediaStream.cpp +++ b/dom/media/DOMMediaStream.cpp @@ -1505,20 +1505,6 @@ DOMAudioNodeMediaStream::CreateTrackUnionStreamAsInput(nsPIDOMWindowInner* aWind DOMHwMediaStream::DOMHwMediaStream(nsPIDOMWindowInner* aWindow) : DOMLocalMediaStream(aWindow, nullptr) { -#ifdef MOZ_WIDGET_GONK - if (!mWindow) { - NS_ERROR("Expected window here."); - mPrincipalHandle = PRINCIPAL_HANDLE_NONE; - return; - } - nsIDocument* doc = mWindow->GetExtantDoc(); - if (!doc) { - NS_ERROR("Expected document here."); - mPrincipalHandle = PRINCIPAL_HANDLE_NONE; - return; - } - mPrincipalHandle = MakePrincipalHandle(doc->NodePrincipal()); -#endif } DOMHwMediaStream::~DOMHwMediaStream() @@ -1545,31 +1531,8 @@ DOMHwMediaStream::Init(MediaStream* stream, OverlayImage* aImage) { SourceMediaStream* srcStream = stream->AsSourceStream(); -#ifdef MOZ_WIDGET_GONK - if (aImage) { - mOverlayImage = aImage; - } else { - Data imageData; - imageData.mOverlayId = DEFAULT_IMAGE_ID; - imageData.mSize.width = DEFAULT_IMAGE_WIDTH; - imageData.mSize.height = DEFAULT_IMAGE_HEIGHT; - - mOverlayImage = new OverlayImage(); - mOverlayImage->SetData(imageData); - } -#endif - if (srcStream) { VideoSegment segment; -#ifdef MOZ_WIDGET_GONK - const StreamTime delta = STREAM_TIME_MAX; // Because MediaStreamGraph will run out frames in non-autoplay mode, - // we must give it bigger frame length to cover this situation. - - RefPtr<Image> image = static_cast<Image*>(mOverlayImage.get()); - mozilla::gfx::IntSize size = image->GetSize(); - - segment.AppendFrame(image.forget(), delta, size, mPrincipalHandle); -#endif srcStream->AddTrack(TRACK_VIDEO_PRIMARY, 0, new VideoSegment()); srcStream->AppendToTrack(TRACK_VIDEO_PRIMARY, &segment); srcStream->AdvanceKnownTracksTime(STREAM_TIME_MAX); @@ -1579,30 +1542,13 @@ DOMHwMediaStream::Init(MediaStream* stream, OverlayImage* aImage) int32_t DOMHwMediaStream::RequestOverlayId() { -#ifdef MOZ_WIDGET_GONK - return mOverlayImage->GetOverlayId(); -#else + /*** STUB ***/ return -1; -#endif } void DOMHwMediaStream::SetImageSize(uint32_t width, uint32_t height) { -#ifdef MOZ_WIDGET_GONK - if (mOverlayImage->GetSidebandStream().IsValid()) { - OverlayImage::SidebandStreamData imgData; - imgData.mStream = mOverlayImage->GetSidebandStream(); - imgData.mSize = IntSize(width, height); - mOverlayImage->SetData(imgData); - } else { - OverlayImage::Data imgData; - imgData.mOverlayId = mOverlayImage->GetOverlayId(); - imgData.mSize = IntSize(width, height); - mOverlayImage->SetData(imgData); - } -#endif - SourceMediaStream* srcStream = GetInputStream()->AsSourceStream(); StreamTracks::Track* track = srcStream->FindTrack(TRACK_VIDEO_PRIMARY); @@ -1610,23 +1556,6 @@ DOMHwMediaStream::SetImageSize(uint32_t width, uint32_t height) return; } -#ifdef MOZ_WIDGET_GONK - // Clear the old segment. - // Changing the existing content of segment is a Very BAD thing, and this way will - // confuse consumers of MediaStreams. - // It is only acceptable for DOMHwMediaStream - // because DOMHwMediaStream doesn't have consumers of TV streams currently. - track->GetSegment()->Clear(); - - // Change the image size. - const StreamTime delta = STREAM_TIME_MAX; - RefPtr<Image> image = static_cast<Image*>(mOverlayImage.get()); - mozilla::gfx::IntSize size = image->GetSize(); - VideoSegment segment; - - segment.AppendFrame(image.forget(), delta, size, mPrincipalHandle); - srcStream->AppendToTrack(TRACK_VIDEO_PRIMARY, &segment); -#endif } void @@ -1635,9 +1564,6 @@ DOMHwMediaStream::SetOverlayImage(OverlayImage* aImage) if (!aImage) { return; } -#ifdef MOZ_WIDGET_GONK - mOverlayImage = aImage; -#endif SourceMediaStream* srcStream = GetInputStream()->AsSourceStream(); StreamTracks::Track* track = srcStream->FindTrack(TRACK_VIDEO_PRIMARY); @@ -1646,34 +1572,10 @@ DOMHwMediaStream::SetOverlayImage(OverlayImage* aImage) return; } -#ifdef MOZ_WIDGET_GONK - // Clear the old segment. - // Changing the existing content of segment is a Very BAD thing, and this way will - // confuse consumers of MediaStreams. - // It is only acceptable for DOMHwMediaStream - // because DOMHwMediaStream doesn't have consumers of TV streams currently. - track->GetSegment()->Clear(); - - // Change the image size. - const StreamTime delta = STREAM_TIME_MAX; - RefPtr<Image> image = static_cast<Image*>(mOverlayImage.get()); - mozilla::gfx::IntSize size = image->GetSize(); - VideoSegment segment; - - segment.AppendFrame(image.forget(), delta, size, mPrincipalHandle); - srcStream->AppendToTrack(TRACK_VIDEO_PRIMARY, &segment); -#endif } void DOMHwMediaStream::SetOverlayId(int32_t aOverlayId) { -#ifdef MOZ_WIDGET_GONK - OverlayImage::Data imgData; - - imgData.mOverlayId = aOverlayId; - imgData.mSize = mOverlayImage->GetSize(); - - mOverlayImage->SetData(imgData); -#endif + /*** STUB ***/ } |