summaryrefslogtreecommitdiffstats
path: root/dom/media/MediaData.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/MediaData.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/MediaData.cpp')
-rw-r--r--dom/media/MediaData.cpp53
1 files changed, 0 insertions, 53 deletions
diff --git a/dom/media/MediaData.cpp b/dom/media/MediaData.cpp
index 4a52c22ae..94f5f32a0 100644
--- a/dom/media/MediaData.cpp
+++ b/dom/media/MediaData.cpp
@@ -9,9 +9,6 @@
#include "VideoUtils.h"
#include "ImageContainer.h"
-#ifdef MOZ_WIDGET_GONK
-#include <cutils/properties.h>
-#endif
#include <stdint.h>
namespace mozilla {
@@ -93,31 +90,6 @@ ValidatePlane(const VideoData::YCbCrBuffer::Plane& aPlane)
aPlane.mStride > 0 && aPlane.mWidth <= aPlane.mStride;
}
-#ifdef MOZ_WIDGET_GONK
-static bool
-IsYV12Format(const VideoData::YCbCrBuffer::Plane& aYPlane,
- const VideoData::YCbCrBuffer::Plane& aCbPlane,
- const VideoData::YCbCrBuffer::Plane& aCrPlane)
-{
- return
- aYPlane.mWidth % 2 == 0 &&
- aYPlane.mHeight % 2 == 0 &&
- aYPlane.mWidth / 2 == aCbPlane.mWidth &&
- aYPlane.mHeight / 2 == aCbPlane.mHeight &&
- aCbPlane.mWidth == aCrPlane.mWidth &&
- aCbPlane.mHeight == aCrPlane.mHeight;
-}
-
-static bool
-IsInEmulator()
-{
- char propQemu[PROPERTY_VALUE_MAX];
- property_get("ro.kernel.qemu", propQemu, "");
- return !strncmp(propQemu, "1", 1);
-}
-
-#endif
-
VideoData::VideoData(int64_t aOffset,
int64_t aTime,
int64_t aDuration,
@@ -310,19 +282,8 @@ VideoData::CreateAndCopyData(const VideoInfo& aInfo,
aTimecode,
aInfo.mDisplay,
0));
-#ifdef MOZ_WIDGET_GONK
- const YCbCrBuffer::Plane &Y = aBuffer.mPlanes[0];
- const YCbCrBuffer::Plane &Cb = aBuffer.mPlanes[1];
- const YCbCrBuffer::Plane &Cr = aBuffer.mPlanes[2];
-#endif
-
// Currently our decoder only knows how to output to ImageFormat::PLANAR_YCBCR
// format.
-#ifdef MOZ_WIDGET_GONK
- if (IsYV12Format(Y, Cb, Cr) && !IsInEmulator()) {
- v->mImage = new layers::GrallocImage();
- }
-#endif
if (!v->mImage) {
v->mImage = aContainer->CreatePlanarYCbCrImage();
}
@@ -341,20 +302,6 @@ VideoData::CreateAndCopyData(const VideoInfo& aInfo,
return nullptr;
}
-#ifdef MOZ_WIDGET_GONK
- if (!videoImage->IsValid() && IsYV12Format(Y, Cb, Cr)) {
- // Failed to allocate gralloc. Try fallback.
- v->mImage = aContainer->CreatePlanarYCbCrImage();
- if (!v->mImage) {
- return nullptr;
- }
- videoImage = v->mImage->AsPlanarYCbCrImage();
- if (!VideoData::SetVideoDataToImage(videoImage, aInfo, aBuffer, aPicture,
- true /* aCopyData */)) {
- return nullptr;
- }
- }
-#endif
return v.forget();
}