Bug 817478 - Part1: omx plugin changes for sony device support - r=cpeterson

--HG--
extra : rebase_source : fa7730805d5b47803226e43c6aab3d6dd074aadf
This commit is contained in:
Chris Double 2012-12-11 09:52:46 +13:00
parent 8b7faac85b
commit 18a0d770ae
7 changed files with 134 additions and 3 deletions

View File

@ -152,7 +152,22 @@ static const char* GetOmxLibraryName()
ALOG("Android Release Version is: %s", NS_LossyConvertUTF16toASCII(release_version).get());
}
if (version == 13 || version == 12 || version == 11) {
nsAutoString device;
rv = infoService->GetPropertyAsAString(NS_LITERAL_STRING("device"), device);
if (NS_SUCCEEDED(rv)) {
ALOG("Android Device is: %s", NS_LossyConvertUTF16toASCII(device).get());
}
if (version == 15 &&
(device.Find("LT28", false) == 0 ||
device.Find("LT26", false) == 0 ||
device.Find("LT22", false) == 0 ||
device.Find("IS12", false) == 0 ||
device.Find("MT27", false) == 0)) {
// Sony Ericsson devices running ICS
return "lib/libomxpluginsony.so";
}
else if (version == 13 || version == 12 || version == 11) {
return "lib/libomxpluginhc.so";
}
else if (version == 10 && release_version >= NS_LITERAL_STRING("2.3.6")) {

View File

@ -66,6 +66,17 @@ public:
return 0;
}
#if defined(MOZ_ANDROID_SONY_WORKAROUND)
private:
// Sony ICS devices have extra virtual methods in DataSource.
// The dummy methods below fill these vtable positions.
virtual void foo1() { abort(); }
virtual void foo2() { abort(); }
virtual void foo3() { abort(); }
virtual void foo4() { abort(); }
public:
#endif
virtual status_t reconnectAtOffset(off64_t offset) {
return ERROR_UNSUPPORTED;
}

View File

@ -1,5 +1,5 @@
diff --git a/media/omx-plugin/include/ics/stagefright/DataSource.h b/media/omx-plugin/include/ics/stagefright/DataSource.h
index 870d805..713af92 100644
index 81ef632..713af92 100644
--- a/media/omx-plugin/include/ics/stagefright/DataSource.h
+++ b/media/omx-plugin/include/ics/stagefright/DataSource.h
@@ -28,16 +28,12 @@
@ -20,3 +20,22 @@ index 870d805..713af92 100644
public:
enum Flags {
kWantsPrefetching = 1,
@@ -66,17 +62,6 @@ public:
return 0;
}
-#if defined(MOZ_ANDROID_SONY_WORKAROUND)
-private:
- // Sony ICS devices have extra virtual methods in DataSource.
- // The dummy methods below fill these vtable positions.
- virtual void foo1() { abort(); }
- virtual void foo2() { abort(); }
- virtual void foo3() { abort(); }
- virtual void foo4() { abort(); }
-public:
-#endif
-
virtual status_t reconnectAtOffset(off64_t offset) {
return ERROR_UNSUPPORTED;
}

View File

@ -58,4 +58,4 @@ cp $1/frameworks/base/include/ui/GraphicBuffer.h ./ui/GraphicBuffer.h
cp $1/hardware/libhardware/include/hardware/hardware.h ./hardware/hardware.h
cp $1/hardware/libhardware/include/hardware/gralloc.h ./hardware/gralloc.h
cp $1/hardware/libhardware/include/hardware/fb.h ./hardware/fb.h
patch -R -p5 <update.patch
patch -R -p5 <update.patch

View File

@ -0,0 +1,67 @@
# Copyright 2012 Mozilla Foundation and Mozilla contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = omxpluginsony
MODULE_NAME = omxpluginsony
LIBRARY_NAME = omxpluginsony
FORCE_SHARED_LIB = 1
# Don't use STL wrappers; this isn't Gecko code
STL_FLAGS =
# must link statically with the CRT; this isn't Gecko code
USE_STATIC_LIBS = 1
# Need to custom install OMX media plugin
NO_DIST_INSTALL = 1
NO_INSTALL = 1
CPPSRCS = \
OmxPluginSony.cpp \
$(NULL)
include $(topsrcdir)/config/rules.mk
ifdef GNU_CXX
# Turn off C++ 11 features due to conflicts with Android OS headers and char16_t definition
CXXFLAGS += -std=gnu++98
endif
INCLUDES += \
-I$(srcdir)/../../../content/media/plugins \
$(NULL)
EXTRA_DSO_LDOPTS += \
-L$(DEPTH)/media/omx-plugin/lib/ics/libutils \
-lutils \
-L$(DEPTH)/media/omx-plugin/lib/ics/libstagefright \
-lstagefright \
$(NULL)
INCLUDES += \
-I$(srcdir)/../include/ics \
-I$(srcdir)/../include/ics/media/stagefright/openmax \
$(NULL)
libs:: $(DLL_PREFIX)$(LIBRARY_NAME)$(DLL_SUFFIX)
$(INSTALL) $< $(DEPTH)/dist/bin
libs:: $(PROGRAMS)

View File

@ -0,0 +1,10 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#define MOZ_STAGEFRIGHT_OFF_T off64_t
#define MOZ_ANDROID_GB
#define MOZ_ANDROID_HC
#include <ui/egl/android_natives.h>
#include "../OmxPlugin.cpp"

View File

@ -0,0 +1,9 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#define MOZ_STAGEFRIGHT_OFF_T off64_t
#define MOZ_ANDROID_ICS
#define MOZ_ANDROID_SONY_WORKAROUND
#include "../OmxPlugin.cpp"