summaryrefslogtreecommitdiffstats
path: root/dom/media/DOMMediaStream.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-05-13 00:08:52 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-05-13 00:08:52 +0200
commite16bcd08aae85a7d9c2de5a4b1c733280cb81112 (patch)
tree220026724ceb8fbcf18bf627fde022c2d8df0e91 /dom/media/DOMMediaStream.cpp
parent6571d2ceb42930dab01677ef0e95e732d5076fb8 (diff)
downloadUXP-e16bcd08aae85a7d9c2de5a4b1c733280cb81112.tar
UXP-e16bcd08aae85a7d9c2de5a4b1c733280cb81112.tar.gz
UXP-e16bcd08aae85a7d9c2de5a4b1c733280cb81112.tar.lz
UXP-e16bcd08aae85a7d9c2de5a4b1c733280cb81112.tar.xz
UXP-e16bcd08aae85a7d9c2de5a4b1c733280cb81112.zip
Remove MOZ_WIDGET_GONK [2/2]
Tag #288
Diffstat (limited to 'dom/media/DOMMediaStream.cpp')
-rwxr-xr-xdom/media/DOMMediaStream.cpp102
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 ***/
}