Merge "OMX: don't respect binderization toggle."
diff --git a/cmds/stagefright/Android.mk b/cmds/stagefright/Android.mk
index a98a207..ad70470 100644
--- a/cmds/stagefright/Android.mk
+++ b/cmds/stagefright/Android.mk
@@ -10,8 +10,9 @@
LOCAL_SHARED_LIBRARIES := \
libstagefright libmedia libutils libbinder libstagefright_foundation \
libjpeg libgui libcutils liblog \
+ libhidlmemory \
android.hardware.media.omx@1.0 \
- android.hardware.media.omx@1.0-utils
+ android.hardware.media.omx@1.0-utils \
LOCAL_C_INCLUDES:= \
frameworks/av/media/libstagefright \
diff --git a/media/libstagefright/matroska/MatroskaExtractor.cpp b/media/libstagefright/matroska/MatroskaExtractor.cpp
index a974671..81179d1 100644
--- a/media/libstagefright/matroska/MatroskaExtractor.cpp
+++ b/media/libstagefright/matroska/MatroskaExtractor.cpp
@@ -1288,8 +1288,51 @@
continue;
}
- meta->setInt32(kKeyWidth, vtrack->GetWidth());
- meta->setInt32(kKeyHeight, vtrack->GetHeight());
+ const long long width = vtrack->GetWidth();
+ const long long height = vtrack->GetHeight();
+ if (width <= 0 || width > INT32_MAX) {
+ ALOGW("track width exceeds int32_t, %lld", width);
+ continue;
+ }
+ if (height <= 0 || height > INT32_MAX) {
+ ALOGW("track height exceeds int32_t, %lld", height);
+ continue;
+ }
+ meta->setInt32(kKeyWidth, (int32_t)width);
+ meta->setInt32(kKeyHeight, (int32_t)height);
+
+ // setting display width/height is optional
+ const long long displayUnit = vtrack->GetDisplayUnit();
+ const long long displayWidth = vtrack->GetDisplayWidth();
+ const long long displayHeight = vtrack->GetDisplayHeight();
+ if (displayWidth > 0 && displayWidth <= INT32_MAX
+ && displayHeight > 0 && displayHeight <= INT32_MAX) {
+ switch (displayUnit) {
+ case 0: // pixels
+ meta->setInt32(kKeyDisplayWidth, (int32_t)displayWidth);
+ meta->setInt32(kKeyDisplayHeight, (int32_t)displayHeight);
+ break;
+ case 1: // centimeters
+ case 2: // inches
+ case 3: // aspect ratio
+ {
+ // Physical layout size is treated the same as aspect ratio.
+ // Note: displayWidth and displayHeight are never zero as they are
+ // checked in the if above.
+ const long long computedWidth =
+ std::max(width, height * displayWidth / displayHeight);
+ const long long computedHeight =
+ std::max(height, width * displayHeight / displayWidth);
+ if (computedWidth <= INT32_MAX && computedHeight <= INT32_MAX) {
+ meta->setInt32(kKeyDisplayWidth, (int32_t)computedWidth);
+ meta->setInt32(kKeyDisplayHeight, (int32_t)computedHeight);
+ }
+ break;
+ }
+ default: // unknown display units, perhaps future version of spec.
+ break;
+ }
+ }
getColorInformation(vtrack, meta);
diff --git a/media/libstagefright/omx/hal/1.0/impl/Android.mk b/media/libstagefright/omx/hal/1.0/impl/Android.mk
index ccd19d8..ced6e94 100644
--- a/media/libstagefright/omx/hal/1.0/impl/Android.mk
+++ b/media/libstagefright/omx/hal/1.0/impl/Android.mk
@@ -2,7 +2,6 @@
include $(CLEAR_VARS)
LOCAL_MODULE := android.hardware.media.omx@1.0-impl
-LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_SRC_FILES := \
WGraphicBufferSource.cpp \
WOmx.cpp \
@@ -34,12 +33,10 @@
android.hidl.base@1.0 \
LOCAL_C_INCLUDES += \
- $(TOP) \
- $(TOP)/frameworks/av/include/media \
- $(TOP)/frameworks/av/media/libstagefright/include \
- $(TOP)/frameworks/av/media/libstagefright/omx \
- $(TOP)/frameworks/native/include/media/hardware \
- $(TOP)/frameworks/native/include/media/openmax \
+ $(TOP)/frameworks/av/include \
+ $(TOP)/frameworks/av/media/libstagefright \
$(TOP)/frameworks/native/include \
+ $(TOP)/frameworks/native/include/media/openmax \
+ $(TOP)/frameworks/native/include/media/hardware \
include $(BUILD_SHARED_LIBRARY)
diff --git a/media/libstagefright/omx/hal/1.0/impl/Conversion.h b/media/libstagefright/omx/hal/1.0/impl/Conversion.h
index d164faa..1928875 100644
--- a/media/libstagefright/omx/hal/1.0/impl/Conversion.h
+++ b/media/libstagefright/omx/hal/1.0/impl/Conversion.h
@@ -17,29 +17,26 @@
#ifndef ANDROID_HARDWARE_MEDIA_OMX_V1_0__CONVERSION_H
#define ANDROID_HARDWARE_MEDIA_OMX_V1_0__CONVERSION_H
+#include <vector>
+#include <list>
+
+#include <unistd.h>
+
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
#include <hidlmemory/mapping.h>
-#include <android/hidl/memory/1.0/IMemory.h>
-
-#include <unistd.h>
-#include <vector>
-#include <list>
#include <binder/Binder.h>
#include <binder/Status.h>
#include <ui/FenceTime.h>
-
-#include <OMXFenceParcelable.h>
+#include <media/OMXFenceParcelable.h>
#include <cutils/native_handle.h>
#include <gui/IGraphicBufferProducer.h>
-#include <IOMX.h>
+#include <media/OMXBuffer.h>
#include <VideoAPI.h>
-#include <OMXBuffer.h>
-#include <android/IOMXBufferSource.h>
-#include <android/IGraphicBufferSource.h>
+#include <android/hidl/memory/1.0/IMemory.h>
#include <android/hardware/media/omx/1.0/types.h>
#include <android/hardware/media/omx/1.0/IOmx.h>
#include <android/hardware/media/omx/1.0/IOmxNode.h>
@@ -49,6 +46,9 @@
#include <android/hardware/media/omx/1.0/IOmxProducerListener.h>
#include <android/hardware/media/omx/1.0/IGraphicBufferSource.h>
+#include <android/IGraphicBufferSource.h>
+#include <android/IOMXBufferSource.h>
+
namespace android {
namespace hardware {
namespace media {
diff --git a/media/libstagefright/omx/hal/1.0/impl/Omx.cpp b/media/libstagefright/omx/hal/1.0/impl/Omx.cpp
index eddcc77..cacaa13 100644
--- a/media/libstagefright/omx/hal/1.0/impl/Omx.cpp
+++ b/media/libstagefright/omx/hal/1.0/impl/Omx.cpp
@@ -16,15 +16,13 @@
#include <list>
-#include "Omx.h"
-#include <IOMX.h>
-#include <OMXMaster.h>
-#include <OMXNodeInstance.h>
-#include <GraphicBufferSource.h>
#include <gui/IGraphicBufferProducer.h>
-
+#include <OMX_Core.h>
#include <OMX_AsString.h>
-#include <OMXUtils.h>
+
+#include "../../../OMXUtils.h"
+#include "../../../OMXMaster.h"
+#include "../../../GraphicBufferSource.h"
#include "WOmxNode.h"
#include "WOmxObserver.h"
@@ -32,6 +30,8 @@
#include "WGraphicBufferSource.h"
#include "Conversion.h"
+#include "Omx.h"
+
namespace android {
namespace hardware {
namespace media {
diff --git a/media/libstagefright/omx/hal/1.0/impl/Omx.h b/media/libstagefright/omx/hal/1.0/impl/Omx.h
index 7633820..3e9ea73 100644
--- a/media/libstagefright/omx/hal/1.0/impl/Omx.h
+++ b/media/libstagefright/omx/hal/1.0/impl/Omx.h
@@ -17,13 +17,12 @@
#ifndef ANDROID_HARDWARE_MEDIA_OMX_V1_0_OMX_H
#define ANDROID_HARDWARE_MEDIA_OMX_V1_0_OMX_H
-#include <android/hardware/media/omx/1.0/IOmx.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
-#include <utils/threads.h>
-#include <utils/KeyedVector.h>
-#include <OmxNodeOwner.h>
+#include "../../../../include/OMXNodeInstance.h"
+
+#include <android/hardware/media/omx/1.0/IOmx.h>
namespace android {
diff --git a/media/libstagefright/omx/hal/1.0/impl/OmxNode.cpp b/media/libstagefright/omx/hal/1.0/impl/OmxNode.cpp
index f62269f..641b829 100644
--- a/media/libstagefright/omx/hal/1.0/impl/OmxNode.cpp
+++ b/media/libstagefright/omx/hal/1.0/impl/OmxNode.cpp
@@ -14,13 +14,11 @@
* limitations under the License.
*/
-#include <IOMX.h>
-#include <OMXNodeInstance.h>
-#include "OmxNode.h"
-#include "WOmxNode.h"
-#include "WOmxObserver.h"
#include "Conversion.h"
+#include "OmxNode.h"
+#include "WOmxObserver.h"
+
namespace android {
namespace hardware {
namespace media {
diff --git a/media/libstagefright/omx/hal/1.0/impl/OmxNode.h b/media/libstagefright/omx/hal/1.0/impl/OmxNode.h
index fc19306..706973e 100644
--- a/media/libstagefright/omx/hal/1.0/impl/OmxNode.h
+++ b/media/libstagefright/omx/hal/1.0/impl/OmxNode.h
@@ -22,7 +22,7 @@
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
-#include <OMXNodeInstance.h>
+#include "../../../../include/OMXNodeInstance.h"
namespace android {
namespace hardware {
diff --git a/media/libstagefright/omx/hal/1.0/impl/WGraphicBufferSource.cpp b/media/libstagefright/omx/hal/1.0/impl/WGraphicBufferSource.cpp
index af9cf03..3deb029 100644
--- a/media/libstagefright/omx/hal/1.0/impl/WGraphicBufferSource.cpp
+++ b/media/libstagefright/omx/hal/1.0/impl/WGraphicBufferSource.cpp
@@ -14,11 +14,12 @@
* limitations under the License.
*/
-#include "WGraphicBufferSource.h"
-#include "Conversion.h"
-#include "WOmxNode.h"
#include <stagefright/foundation/ColorUtils.h>
+#include "WGraphicBufferSource.h"
+#include "WOmxNode.h"
+#include "Conversion.h"
+
namespace android {
namespace hardware {
namespace media {
diff --git a/media/libstagefright/omx/hal/1.0/impl/WGraphicBufferSource.h b/media/libstagefright/omx/hal/1.0/impl/WGraphicBufferSource.h
index dd6168e..bd60c46 100644
--- a/media/libstagefright/omx/hal/1.0/impl/WGraphicBufferSource.h
+++ b/media/libstagefright/omx/hal/1.0/impl/WGraphicBufferSource.h
@@ -17,16 +17,17 @@
#ifndef ANDROID_HARDWARE_MEDIA_OMX_V1_0_WGRAPHICBUFFERSOURCE_H
#define ANDROID_HARDWARE_MEDIA_OMX_V1_0_WGRAPHICBUFFERSOURCE_H
-#include <android/hardware/media/omx/1.0/IGraphicBufferSource.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
-#include <frameworks/native/include/binder/Binder.h>
-#include <IOMX.h>
-#include <android/BnGraphicBufferSource.h>
-#include <android/hardware/media/omx/1.0/IOmxNode.h>
+#include <media/IOMX.h>
+#include <binder/Binder.h>
#include <android/hardware/graphics/common/1.0/types.h>
+#include <android/hardware/media/omx/1.0/IOmxNode.h>
+#include <android/hardware/media/omx/1.0/IGraphicBufferSource.h>
+
+#include <android/BnGraphicBufferSource.h>
namespace android {
namespace hardware {
diff --git a/media/libstagefright/omx/hal/1.0/impl/WOmx.h b/media/libstagefright/omx/hal/1.0/impl/WOmx.h
index ab11c6a..3cb002e 100644
--- a/media/libstagefright/omx/hal/1.0/impl/WOmx.h
+++ b/media/libstagefright/omx/hal/1.0/impl/WOmx.h
@@ -17,11 +17,12 @@
#ifndef ANDROID_HARDWARE_MEDIA_OMX_V1_0_WOMX_H
#define ANDROID_HARDWARE_MEDIA_OMX_V1_0_WOMX_H
-#include <android/hardware/media/omx/1.0/IOmx.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
-#include <IOMX.h>
+#include "../../../../include/OMXNodeInstance.h"
+
+#include <android/hardware/media/omx/1.0/IOmx.h>
namespace android {
namespace hardware {
diff --git a/media/libstagefright/omx/hal/1.0/impl/WOmxBufferProducer.cpp b/media/libstagefright/omx/hal/1.0/impl/WOmxBufferProducer.cpp
index 3bd6c6e..746a0d5 100644
--- a/media/libstagefright/omx/hal/1.0/impl/WOmxBufferProducer.cpp
+++ b/media/libstagefright/omx/hal/1.0/impl/WOmxBufferProducer.cpp
@@ -16,6 +16,7 @@
#include "WOmxBufferProducer.h"
#include "WOmxProducerListener.h"
+#include "Conversion.h"
namespace android {
namespace hardware {
diff --git a/media/libstagefright/omx/hal/1.0/impl/WOmxBufferProducer.h b/media/libstagefright/omx/hal/1.0/impl/WOmxBufferProducer.h
index 65b093c..8520160 100644
--- a/media/libstagefright/omx/hal/1.0/impl/WOmxBufferProducer.h
+++ b/media/libstagefright/omx/hal/1.0/impl/WOmxBufferProducer.h
@@ -17,13 +17,14 @@
#ifndef ANDROID_HARDWARE_MEDIA_OMX_V1_0_WOMXBUFFERPRODUCER_H
#define ANDROID_HARDWARE_MEDIA_OMX_V1_0_WOMXBUFFERPRODUCER_H
-#include <android/hardware/media/omx/1.0/IOmxBufferProducer.h>
-#include <binder/Binder.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
+
+#include <binder/Binder.h>
#include <gui/IGraphicBufferProducer.h>
#include <gui/IProducerListener.h>
-#include "Conversion.h"
+
+#include <android/hardware/media/omx/1.0/IOmxBufferProducer.h>
namespace android {
namespace hardware {
diff --git a/media/libstagefright/omx/hal/1.0/impl/WOmxBufferSource.cpp b/media/libstagefright/omx/hal/1.0/impl/WOmxBufferSource.cpp
index 97bcee0..1cf8bf9 100644
--- a/media/libstagefright/omx/hal/1.0/impl/WOmxBufferSource.cpp
+++ b/media/libstagefright/omx/hal/1.0/impl/WOmxBufferSource.cpp
@@ -14,10 +14,10 @@
* limitations under the License.
*/
+#include <utils/String8.h>
+
#include "WOmxBufferSource.h"
#include "Conversion.h"
-#include <utils/String8.h>
-#include <cutils/native_handle.h>
namespace android {
namespace hardware {
diff --git a/media/libstagefright/omx/hal/1.0/impl/WOmxBufferSource.h b/media/libstagefright/omx/hal/1.0/impl/WOmxBufferSource.h
index 83bf46f..9b27796 100644
--- a/media/libstagefright/omx/hal/1.0/impl/WOmxBufferSource.h
+++ b/media/libstagefright/omx/hal/1.0/impl/WOmxBufferSource.h
@@ -17,13 +17,14 @@
#ifndef ANDROID_HARDWARE_MEDIA_OMX_V1_0_WOMXBUFFERSOURCE_H
#define ANDROID_HARDWARE_MEDIA_OMX_V1_0_WOMXBUFFERSOURCE_H
-#include <android/hardware/media/omx/1.0/IOmxBufferSource.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
-#include <frameworks/native/include/binder/Binder.h>
+#include <binder/Binder.h>
+#include <media/OMXFenceParcelable.h>
+
+#include <android/hardware/media/omx/1.0/IOmxBufferSource.h>
#include <android/BnOMXBufferSource.h>
-#include <OMXFenceParcelable.h>
namespace android {
namespace hardware {
diff --git a/media/libstagefright/omx/hal/1.0/impl/WOmxNode.cpp b/media/libstagefright/omx/hal/1.0/impl/WOmxNode.cpp
index 26617aa..dc5c8e1 100644
--- a/media/libstagefright/omx/hal/1.0/impl/WOmxNode.cpp
+++ b/media/libstagefright/omx/hal/1.0/impl/WOmxNode.cpp
@@ -14,14 +14,12 @@
* limitations under the License.
*/
-#include <IOMX.h>
-#include <OMXNodeInstance.h>
+#include <algorithm>
+
#include "WOmxNode.h"
#include "WOmxBufferSource.h"
#include "Conversion.h"
-#include <algorithm>
-
namespace android {
namespace hardware {
namespace media {
diff --git a/media/libstagefright/omx/hal/1.0/impl/WOmxNode.h b/media/libstagefright/omx/hal/1.0/impl/WOmxNode.h
index 12c2f04..75816ba 100644
--- a/media/libstagefright/omx/hal/1.0/impl/WOmxNode.h
+++ b/media/libstagefright/omx/hal/1.0/impl/WOmxNode.h
@@ -17,13 +17,16 @@
#ifndef ANDROID_HARDWARE_MEDIA_OMX_V1_0_WOMXNODE_H
#define ANDROID_HARDWARE_MEDIA_OMX_V1_0_WOMXNODE_H
-#include <android/hardware/media/omx/1.0/IOmxNode.h>
-#include <android/hardware/media/omx/1.0/IOmxObserver.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
#include <utils/Errors.h>
+#include "../../../../include/OMXNodeInstance.h"
+
+#include <android/hardware/media/omx/1.0/IOmxNode.h>
+#include <android/hardware/media/omx/1.0/IOmxObserver.h>
+
namespace android {
namespace hardware {
namespace media {
diff --git a/media/libstagefright/omx/hal/1.0/impl/WOmxObserver.cpp b/media/libstagefright/omx/hal/1.0/impl/WOmxObserver.cpp
index 433a8b8..cd5edf8 100644
--- a/media/libstagefright/omx/hal/1.0/impl/WOmxObserver.cpp
+++ b/media/libstagefright/omx/hal/1.0/impl/WOmxObserver.cpp
@@ -15,13 +15,13 @@
*/
#define LOG_TAG "WOmxObserver-impl"
-#include "WOmxObserver.h"
#include <vector>
#include <cutils/native_handle.h>
-#include <frameworks/native/include/binder/Binder.h>
+#include <binder/Binder.h>
+#include "WOmxObserver.h"
#include "Conversion.h"
namespace android {
diff --git a/media/libstagefright/omx/hal/1.0/impl/WOmxObserver.h b/media/libstagefright/omx/hal/1.0/impl/WOmxObserver.h
index cfe4281..7075513 100644
--- a/media/libstagefright/omx/hal/1.0/impl/WOmxObserver.h
+++ b/media/libstagefright/omx/hal/1.0/impl/WOmxObserver.h
@@ -17,12 +17,14 @@
#ifndef ANDROID_HARDWARE_MEDIA_OMX_V1_0_WOMXOBSERVER_H
#define ANDROID_HARDWARE_MEDIA_OMX_V1_0_WOMXOBSERVER_H
-#include <android/hardware/media/omx/1.0/IOmxObserver.h>
+#include <list>
+
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
-#include <IOMX.h>
-#include <list>
+#include <media/IOMX.h>
+
+#include <android/hardware/media/omx/1.0/IOmxObserver.h>
namespace android {
namespace hardware {
diff --git a/media/libstagefright/omx/hal/1.0/impl/WOmxProducerListener.h b/media/libstagefright/omx/hal/1.0/impl/WOmxProducerListener.h
index 86656ca..e60032e 100644
--- a/media/libstagefright/omx/hal/1.0/impl/WOmxProducerListener.h
+++ b/media/libstagefright/omx/hal/1.0/impl/WOmxProducerListener.h
@@ -17,13 +17,14 @@
#ifndef ANDROID_HARDWARE_MEDIA_OMX_V1_0_WOMXPRODUCERLISTENER_H
#define ANDROID_HARDWARE_MEDIA_OMX_V1_0_WOMXPRODUCERLISTENER_H
-#include <android/hardware/media/omx/1.0/IOmxProducerListener.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
#include <binder/IBinder.h>
#include <gui/IProducerListener.h>
+#include <android/hardware/media/omx/1.0/IOmxProducerListener.h>
+
namespace android {
namespace hardware {
namespace media {
diff --git a/media/libstagefright/omx/hal/1.0/utils/Android.mk b/media/libstagefright/omx/hal/1.0/utils/Android.mk
index 6930c87..729cb2e 100644
--- a/media/libstagefright/omx/hal/1.0/utils/Android.mk
+++ b/media/libstagefright/omx/hal/1.0/utils/Android.mk
@@ -31,12 +31,10 @@
android.hidl.base@1.0 \
LOCAL_C_INCLUDES += \
- $(TOP) \
- $(TOP)/frameworks/av/include/media \
- $(TOP)/frameworks/av/media/libstagefright/include \
- $(TOP)/frameworks/av/media/libstagefright/omx \
- $(TOP)/frameworks/native/include/media/hardware \
- $(TOP)/frameworks/native/include/media/openmax \
+ $(TOP)/frameworks/av/include \
+ $(TOP)/frameworks/av/media/libstagefright \
$(TOP)/frameworks/native/include \
+ $(TOP)/frameworks/native/include/media/openmax \
+ $(TOP)/frameworks/native/include/media/hardware \
include $(BUILD_SHARED_LIBRARY)
diff --git a/media/libstagefright/omx/hal/1.0/utils/Conversion.h b/media/libstagefright/omx/hal/1.0/utils/Conversion.h
index 5050687..d8e1d9f 100644
--- a/media/libstagefright/omx/hal/1.0/utils/Conversion.h
+++ b/media/libstagefright/omx/hal/1.0/utils/Conversion.h
@@ -17,29 +17,26 @@
#ifndef ANDROID_HARDWARE_MEDIA_OMX_V1_0__CONVERSION_H
#define ANDROID_HARDWARE_MEDIA_OMX_V1_0__CONVERSION_H
+#include <vector>
+#include <list>
+
+#include <unistd.h>
+
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
#include <hidlmemory/mapping.h>
-#include <android/hidl/memory/1.0/IMemory.h>
-
-#include <unistd.h>
-#include <vector>
-#include <list>
#include <binder/Binder.h>
#include <binder/Status.h>
#include <ui/FenceTime.h>
-
-#include <OMXFenceParcelable.h>
+#include <media/OMXFenceParcelable.h>
#include <cutils/native_handle.h>
#include <gui/IGraphicBufferProducer.h>
-#include <IOMX.h>
+#include <media/OMXBuffer.h>
#include <VideoAPI.h>
-#include <OMXBuffer.h>
-#include <android/IOMXBufferSource.h>
-#include <android/IGraphicBufferSource.h>
+#include <android/hidl/memory/1.0/IMemory.h>
#include <android/hardware/media/omx/1.0/types.h>
#include <android/hardware/media/omx/1.0/IOmx.h>
#include <android/hardware/media/omx/1.0/IOmxNode.h>
@@ -49,6 +46,9 @@
#include <android/hardware/media/omx/1.0/IOmxProducerListener.h>
#include <android/hardware/media/omx/1.0/IGraphicBufferSource.h>
+#include <android/IGraphicBufferSource.h>
+#include <android/IOMXBufferSource.h>
+
namespace android {
namespace hardware {
namespace media {
diff --git a/media/libstagefright/omx/hal/1.0/utils/WGraphicBufferSource.cpp b/media/libstagefright/omx/hal/1.0/utils/WGraphicBufferSource.cpp
index afe8bc5..5238eb3 100644
--- a/media/libstagefright/omx/hal/1.0/utils/WGraphicBufferSource.cpp
+++ b/media/libstagefright/omx/hal/1.0/utils/WGraphicBufferSource.cpp
@@ -14,11 +14,12 @@
* limitations under the License.
*/
-#include "WGraphicBufferSource.h"
-#include "Conversion.h"
-#include "WOmxNode.h"
#include <stagefright/foundation/ColorUtils.h>
+#include "WGraphicBufferSource.h"
+#include "WOmxNode.h"
+#include "Conversion.h"
+
namespace android {
namespace hardware {
namespace media {
@@ -95,7 +96,8 @@
return Void();
}
-Return<void> TWGraphicBufferSource::setSuspend(bool suspend, int64_t timeUs) {
+Return<void> TWGraphicBufferSource::setSuspend(
+ bool suspend, int64_t timeUs) {
mBase->setSuspend(suspend, timeUs);
return Void();
}
diff --git a/media/libstagefright/omx/hal/1.0/utils/WGraphicBufferSource.h b/media/libstagefright/omx/hal/1.0/utils/WGraphicBufferSource.h
index 1b09cbd..1090d52 100644
--- a/media/libstagefright/omx/hal/1.0/utils/WGraphicBufferSource.h
+++ b/media/libstagefright/omx/hal/1.0/utils/WGraphicBufferSource.h
@@ -17,16 +17,17 @@
#ifndef ANDROID_HARDWARE_MEDIA_OMX_V1_0_WGRAPHICBUFFERSOURCE_H
#define ANDROID_HARDWARE_MEDIA_OMX_V1_0_WGRAPHICBUFFERSOURCE_H
-#include <android/hardware/media/omx/1.0/IGraphicBufferSource.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
-#include <frameworks/native/include/binder/Binder.h>
-#include <IOMX.h>
-#include <android/BnGraphicBufferSource.h>
-#include <android/hardware/media/omx/1.0/IOmxNode.h>
+#include <media/IOMX.h>
+#include <binder/Binder.h>
#include <android/hardware/graphics/common/1.0/types.h>
+#include <android/hardware/media/omx/1.0/IOmxNode.h>
+#include <android/hardware/media/omx/1.0/IGraphicBufferSource.h>
+
+#include <android/BnGraphicBufferSource.h>
namespace android {
namespace hardware {
diff --git a/media/libstagefright/omx/hal/1.0/utils/WOmx.h b/media/libstagefright/omx/hal/1.0/utils/WOmx.h
index 73adc55..7860f46 100644
--- a/media/libstagefright/omx/hal/1.0/utils/WOmx.h
+++ b/media/libstagefright/omx/hal/1.0/utils/WOmx.h
@@ -17,11 +17,12 @@
#ifndef ANDROID_HARDWARE_MEDIA_OMX_V1_0_WOMX_H
#define ANDROID_HARDWARE_MEDIA_OMX_V1_0_WOMX_H
-#include <android/hardware/media/omx/1.0/IOmx.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
-#include <IOMX.h>
+#include "../../../../include/OMXNodeInstance.h"
+
+#include <android/hardware/media/omx/1.0/IOmx.h>
namespace android {
namespace hardware {
diff --git a/media/libstagefright/omx/hal/1.0/utils/WOmxBufferProducer.cpp b/media/libstagefright/omx/hal/1.0/utils/WOmxBufferProducer.cpp
index cfb0cce..7415b0e 100644
--- a/media/libstagefright/omx/hal/1.0/utils/WOmxBufferProducer.cpp
+++ b/media/libstagefright/omx/hal/1.0/utils/WOmxBufferProducer.cpp
@@ -16,6 +16,7 @@
#include "WOmxBufferProducer.h"
#include "WOmxProducerListener.h"
+#include "Conversion.h"
namespace android {
namespace hardware {
diff --git a/media/libstagefright/omx/hal/1.0/utils/WOmxBufferProducer.h b/media/libstagefright/omx/hal/1.0/utils/WOmxBufferProducer.h
index a5d2961..54b9078 100644
--- a/media/libstagefright/omx/hal/1.0/utils/WOmxBufferProducer.h
+++ b/media/libstagefright/omx/hal/1.0/utils/WOmxBufferProducer.h
@@ -17,13 +17,14 @@
#ifndef ANDROID_HARDWARE_MEDIA_OMX_V1_0_WOMXBUFFERPRODUCER_H
#define ANDROID_HARDWARE_MEDIA_OMX_V1_0_WOMXBUFFERPRODUCER_H
-#include <android/hardware/media/omx/1.0/IOmxBufferProducer.h>
-#include <binder/Binder.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
+
+#include <binder/Binder.h>
#include <gui/IGraphicBufferProducer.h>
#include <gui/IProducerListener.h>
-#include "Conversion.h"
+
+#include <android/hardware/media/omx/1.0/IOmxBufferProducer.h>
namespace android {
namespace hardware {
diff --git a/media/libstagefright/omx/hal/1.0/utils/WOmxBufferSource.cpp b/media/libstagefright/omx/hal/1.0/utils/WOmxBufferSource.cpp
index f3f5b9d..7f58f78 100644
--- a/media/libstagefright/omx/hal/1.0/utils/WOmxBufferSource.cpp
+++ b/media/libstagefright/omx/hal/1.0/utils/WOmxBufferSource.cpp
@@ -14,10 +14,10 @@
* limitations under the License.
*/
+#include <utils/String8.h>
+
#include "WOmxBufferSource.h"
#include "Conversion.h"
-#include <utils/String8.h>
-#include <cutils/native_handle.h>
namespace android {
namespace hardware {
diff --git a/media/libstagefright/omx/hal/1.0/utils/WOmxBufferSource.h b/media/libstagefright/omx/hal/1.0/utils/WOmxBufferSource.h
index 1214300..086f648 100644
--- a/media/libstagefright/omx/hal/1.0/utils/WOmxBufferSource.h
+++ b/media/libstagefright/omx/hal/1.0/utils/WOmxBufferSource.h
@@ -17,13 +17,14 @@
#ifndef ANDROID_HARDWARE_MEDIA_OMX_V1_0_WOMXBUFFERSOURCE_H
#define ANDROID_HARDWARE_MEDIA_OMX_V1_0_WOMXBUFFERSOURCE_H
-#include <android/hardware/media/omx/1.0/IOmxBufferSource.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
-#include <frameworks/native/include/binder/Binder.h>
+#include <binder/Binder.h>
+#include <media/OMXFenceParcelable.h>
+
+#include <android/hardware/media/omx/1.0/IOmxBufferSource.h>
#include <android/BnOMXBufferSource.h>
-#include <OMXFenceParcelable.h>
namespace android {
namespace hardware {
diff --git a/media/libstagefright/omx/hal/1.0/utils/WOmxNode.cpp b/media/libstagefright/omx/hal/1.0/utils/WOmxNode.cpp
index 3bb7a99..df191c7 100644
--- a/media/libstagefright/omx/hal/1.0/utils/WOmxNode.cpp
+++ b/media/libstagefright/omx/hal/1.0/utils/WOmxNode.cpp
@@ -14,14 +14,12 @@
* limitations under the License.
*/
-#include <IOMX.h>
-#include <OMXNodeInstance.h>
+#include <algorithm>
+
#include "WOmxNode.h"
#include "WOmxBufferSource.h"
#include "Conversion.h"
-#include <algorithm>
-
namespace android {
namespace hardware {
namespace media {
diff --git a/media/libstagefright/omx/hal/1.0/utils/WOmxNode.h b/media/libstagefright/omx/hal/1.0/utils/WOmxNode.h
index 9c4bb4a..46dfb49 100644
--- a/media/libstagefright/omx/hal/1.0/utils/WOmxNode.h
+++ b/media/libstagefright/omx/hal/1.0/utils/WOmxNode.h
@@ -17,13 +17,16 @@
#ifndef ANDROID_HARDWARE_MEDIA_OMX_V1_0_WOMXNODE_H
#define ANDROID_HARDWARE_MEDIA_OMX_V1_0_WOMXNODE_H
-#include <android/hardware/media/omx/1.0/IOmxNode.h>
-#include <android/hardware/media/omx/1.0/IOmxObserver.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
#include <utils/Errors.h>
+#include "../../../../include/OMXNodeInstance.h"
+
+#include <android/hardware/media/omx/1.0/IOmxNode.h>
+#include <android/hardware/media/omx/1.0/IOmxObserver.h>
+
namespace android {
namespace hardware {
namespace media {
diff --git a/media/libstagefright/omx/hal/1.0/utils/WOmxObserver.cpp b/media/libstagefright/omx/hal/1.0/utils/WOmxObserver.cpp
index bab6a09..113c342 100644
--- a/media/libstagefright/omx/hal/1.0/utils/WOmxObserver.cpp
+++ b/media/libstagefright/omx/hal/1.0/utils/WOmxObserver.cpp
@@ -15,13 +15,13 @@
*/
#define LOG_TAG "WOmxObserver-utils"
-#include "WOmxObserver.h"
#include <vector>
#include <cutils/native_handle.h>
-#include <frameworks/native/include/binder/Binder.h>
+#include <binder/Binder.h>
+#include "WOmxObserver.h"
#include "Conversion.h"
namespace android {
diff --git a/media/libstagefright/omx/hal/1.0/utils/WOmxObserver.h b/media/libstagefright/omx/hal/1.0/utils/WOmxObserver.h
index b9eb412..d442218 100644
--- a/media/libstagefright/omx/hal/1.0/utils/WOmxObserver.h
+++ b/media/libstagefright/omx/hal/1.0/utils/WOmxObserver.h
@@ -17,12 +17,14 @@
#ifndef ANDROID_HARDWARE_MEDIA_OMX_V1_0_WOMXOBSERVER_H
#define ANDROID_HARDWARE_MEDIA_OMX_V1_0_WOMXOBSERVER_H
-#include <android/hardware/media/omx/1.0/IOmxObserver.h>
+#include <list>
+
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
-#include <IOMX.h>
-#include <list>
+#include <media/IOMX.h>
+
+#include <android/hardware/media/omx/1.0/IOmxObserver.h>
namespace android {
namespace hardware {
diff --git a/media/libstagefright/omx/hal/1.0/utils/WOmxProducerListener.h b/media/libstagefright/omx/hal/1.0/utils/WOmxProducerListener.h
index 2be077b..7d20887 100644
--- a/media/libstagefright/omx/hal/1.0/utils/WOmxProducerListener.h
+++ b/media/libstagefright/omx/hal/1.0/utils/WOmxProducerListener.h
@@ -17,13 +17,14 @@
#ifndef ANDROID_HARDWARE_MEDIA_OMX_V1_0_WOMXPRODUCERLISTENER_H
#define ANDROID_HARDWARE_MEDIA_OMX_V1_0_WOMXPRODUCERLISTENER_H
-#include <android/hardware/media/omx/1.0/IOmxProducerListener.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
#include <binder/IBinder.h>
#include <gui/IProducerListener.h>
+#include <android/hardware/media/omx/1.0/IOmxProducerListener.h>
+
namespace android {
namespace hardware {
namespace media {
diff --git a/media/libstagefright/omx/tests/Android.mk b/media/libstagefright/omx/tests/Android.mk
index 08deaab..6d0f189 100644
--- a/media/libstagefright/omx/tests/Android.mk
+++ b/media/libstagefright/omx/tests/Android.mk
@@ -14,6 +14,7 @@
libcutils \
libhidlbase \
libhidlmemory \
+ android.hidl.allocator@1.0 \
android.hidl.memory@1.0 \
android.hardware.media.omx@1.0 \
android.hardware.media.omx@1.0-utils
diff --git a/media/libstagefright/omx/tests/OMXHarness.h b/media/libstagefright/omx/tests/OMXHarness.h
index 94a37da..4fc0f79 100644
--- a/media/libstagefright/omx/tests/OMXHarness.h
+++ b/media/libstagefright/omx/tests/OMXHarness.h
@@ -79,7 +79,7 @@
virtual ~Harness();
private:
- typedef hidl::memory::V1_0::IAllocator IAllocator;
+ typedef hidl::allocator::V1_0::IAllocator IAllocator;
friend struct NodeReaper;
struct CodecObserver;
diff --git a/media/mtp/MtpFfsHandle.cpp b/media/mtp/MtpFfsHandle.cpp
index 58d2bb8..35dd10f 100644
--- a/media/mtp/MtpFfsHandle.cpp
+++ b/media/mtp/MtpFfsHandle.cpp
@@ -205,13 +205,13 @@
const struct usb_ss_ep_comp_descriptor ss_sink_comp = {
.bLength = sizeof(ss_sink_comp),
.bDescriptorType = USB_DT_SS_ENDPOINT_COMP,
- .bMaxBurst = 2,
+ .bMaxBurst = 6,
};
const struct usb_ss_ep_comp_descriptor ss_source_comp = {
.bLength = sizeof(ss_source_comp),
.bDescriptorType = USB_DT_SS_ENDPOINT_COMP,
- .bMaxBurst = 2,
+ .bMaxBurst = 6,
};
const struct usb_ss_ep_comp_descriptor ss_intr_comp = {
diff --git a/services/mediacodec/Android.mk b/services/mediacodec/Android.mk
index a87c71c..a428c75 100644
--- a/services/mediacodec/Android.mk
+++ b/services/mediacodec/Android.mk
@@ -34,9 +34,12 @@
libcutils \
libhwbinder \
libhidltransport \
- android.hardware.media.omx@1.0
+ android.hardware.media.omx@1.0 \
+ android.hardware.media.omx@1.0-impl \
+ android.hidl.memory@1.0
LOCAL_C_INCLUDES := \
$(TOP)/frameworks/av/media/libstagefright \
+ $(TOP)/frameworks/av/media/libstagefright/include \
$(TOP)/frameworks/native/include/media/openmax
LOCAL_MODULE := mediacodec
LOCAL_32_BIT_ONLY := true
diff --git a/services/mediacodec/main_codecservice.cpp b/services/mediacodec/main_codecservice.cpp
index a9872b3..b273e3f 100644
--- a/services/mediacodec/main_codecservice.cpp
+++ b/services/mediacodec/main_codecservice.cpp
@@ -33,6 +33,7 @@
#include <android/hardware/media/omx/1.0/IOmx.h>
#include <hidl/HidlTransportSupport.h>
+#include <omx/hal/1.0/impl/Omx.h>
using namespace android;
@@ -54,10 +55,10 @@
if ((trebleOmx == 1) || ((trebleOmx == -1) &&
property_get_bool("omx.binderization", 0))) {
using namespace ::android::hardware::media::omx::V1_0;
- sp<IOmx> omx = IOmx::getService(true);
+ sp<IOmx> omx = new implementation::Omx();
if (omx == nullptr) {
LOG(ERROR) << "Cannot create a Treble IOmx service.";
- } else if (omx->registerAsService("default") != OK) {
+ } else if (omx->registerAsService() != OK) {
LOG(ERROR) << "Cannot register a Treble IOmx service.";
} else {
LOG(INFO) << "Treble IOmx service created.";
diff --git a/services/radio/RadioHalHidl.cpp b/services/radio/RadioHalHidl.cpp
index 3dcf2f3..bfc5500 100644
--- a/services/radio/RadioHalHidl.cpp
+++ b/services/radio/RadioHalHidl.cpp
@@ -116,7 +116,7 @@
sp<IBroadcastRadio> RadioHalHidl::getService()
{
if (mHalModule == 0) {
- sp<IBroadcastRadioFactory> factory = IBroadcastRadioFactory::getService("broadcastradio");
+ sp<IBroadcastRadioFactory> factory = IBroadcastRadioFactory::getService();
if (factory != 0) {
factory->connectModule(static_cast<Class>(mClassId),
[&](Result retval, const ::android::sp<IBroadcastRadio>& result) {