Loading headers/media_plugin/media/openmax/OMX_IndexExt.h +1 −0 Original line number Diff line number Diff line Loading @@ -85,6 +85,7 @@ typedef enum OMX_INDEXEXTTYPE { OMX_IndexParamMaxFrameDurationForBitrateControl,/**< reference: OMX_PARAM_U32TYPE */ OMX_IndexParamVideoVp9, /**< reference: OMX_VIDEO_PARAM_VP9TYPE */ OMX_IndexParamVideoAndroidVp9Encoder, /**< reference: OMX_VIDEO_PARAM_ANDROID_VP9ENCODERTYPE */ OMX_IndexParamVideoAndroidImageGrid, /**< reference: OMX_VIDEO_PARAM_ANDROID_IMAGEGRIDTYPE */ OMX_IndexExtVideoEndUnused, /* Image & Video common configurations */ Loading headers/media_plugin/media/openmax/OMX_Video.h +1 −0 Original line number Diff line number Diff line Loading @@ -89,6 +89,7 @@ typedef enum OMX_VIDEO_CODINGTYPE { OMX_VIDEO_CodingVP9, /**< Google VP9 */ OMX_VIDEO_CodingHEVC, /**< ITU H.265/HEVC */ OMX_VIDEO_CodingDolbyVision,/**< Dolby Vision */ OMX_VIDEO_CodingImageHEIC, /**< HEIF image encoded with HEVC */ OMX_VIDEO_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_VIDEO_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_VIDEO_CodingMax = 0x7FFFFFFF Loading headers/media_plugin/media/openmax/OMX_VideoExt.h +43 −0 Original line number Diff line number Diff line Loading @@ -213,6 +213,7 @@ typedef enum OMX_VIDEO_HEVCPROFILETYPE { OMX_VIDEO_HEVCProfileUnknown = 0x0, OMX_VIDEO_HEVCProfileMain = 0x1, OMX_VIDEO_HEVCProfileMain10 = 0x2, OMX_VIDEO_HEVCProfileMainStill = 0x4, // Main10 profile with HDR SEI support. OMX_VIDEO_HEVCProfileMain10HDR10 = 0x1000, OMX_VIDEO_HEVCProfileMax = 0x7FFFFFFF Loading Loading @@ -421,6 +422,48 @@ typedef struct OMX_VIDEO_CONFIG_ANDROID_TEMPORALLAYERINGTYPE { OMX_U32 nBitrateRatios[OMX_VIDEO_ANDROID_MAXTEMPORALLAYERS]; } OMX_VIDEO_CONFIG_ANDROID_TEMPORALLAYERINGTYPE; /** * Android specific param for specifying image grid layout information for image encoding * use cases, corresponding to index OMX_IndexParamVideoAndroidImageGrid. * * OMX_VIDEO_CodingImageHEIC encoders must handle this param type. When this param is set * on the component with bEnabled set to true, nGrid* indicates the desired grid config * by the client. The component can use this as a heuristic, but is free to choose any * suitable grid configs, and the client shall always get the actual from the component * after the param is set. Encoder will receive each input image in full, and shall encode * it into tiles in row-major, top-row first, left-to-right order, and send each encoded * tile in a separate output buffer. All output buffers for the same input buffer shall * carry the same timestamp as the input buffer. If the input buffer is marked EOS, * the EOS should only appear on the last output buffer for that input buffer. * * OMX_VIDEO_CodingHEVC encoders might also receive this param when it's used for image * encoding, although in this case the param only serves as a hint. The encoder will * receive the input image tiles in row-major, top-row first, left-to-right order. * The grid config can be used for quality control, or optimizations. * * If this param is not set, the component shall assume that grid option is disabled. * * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to (output port for encoders) * bEnabled : Whether grid is enabled. If true, nGrid* specifies the grid * config; otherwise nGrid* shall be ignored. * nGridWidth : Width of each tile. * nGridHeight : Height of each tile. * nGridRows : Number of rows in the grid. * nGridCols : Number of cols in the grid. */ typedef struct OMX_VIDEO_PARAM_ANDROID_IMAGEGRIDTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bEnabled; OMX_U32 nGridWidth; OMX_U32 nGridHeight; OMX_U32 nGridRows; OMX_U32 nGridCols; } OMX_VIDEO_PARAM_ANDROID_IMAGEGRIDTYPE; #ifdef __cplusplus } #endif /* __cplusplus */ Loading libs/gui/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -122,6 +122,7 @@ cc_library_shared { ], shared_libs: [ "android.hardware.graphics.common@1.1", "libsync", "libbinder", "libbufferhubqueue", // TODO(b/70046255): Remove this once BufferHub is integrated into libgui. Loading Loading @@ -154,6 +155,7 @@ cc_library_shared { "libui", "android.hidl.token@1.0-utils", "android.hardware.graphics.bufferqueue@1.0", "android.hardware.graphics.common@1.1", ], export_header_lib_headers: [ Loading libs/gui/ISurfaceComposer.cpp +18 −15 Original line number Diff line number Diff line Loading @@ -132,12 +132,13 @@ public: virtual status_t captureLayers(const sp<IBinder>& layerHandleBinder, sp<GraphicBuffer>* outBuffer, const Rect& sourceCrop, float frameScale) { float frameScale, bool childrenOnly) { Parcel data, reply; data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); data.writeStrongBinder(layerHandleBinder); data.write(sourceCrop); data.writeFloat(frameScale); data.writeBool(childrenOnly); status_t err = remote()->transact(BnSurfaceComposer::CAPTURE_LAYERS, data, &reply); if (err != NO_ERROR) { Loading Loading @@ -349,7 +350,7 @@ public: } virtual status_t getDisplayColorModes(const sp<IBinder>& display, Vector<android_color_mode_t>* outColorModes) { Vector<ColorMode>* outColorModes) { Parcel data, reply; status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); if (result != NO_ERROR) { Loading @@ -372,34 +373,34 @@ public: outColorModes->clear(); outColorModes->resize(numModes); for (size_t i = 0; i < numModes; ++i) { outColorModes->replaceAt(static_cast<android_color_mode_t>(reply.readInt32()), i); outColorModes->replaceAt(static_cast<ColorMode>(reply.readInt32()), i); } } return result; } virtual android_color_mode_t getActiveColorMode(const sp<IBinder>& display) { virtual ColorMode getActiveColorMode(const sp<IBinder>& display) { Parcel data, reply; status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); if (result != NO_ERROR) { ALOGE("getActiveColorMode failed to writeInterfaceToken: %d", result); return static_cast<android_color_mode_t>(result); return static_cast<ColorMode>(result); } result = data.writeStrongBinder(display); if (result != NO_ERROR) { ALOGE("getActiveColorMode failed to writeStrongBinder: %d", result); return static_cast<android_color_mode_t>(result); return static_cast<ColorMode>(result); } result = remote()->transact(BnSurfaceComposer::GET_ACTIVE_COLOR_MODE, data, &reply); if (result != NO_ERROR) { ALOGE("getActiveColorMode failed to transact: %d", result); return static_cast<android_color_mode_t>(result); return static_cast<ColorMode>(result); } return static_cast<android_color_mode_t>(reply.readInt32()); return static_cast<ColorMode>(reply.readInt32()); } virtual status_t setActiveColorMode(const sp<IBinder>& display, android_color_mode_t colorMode) { ColorMode colorMode) { Parcel data, reply; status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); if (result != NO_ERROR) { Loading @@ -411,7 +412,7 @@ public: ALOGE("setActiveColorMode failed to writeStrongBinder: %d", result); return result; } result = data.writeInt32(colorMode); result = data.writeInt32(static_cast<int32_t>(colorMode)); if (result != NO_ERROR) { ALOGE("setActiveColorMode failed to writeInt32: %d", result); return result; Loading Loading @@ -629,8 +630,10 @@ status_t BnSurfaceComposer::onTransact( Rect sourceCrop(Rect::EMPTY_RECT); data.read(sourceCrop); float frameScale = data.readFloat(); bool childrenOnly = data.readBool(); status_t res = captureLayers(layerHandleBinder, &outBuffer, sourceCrop, frameScale); status_t res = captureLayers(layerHandleBinder, &outBuffer, sourceCrop, frameScale, childrenOnly); reply->writeInt32(res); if (res == NO_ERROR) { reply->write(*outBuffer); Loading Loading @@ -736,7 +739,7 @@ status_t BnSurfaceComposer::onTransact( } case GET_DISPLAY_COLOR_MODES: { CHECK_INTERFACE(ISurfaceComposer, data, reply); Vector<android_color_mode_t> colorModes; Vector<ColorMode> colorModes; sp<IBinder> display = nullptr; status_t result = data.readStrongBinder(&display); if (result != NO_ERROR) { Loading @@ -748,7 +751,7 @@ status_t BnSurfaceComposer::onTransact( if (result == NO_ERROR) { reply->writeUint32(static_cast<uint32_t>(colorModes.size())); for (size_t i = 0; i < colorModes.size(); ++i) { reply->writeInt32(colorModes[i]); reply->writeInt32(static_cast<int32_t>(colorModes[i])); } } return NO_ERROR; Loading @@ -761,7 +764,7 @@ status_t BnSurfaceComposer::onTransact( ALOGE("getActiveColorMode failed to readStrongBinder: %d", result); return result; } android_color_mode_t colorMode = getActiveColorMode(display); ColorMode colorMode = getActiveColorMode(display); result = reply->writeInt32(static_cast<int32_t>(colorMode)); return result; } Loading @@ -780,7 +783,7 @@ status_t BnSurfaceComposer::onTransact( return result; } result = setActiveColorMode(display, static_cast<android_color_mode_t>(colorModeInt)); static_cast<ColorMode>(colorModeInt)); result = reply->writeInt32(result); return result; } Loading Loading
headers/media_plugin/media/openmax/OMX_IndexExt.h +1 −0 Original line number Diff line number Diff line Loading @@ -85,6 +85,7 @@ typedef enum OMX_INDEXEXTTYPE { OMX_IndexParamMaxFrameDurationForBitrateControl,/**< reference: OMX_PARAM_U32TYPE */ OMX_IndexParamVideoVp9, /**< reference: OMX_VIDEO_PARAM_VP9TYPE */ OMX_IndexParamVideoAndroidVp9Encoder, /**< reference: OMX_VIDEO_PARAM_ANDROID_VP9ENCODERTYPE */ OMX_IndexParamVideoAndroidImageGrid, /**< reference: OMX_VIDEO_PARAM_ANDROID_IMAGEGRIDTYPE */ OMX_IndexExtVideoEndUnused, /* Image & Video common configurations */ Loading
headers/media_plugin/media/openmax/OMX_Video.h +1 −0 Original line number Diff line number Diff line Loading @@ -89,6 +89,7 @@ typedef enum OMX_VIDEO_CODINGTYPE { OMX_VIDEO_CodingVP9, /**< Google VP9 */ OMX_VIDEO_CodingHEVC, /**< ITU H.265/HEVC */ OMX_VIDEO_CodingDolbyVision,/**< Dolby Vision */ OMX_VIDEO_CodingImageHEIC, /**< HEIF image encoded with HEVC */ OMX_VIDEO_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_VIDEO_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_VIDEO_CodingMax = 0x7FFFFFFF Loading
headers/media_plugin/media/openmax/OMX_VideoExt.h +43 −0 Original line number Diff line number Diff line Loading @@ -213,6 +213,7 @@ typedef enum OMX_VIDEO_HEVCPROFILETYPE { OMX_VIDEO_HEVCProfileUnknown = 0x0, OMX_VIDEO_HEVCProfileMain = 0x1, OMX_VIDEO_HEVCProfileMain10 = 0x2, OMX_VIDEO_HEVCProfileMainStill = 0x4, // Main10 profile with HDR SEI support. OMX_VIDEO_HEVCProfileMain10HDR10 = 0x1000, OMX_VIDEO_HEVCProfileMax = 0x7FFFFFFF Loading Loading @@ -421,6 +422,48 @@ typedef struct OMX_VIDEO_CONFIG_ANDROID_TEMPORALLAYERINGTYPE { OMX_U32 nBitrateRatios[OMX_VIDEO_ANDROID_MAXTEMPORALLAYERS]; } OMX_VIDEO_CONFIG_ANDROID_TEMPORALLAYERINGTYPE; /** * Android specific param for specifying image grid layout information for image encoding * use cases, corresponding to index OMX_IndexParamVideoAndroidImageGrid. * * OMX_VIDEO_CodingImageHEIC encoders must handle this param type. When this param is set * on the component with bEnabled set to true, nGrid* indicates the desired grid config * by the client. The component can use this as a heuristic, but is free to choose any * suitable grid configs, and the client shall always get the actual from the component * after the param is set. Encoder will receive each input image in full, and shall encode * it into tiles in row-major, top-row first, left-to-right order, and send each encoded * tile in a separate output buffer. All output buffers for the same input buffer shall * carry the same timestamp as the input buffer. If the input buffer is marked EOS, * the EOS should only appear on the last output buffer for that input buffer. * * OMX_VIDEO_CodingHEVC encoders might also receive this param when it's used for image * encoding, although in this case the param only serves as a hint. The encoder will * receive the input image tiles in row-major, top-row first, left-to-right order. * The grid config can be used for quality control, or optimizations. * * If this param is not set, the component shall assume that grid option is disabled. * * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to (output port for encoders) * bEnabled : Whether grid is enabled. If true, nGrid* specifies the grid * config; otherwise nGrid* shall be ignored. * nGridWidth : Width of each tile. * nGridHeight : Height of each tile. * nGridRows : Number of rows in the grid. * nGridCols : Number of cols in the grid. */ typedef struct OMX_VIDEO_PARAM_ANDROID_IMAGEGRIDTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bEnabled; OMX_U32 nGridWidth; OMX_U32 nGridHeight; OMX_U32 nGridRows; OMX_U32 nGridCols; } OMX_VIDEO_PARAM_ANDROID_IMAGEGRIDTYPE; #ifdef __cplusplus } #endif /* __cplusplus */ Loading
libs/gui/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -122,6 +122,7 @@ cc_library_shared { ], shared_libs: [ "android.hardware.graphics.common@1.1", "libsync", "libbinder", "libbufferhubqueue", // TODO(b/70046255): Remove this once BufferHub is integrated into libgui. Loading Loading @@ -154,6 +155,7 @@ cc_library_shared { "libui", "android.hidl.token@1.0-utils", "android.hardware.graphics.bufferqueue@1.0", "android.hardware.graphics.common@1.1", ], export_header_lib_headers: [ Loading
libs/gui/ISurfaceComposer.cpp +18 −15 Original line number Diff line number Diff line Loading @@ -132,12 +132,13 @@ public: virtual status_t captureLayers(const sp<IBinder>& layerHandleBinder, sp<GraphicBuffer>* outBuffer, const Rect& sourceCrop, float frameScale) { float frameScale, bool childrenOnly) { Parcel data, reply; data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); data.writeStrongBinder(layerHandleBinder); data.write(sourceCrop); data.writeFloat(frameScale); data.writeBool(childrenOnly); status_t err = remote()->transact(BnSurfaceComposer::CAPTURE_LAYERS, data, &reply); if (err != NO_ERROR) { Loading Loading @@ -349,7 +350,7 @@ public: } virtual status_t getDisplayColorModes(const sp<IBinder>& display, Vector<android_color_mode_t>* outColorModes) { Vector<ColorMode>* outColorModes) { Parcel data, reply; status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); if (result != NO_ERROR) { Loading @@ -372,34 +373,34 @@ public: outColorModes->clear(); outColorModes->resize(numModes); for (size_t i = 0; i < numModes; ++i) { outColorModes->replaceAt(static_cast<android_color_mode_t>(reply.readInt32()), i); outColorModes->replaceAt(static_cast<ColorMode>(reply.readInt32()), i); } } return result; } virtual android_color_mode_t getActiveColorMode(const sp<IBinder>& display) { virtual ColorMode getActiveColorMode(const sp<IBinder>& display) { Parcel data, reply; status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); if (result != NO_ERROR) { ALOGE("getActiveColorMode failed to writeInterfaceToken: %d", result); return static_cast<android_color_mode_t>(result); return static_cast<ColorMode>(result); } result = data.writeStrongBinder(display); if (result != NO_ERROR) { ALOGE("getActiveColorMode failed to writeStrongBinder: %d", result); return static_cast<android_color_mode_t>(result); return static_cast<ColorMode>(result); } result = remote()->transact(BnSurfaceComposer::GET_ACTIVE_COLOR_MODE, data, &reply); if (result != NO_ERROR) { ALOGE("getActiveColorMode failed to transact: %d", result); return static_cast<android_color_mode_t>(result); return static_cast<ColorMode>(result); } return static_cast<android_color_mode_t>(reply.readInt32()); return static_cast<ColorMode>(reply.readInt32()); } virtual status_t setActiveColorMode(const sp<IBinder>& display, android_color_mode_t colorMode) { ColorMode colorMode) { Parcel data, reply; status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); if (result != NO_ERROR) { Loading @@ -411,7 +412,7 @@ public: ALOGE("setActiveColorMode failed to writeStrongBinder: %d", result); return result; } result = data.writeInt32(colorMode); result = data.writeInt32(static_cast<int32_t>(colorMode)); if (result != NO_ERROR) { ALOGE("setActiveColorMode failed to writeInt32: %d", result); return result; Loading Loading @@ -629,8 +630,10 @@ status_t BnSurfaceComposer::onTransact( Rect sourceCrop(Rect::EMPTY_RECT); data.read(sourceCrop); float frameScale = data.readFloat(); bool childrenOnly = data.readBool(); status_t res = captureLayers(layerHandleBinder, &outBuffer, sourceCrop, frameScale); status_t res = captureLayers(layerHandleBinder, &outBuffer, sourceCrop, frameScale, childrenOnly); reply->writeInt32(res); if (res == NO_ERROR) { reply->write(*outBuffer); Loading Loading @@ -736,7 +739,7 @@ status_t BnSurfaceComposer::onTransact( } case GET_DISPLAY_COLOR_MODES: { CHECK_INTERFACE(ISurfaceComposer, data, reply); Vector<android_color_mode_t> colorModes; Vector<ColorMode> colorModes; sp<IBinder> display = nullptr; status_t result = data.readStrongBinder(&display); if (result != NO_ERROR) { Loading @@ -748,7 +751,7 @@ status_t BnSurfaceComposer::onTransact( if (result == NO_ERROR) { reply->writeUint32(static_cast<uint32_t>(colorModes.size())); for (size_t i = 0; i < colorModes.size(); ++i) { reply->writeInt32(colorModes[i]); reply->writeInt32(static_cast<int32_t>(colorModes[i])); } } return NO_ERROR; Loading @@ -761,7 +764,7 @@ status_t BnSurfaceComposer::onTransact( ALOGE("getActiveColorMode failed to readStrongBinder: %d", result); return result; } android_color_mode_t colorMode = getActiveColorMode(display); ColorMode colorMode = getActiveColorMode(display); result = reply->writeInt32(static_cast<int32_t>(colorMode)); return result; } Loading @@ -780,7 +783,7 @@ status_t BnSurfaceComposer::onTransact( return result; } result = setActiveColorMode(display, static_cast<android_color_mode_t>(colorModeInt)); static_cast<ColorMode>(colorModeInt)); result = reply->writeInt32(result); return result; } Loading