Loading cmds/atrace/atrace.rc +14 −0 Original line number Original line Diff line number Diff line Loading @@ -307,6 +307,13 @@ on late-init on late-init && property:ro.boot.fastboot.boottrace=enabled on late-init && property:ro.boot.fastboot.boottrace=enabled setprop debug.atrace.tags.enableflags 802922 setprop debug.atrace.tags.enableflags 802922 setprop persist.traced.enable 0 setprop persist.traced.enable 0 write /sys/kernel/tracing/events/binder/binder_transaction/enable 1 write /sys/kernel/tracing/events/binder/binder_transaction_received/enable 1 write /sys/kernel/tracing/events/binder/binder_transaction_alloc_buf/enable 1 write /sys/kernel/tracing/events/binder/binder_set_priority/enable 1 write /sys/kernel/tracing/events/binder/binder_lock/enable 1 write /sys/kernel/tracing/events/binder/binder_locked/enable 1 write /sys/kernel/tracing/events/binder/binder_unlock/enable 1 write /sys/kernel/debug/tracing/tracing_on 1 write /sys/kernel/debug/tracing/tracing_on 1 write /sys/kernel/tracing/tracing_on 1 write /sys/kernel/tracing/tracing_on 1 Loading Loading @@ -415,6 +422,13 @@ service boottrace /system/bin/atrace --async_start -f /data/misc/boottrace/categ on property:sys.boot_completed=1 && property:ro.boot.fastboot.boottrace=enabled on property:sys.boot_completed=1 && property:ro.boot.fastboot.boottrace=enabled setprop debug.atrace.tags.enableflags 0 setprop debug.atrace.tags.enableflags 0 setprop persist.traced.enable 1 setprop persist.traced.enable 1 write /sys/kernel/tracing/events/binder/binder_transaction/enable 0 write /sys/kernel/tracing/events/binder/binder_transaction_received/enable 0 write /sys/kernel/tracing/events/binder/binder_transaction_alloc_buf/enable 0 write /sys/kernel/tracing/events/binder/binder_set_priority/enable 0 write /sys/kernel/tracing/events/binder/binder_lock/enable 0 write /sys/kernel/tracing/events/binder/binder_locked/enable 0 write /sys/kernel/tracing/events/binder/binder_unlock/enable 0 write /sys/kernel/debug/tracing/tracing_on 0 write /sys/kernel/debug/tracing/tracing_on 0 write /sys/kernel/tracing/tracing_on 0 write /sys/kernel/tracing/tracing_on 0 include/android/choreographer.h +13 −0 Original line number Original line Diff line number Diff line Loading @@ -219,12 +219,16 @@ void AChoreographer_unregisterRefreshRateCallback(AChoreographer* choreographer, * * * Note that this time should \b not be used to advance animation clocks. * Note that this time should \b not be used to advance animation clocks. * Instead, see AChoreographerFrameCallbackData_getFrameTimelineExpectedPresentationTimeNanos(). * Instead, see AChoreographerFrameCallbackData_getFrameTimelineExpectedPresentationTimeNanos(). * * Available since API level 33. */ */ int64_t AChoreographerFrameCallbackData_getFrameTimeNanos( int64_t AChoreographerFrameCallbackData_getFrameTimeNanos( const AChoreographerFrameCallbackData* data) __INTRODUCED_IN(33); const AChoreographerFrameCallbackData* data) __INTRODUCED_IN(33); /** /** * The number of possible frame timelines. * The number of possible frame timelines. * * Available since API level 33. */ */ size_t AChoreographerFrameCallbackData_getFrameTimelinesLength( size_t AChoreographerFrameCallbackData_getFrameTimelinesLength( const AChoreographerFrameCallbackData* data) __INTRODUCED_IN(33); const AChoreographerFrameCallbackData* data) __INTRODUCED_IN(33); Loading @@ -233,15 +237,20 @@ size_t AChoreographerFrameCallbackData_getFrameTimelinesLength( * Gets the index of the platform-preferred frame timeline. * Gets the index of the platform-preferred frame timeline. * The preferred frame timeline is the default * The preferred frame timeline is the default * by which the platform scheduled the app, based on the device configuration. * by which the platform scheduled the app, based on the device configuration. * * Available since API level 33. */ */ size_t AChoreographerFrameCallbackData_getPreferredFrameTimelineIndex( size_t AChoreographerFrameCallbackData_getPreferredFrameTimelineIndex( const AChoreographerFrameCallbackData* data) __INTRODUCED_IN(33); const AChoreographerFrameCallbackData* data) __INTRODUCED_IN(33); /** /** * Gets the token used by the platform to identify the frame timeline at the given \c index. * Gets the token used by the platform to identify the frame timeline at the given \c index. * q * Available since API level 33. * * * \param index index of a frame timeline, in \f( [0, FrameTimelinesLength) \f). See * \param index index of a frame timeline, in \f( [0, FrameTimelinesLength) \f). See * AChoreographerFrameCallbackData_getFrameTimelinesLength() * AChoreographerFrameCallbackData_getFrameTimelinesLength() * */ */ AVsyncId AChoreographerFrameCallbackData_getFrameTimelineVsyncId( AVsyncId AChoreographerFrameCallbackData_getFrameTimelineVsyncId( const AChoreographerFrameCallbackData* data, size_t index) __INTRODUCED_IN(33); const AChoreographerFrameCallbackData* data, size_t index) __INTRODUCED_IN(33); Loading @@ -250,6 +259,8 @@ AVsyncId AChoreographerFrameCallbackData_getFrameTimelineVsyncId( * Gets the time in nanoseconds at which the frame described at the given \c index is expected to * Gets the time in nanoseconds at which the frame described at the given \c index is expected to * be presented. This time should be used to advance any animation clocks. * be presented. This time should be used to advance any animation clocks. * * * Available since API level 33. * * \param index index of a frame timeline, in \f( [0, FrameTimelinesLength) \f). See * \param index index of a frame timeline, in \f( [0, FrameTimelinesLength) \f). See * AChoreographerFrameCallbackData_getFrameTimelinesLength() * AChoreographerFrameCallbackData_getFrameTimelinesLength() */ */ Loading @@ -260,6 +271,8 @@ int64_t AChoreographerFrameCallbackData_getFrameTimelineExpectedPresentationTime * Gets the time in nanoseconds at which the frame described at the given \c index needs to be * Gets the time in nanoseconds at which the frame described at the given \c index needs to be * ready by in order to be presented on time. * ready by in order to be presented on time. * * * Available since API level 33. * * \param index index of a frame timeline, in \f( [0, FrameTimelinesLength) \f). See * \param index index of a frame timeline, in \f( [0, FrameTimelinesLength) \f). See * AChoreographerFrameCallbackData_getFrameTimelinesLength() * AChoreographerFrameCallbackData_getFrameTimelinesLength() */ */ Loading include/android/surface_control.h +6 −0 Original line number Original line Diff line number Diff line Loading @@ -524,6 +524,8 @@ void ASurfaceTransaction_setHdrMetadata_cta861_3(ASurfaceTransaction* transactio * Sets the desired extended range brightness for the layer. This only applies for layers whose * Sets the desired extended range brightness for the layer. This only applies for layers whose * dataspace has RANGE_EXTENDED set on it. * dataspace has RANGE_EXTENDED set on it. * * * Available since API level 34. * * @param surface_control The layer whose extended range brightness is being specified * @param surface_control The layer whose extended range brightness is being specified * @param currentBufferRatio The current hdr/sdr ratio of the current buffer as represented as * @param currentBufferRatio The current hdr/sdr ratio of the current buffer as represented as * peakHdrBrightnessInNits / targetSdrWhitePointInNits. For example if the * peakHdrBrightnessInNits / targetSdrWhitePointInNits. For example if the Loading Loading @@ -653,6 +655,8 @@ void ASurfaceTransaction_clearFrameRate(ASurfaceTransaction* transaction, * and pushing buffers earlier for server side queuing will be advantageous * and pushing buffers earlier for server side queuing will be advantageous * in such cases. * in such cases. * * * Available since API level 31. * * \param transaction The transaction in which to make the change. * \param transaction The transaction in which to make the change. * \param surface_control The ASurfaceControl on which to control buffer backpressure behavior. * \param surface_control The ASurfaceControl on which to control buffer backpressure behavior. * \param enableBackPressure Whether to enable back pressure. * \param enableBackPressure Whether to enable back pressure. Loading @@ -674,6 +678,8 @@ void ASurfaceTransaction_setEnableBackPressure(ASurfaceTransaction* transaction, * AChoreographer_postVsyncCallback(). The \c vsyncId can then be extracted from the * AChoreographer_postVsyncCallback(). The \c vsyncId can then be extracted from the * callback payload using AChoreographerFrameCallbackData_getFrameTimelineVsyncId(). * callback payload using AChoreographerFrameCallbackData_getFrameTimelineVsyncId(). * * * Available since API level 33. * * \param vsyncId The vsync ID received from AChoreographer, setting the frame's presentation target * \param vsyncId The vsync ID received from AChoreographer, setting the frame's presentation target * to the corresponding expected presentation time and deadline from the frame to be rendered. A * to the corresponding expected presentation time and deadline from the frame to be rendered. A * stale or invalid value will be ignored. * stale or invalid value will be ignored. Loading libs/jpegrecoverymap/Android.bp +2 −0 Original line number Original line Diff line number Diff line Loading @@ -32,6 +32,7 @@ cc_library { "jpegr.cpp", "jpegr.cpp", "recoverymapmath.cpp", "recoverymapmath.cpp", "jpegrutils.cpp", "jpegrutils.cpp", "multipictureformat.cpp", ], ], shared_libs: [ shared_libs: [ Loading @@ -40,6 +41,7 @@ cc_library { "libjpegencoder", "libjpegencoder", "libjpegdecoder", "libjpegdecoder", "liblog", "liblog", "libutils", ], ], static_libs: ["libskia"], static_libs: ["libskia"], Loading libs/jpegrecoverymap/include/jpegrecoverymap/jpegrutils.h +55 −10 Original line number Original line Diff line number Diff line Loading @@ -18,6 +18,7 @@ #define ANDROID_JPEGRECOVERYMAP_JPEGRUTILS_H #define ANDROID_JPEGRECOVERYMAP_JPEGRUTILS_H #include <jpegrecoverymap/jpegr.h> #include <jpegrecoverymap/jpegr.h> #include <utils/RefBase.h> #include <sstream> #include <sstream> #include <stdint.h> #include <stdint.h> Loading @@ -27,6 +28,26 @@ namespace android::jpegrecoverymap { namespace android::jpegrecoverymap { struct jpegr_metadata; struct jpegr_metadata; /* * Mutable data structure. Holds information for metadata. */ class DataStruct : public RefBase { private: void* data; int writePos; int length; ~DataStruct(); public: DataStruct(int s); void* getData(); int getLength(); int getBytesWritten(); bool write8(uint8_t value); bool write16(uint16_t value); bool write32(uint32_t value); bool write(const void* src, int size); }; /* /* * Helper function used for writing data to destination. * Helper function used for writing data to destination. Loading @@ -51,12 +72,10 @@ status_t Write(jr_compressed_ptr destination, const void* source, size_t length, bool getMetadataFromXMP(uint8_t* xmp_data, size_t xmp_size, jpegr_metadata* metadata); bool getMetadataFromXMP(uint8_t* xmp_data, size_t xmp_size, jpegr_metadata* metadata); /* /* * This method generates XMP metadata. * This method generates XMP metadata for the primary image. * * * below is an example of the XMP metadata that this function generates where * below is an example of the XMP metadata that this function generates where * secondary_image_length = 1000 * secondary_image_length = 1000 * max_content_boost = 8.0 * min_content_boost = 0.5 * * * <x:xmpmeta * <x:xmpmeta * xmlns:x="adobe:ns:meta/" * xmlns:x="adobe:ns:meta/" Loading @@ -65,8 +84,7 @@ bool getMetadataFromXMP(uint8_t* xmp_data, size_t xmp_size, jpegr_metadata* meta * xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> * xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> * <rdf:Description * <rdf:Description * xmlns:Container="http://ns.google.com/photos/1.0/container/" * xmlns:Container="http://ns.google.com/photos/1.0/container/" * xmlns:Item="http://ns.google.com/photos/1.0/container/item/" * xmlns:Item="http://ns.google.com/photos/1.0/container/item/"> * xmlns:RecoveryMap="http://ns.google.com/photos/1.0/recoverymap/"> * <Container:Directory> * <Container:Directory> * <rdf:Seq> * <rdf:Seq> * <rdf:li> * <rdf:li> Loading @@ -78,10 +96,7 @@ bool getMetadataFromXMP(uint8_t* xmp_data, size_t xmp_size, jpegr_metadata* meta * <Container:Item * <Container:Item * Item:Semantic="RecoveryMap" * Item:Semantic="RecoveryMap" * Item:Mime="image/jpeg" * Item:Mime="image/jpeg" * Item:Length="1000" * Item:Length="1000"/> * RecoveryMap:Version="1" * RecoveryMap:MaxContentBoost="8.0" * RecoveryMap:MinContentBoost="0.5"/> * </rdf:li> * </rdf:li> * </rdf:Seq> * </rdf:Seq> * </Container:Directory> * </Container:Directory> Loading @@ -90,10 +105,40 @@ bool getMetadataFromXMP(uint8_t* xmp_data, size_t xmp_size, jpegr_metadata* meta * </x:xmpmeta> * </x:xmpmeta> * * * @param secondary_image_length length of secondary image * @param secondary_image_length length of secondary image * @return XMP metadata in type of string */ std::string generateXmpForPrimaryImage(int secondary_image_length); /* * This method generates XMP metadata for the recovery map image. * * below is an example of the XMP metadata that this function generates where * max_content_boost = 8.0 * min_content_boost = 0.5 * * <x:xmpmeta * xmlns:x="adobe:ns:meta/" * x:xmptk="Adobe XMP Core 5.1.2"> * <rdf:RDF * xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> * <rdf:Description * xmlns:hdrgm="http://ns.adobe.com/hdr-gain-map/1.0/" * hdrgm:Version="1" * hdrgm:GainMapMin="0.5" * hdrgm:GainMapMax="8.5" * hdrgm:Gamma="1" * hdrgm:OffsetSDR="0" * hdrgm:OffsetHDR="0" * hdrgm:HDRCapacityMin="0.5" * hdrgm:HDRCapacityMax="8.5" * hdrgm:BaseRendition="SDR"/> * </rdf:RDF> * </x:xmpmeta> * * @param metadata JPEG/R metadata to encode as XMP * @param metadata JPEG/R metadata to encode as XMP * @return XMP metadata in type of string * @return XMP metadata in type of string */ */ std::string generateXmp(int secondary_image_length, jpegr_metadata& metadata); std::string generateXmpForSecondaryImage(jpegr_metadata& metadata); } // namespace android::jpegrecoverymap } // namespace android::jpegrecoverymap #endif //ANDROID_JPEGRECOVERYMAP_JPEGRUTILS_H #endif //ANDROID_JPEGRECOVERYMAP_JPEGRUTILS_H Loading
cmds/atrace/atrace.rc +14 −0 Original line number Original line Diff line number Diff line Loading @@ -307,6 +307,13 @@ on late-init on late-init && property:ro.boot.fastboot.boottrace=enabled on late-init && property:ro.boot.fastboot.boottrace=enabled setprop debug.atrace.tags.enableflags 802922 setprop debug.atrace.tags.enableflags 802922 setprop persist.traced.enable 0 setprop persist.traced.enable 0 write /sys/kernel/tracing/events/binder/binder_transaction/enable 1 write /sys/kernel/tracing/events/binder/binder_transaction_received/enable 1 write /sys/kernel/tracing/events/binder/binder_transaction_alloc_buf/enable 1 write /sys/kernel/tracing/events/binder/binder_set_priority/enable 1 write /sys/kernel/tracing/events/binder/binder_lock/enable 1 write /sys/kernel/tracing/events/binder/binder_locked/enable 1 write /sys/kernel/tracing/events/binder/binder_unlock/enable 1 write /sys/kernel/debug/tracing/tracing_on 1 write /sys/kernel/debug/tracing/tracing_on 1 write /sys/kernel/tracing/tracing_on 1 write /sys/kernel/tracing/tracing_on 1 Loading Loading @@ -415,6 +422,13 @@ service boottrace /system/bin/atrace --async_start -f /data/misc/boottrace/categ on property:sys.boot_completed=1 && property:ro.boot.fastboot.boottrace=enabled on property:sys.boot_completed=1 && property:ro.boot.fastboot.boottrace=enabled setprop debug.atrace.tags.enableflags 0 setprop debug.atrace.tags.enableflags 0 setprop persist.traced.enable 1 setprop persist.traced.enable 1 write /sys/kernel/tracing/events/binder/binder_transaction/enable 0 write /sys/kernel/tracing/events/binder/binder_transaction_received/enable 0 write /sys/kernel/tracing/events/binder/binder_transaction_alloc_buf/enable 0 write /sys/kernel/tracing/events/binder/binder_set_priority/enable 0 write /sys/kernel/tracing/events/binder/binder_lock/enable 0 write /sys/kernel/tracing/events/binder/binder_locked/enable 0 write /sys/kernel/tracing/events/binder/binder_unlock/enable 0 write /sys/kernel/debug/tracing/tracing_on 0 write /sys/kernel/debug/tracing/tracing_on 0 write /sys/kernel/tracing/tracing_on 0 write /sys/kernel/tracing/tracing_on 0
include/android/choreographer.h +13 −0 Original line number Original line Diff line number Diff line Loading @@ -219,12 +219,16 @@ void AChoreographer_unregisterRefreshRateCallback(AChoreographer* choreographer, * * * Note that this time should \b not be used to advance animation clocks. * Note that this time should \b not be used to advance animation clocks. * Instead, see AChoreographerFrameCallbackData_getFrameTimelineExpectedPresentationTimeNanos(). * Instead, see AChoreographerFrameCallbackData_getFrameTimelineExpectedPresentationTimeNanos(). * * Available since API level 33. */ */ int64_t AChoreographerFrameCallbackData_getFrameTimeNanos( int64_t AChoreographerFrameCallbackData_getFrameTimeNanos( const AChoreographerFrameCallbackData* data) __INTRODUCED_IN(33); const AChoreographerFrameCallbackData* data) __INTRODUCED_IN(33); /** /** * The number of possible frame timelines. * The number of possible frame timelines. * * Available since API level 33. */ */ size_t AChoreographerFrameCallbackData_getFrameTimelinesLength( size_t AChoreographerFrameCallbackData_getFrameTimelinesLength( const AChoreographerFrameCallbackData* data) __INTRODUCED_IN(33); const AChoreographerFrameCallbackData* data) __INTRODUCED_IN(33); Loading @@ -233,15 +237,20 @@ size_t AChoreographerFrameCallbackData_getFrameTimelinesLength( * Gets the index of the platform-preferred frame timeline. * Gets the index of the platform-preferred frame timeline. * The preferred frame timeline is the default * The preferred frame timeline is the default * by which the platform scheduled the app, based on the device configuration. * by which the platform scheduled the app, based on the device configuration. * * Available since API level 33. */ */ size_t AChoreographerFrameCallbackData_getPreferredFrameTimelineIndex( size_t AChoreographerFrameCallbackData_getPreferredFrameTimelineIndex( const AChoreographerFrameCallbackData* data) __INTRODUCED_IN(33); const AChoreographerFrameCallbackData* data) __INTRODUCED_IN(33); /** /** * Gets the token used by the platform to identify the frame timeline at the given \c index. * Gets the token used by the platform to identify the frame timeline at the given \c index. * q * Available since API level 33. * * * \param index index of a frame timeline, in \f( [0, FrameTimelinesLength) \f). See * \param index index of a frame timeline, in \f( [0, FrameTimelinesLength) \f). See * AChoreographerFrameCallbackData_getFrameTimelinesLength() * AChoreographerFrameCallbackData_getFrameTimelinesLength() * */ */ AVsyncId AChoreographerFrameCallbackData_getFrameTimelineVsyncId( AVsyncId AChoreographerFrameCallbackData_getFrameTimelineVsyncId( const AChoreographerFrameCallbackData* data, size_t index) __INTRODUCED_IN(33); const AChoreographerFrameCallbackData* data, size_t index) __INTRODUCED_IN(33); Loading @@ -250,6 +259,8 @@ AVsyncId AChoreographerFrameCallbackData_getFrameTimelineVsyncId( * Gets the time in nanoseconds at which the frame described at the given \c index is expected to * Gets the time in nanoseconds at which the frame described at the given \c index is expected to * be presented. This time should be used to advance any animation clocks. * be presented. This time should be used to advance any animation clocks. * * * Available since API level 33. * * \param index index of a frame timeline, in \f( [0, FrameTimelinesLength) \f). See * \param index index of a frame timeline, in \f( [0, FrameTimelinesLength) \f). See * AChoreographerFrameCallbackData_getFrameTimelinesLength() * AChoreographerFrameCallbackData_getFrameTimelinesLength() */ */ Loading @@ -260,6 +271,8 @@ int64_t AChoreographerFrameCallbackData_getFrameTimelineExpectedPresentationTime * Gets the time in nanoseconds at which the frame described at the given \c index needs to be * Gets the time in nanoseconds at which the frame described at the given \c index needs to be * ready by in order to be presented on time. * ready by in order to be presented on time. * * * Available since API level 33. * * \param index index of a frame timeline, in \f( [0, FrameTimelinesLength) \f). See * \param index index of a frame timeline, in \f( [0, FrameTimelinesLength) \f). See * AChoreographerFrameCallbackData_getFrameTimelinesLength() * AChoreographerFrameCallbackData_getFrameTimelinesLength() */ */ Loading
include/android/surface_control.h +6 −0 Original line number Original line Diff line number Diff line Loading @@ -524,6 +524,8 @@ void ASurfaceTransaction_setHdrMetadata_cta861_3(ASurfaceTransaction* transactio * Sets the desired extended range brightness for the layer. This only applies for layers whose * Sets the desired extended range brightness for the layer. This only applies for layers whose * dataspace has RANGE_EXTENDED set on it. * dataspace has RANGE_EXTENDED set on it. * * * Available since API level 34. * * @param surface_control The layer whose extended range brightness is being specified * @param surface_control The layer whose extended range brightness is being specified * @param currentBufferRatio The current hdr/sdr ratio of the current buffer as represented as * @param currentBufferRatio The current hdr/sdr ratio of the current buffer as represented as * peakHdrBrightnessInNits / targetSdrWhitePointInNits. For example if the * peakHdrBrightnessInNits / targetSdrWhitePointInNits. For example if the Loading Loading @@ -653,6 +655,8 @@ void ASurfaceTransaction_clearFrameRate(ASurfaceTransaction* transaction, * and pushing buffers earlier for server side queuing will be advantageous * and pushing buffers earlier for server side queuing will be advantageous * in such cases. * in such cases. * * * Available since API level 31. * * \param transaction The transaction in which to make the change. * \param transaction The transaction in which to make the change. * \param surface_control The ASurfaceControl on which to control buffer backpressure behavior. * \param surface_control The ASurfaceControl on which to control buffer backpressure behavior. * \param enableBackPressure Whether to enable back pressure. * \param enableBackPressure Whether to enable back pressure. Loading @@ -674,6 +678,8 @@ void ASurfaceTransaction_setEnableBackPressure(ASurfaceTransaction* transaction, * AChoreographer_postVsyncCallback(). The \c vsyncId can then be extracted from the * AChoreographer_postVsyncCallback(). The \c vsyncId can then be extracted from the * callback payload using AChoreographerFrameCallbackData_getFrameTimelineVsyncId(). * callback payload using AChoreographerFrameCallbackData_getFrameTimelineVsyncId(). * * * Available since API level 33. * * \param vsyncId The vsync ID received from AChoreographer, setting the frame's presentation target * \param vsyncId The vsync ID received from AChoreographer, setting the frame's presentation target * to the corresponding expected presentation time and deadline from the frame to be rendered. A * to the corresponding expected presentation time and deadline from the frame to be rendered. A * stale or invalid value will be ignored. * stale or invalid value will be ignored. Loading
libs/jpegrecoverymap/Android.bp +2 −0 Original line number Original line Diff line number Diff line Loading @@ -32,6 +32,7 @@ cc_library { "jpegr.cpp", "jpegr.cpp", "recoverymapmath.cpp", "recoverymapmath.cpp", "jpegrutils.cpp", "jpegrutils.cpp", "multipictureformat.cpp", ], ], shared_libs: [ shared_libs: [ Loading @@ -40,6 +41,7 @@ cc_library { "libjpegencoder", "libjpegencoder", "libjpegdecoder", "libjpegdecoder", "liblog", "liblog", "libutils", ], ], static_libs: ["libskia"], static_libs: ["libskia"], Loading
libs/jpegrecoverymap/include/jpegrecoverymap/jpegrutils.h +55 −10 Original line number Original line Diff line number Diff line Loading @@ -18,6 +18,7 @@ #define ANDROID_JPEGRECOVERYMAP_JPEGRUTILS_H #define ANDROID_JPEGRECOVERYMAP_JPEGRUTILS_H #include <jpegrecoverymap/jpegr.h> #include <jpegrecoverymap/jpegr.h> #include <utils/RefBase.h> #include <sstream> #include <sstream> #include <stdint.h> #include <stdint.h> Loading @@ -27,6 +28,26 @@ namespace android::jpegrecoverymap { namespace android::jpegrecoverymap { struct jpegr_metadata; struct jpegr_metadata; /* * Mutable data structure. Holds information for metadata. */ class DataStruct : public RefBase { private: void* data; int writePos; int length; ~DataStruct(); public: DataStruct(int s); void* getData(); int getLength(); int getBytesWritten(); bool write8(uint8_t value); bool write16(uint16_t value); bool write32(uint32_t value); bool write(const void* src, int size); }; /* /* * Helper function used for writing data to destination. * Helper function used for writing data to destination. Loading @@ -51,12 +72,10 @@ status_t Write(jr_compressed_ptr destination, const void* source, size_t length, bool getMetadataFromXMP(uint8_t* xmp_data, size_t xmp_size, jpegr_metadata* metadata); bool getMetadataFromXMP(uint8_t* xmp_data, size_t xmp_size, jpegr_metadata* metadata); /* /* * This method generates XMP metadata. * This method generates XMP metadata for the primary image. * * * below is an example of the XMP metadata that this function generates where * below is an example of the XMP metadata that this function generates where * secondary_image_length = 1000 * secondary_image_length = 1000 * max_content_boost = 8.0 * min_content_boost = 0.5 * * * <x:xmpmeta * <x:xmpmeta * xmlns:x="adobe:ns:meta/" * xmlns:x="adobe:ns:meta/" Loading @@ -65,8 +84,7 @@ bool getMetadataFromXMP(uint8_t* xmp_data, size_t xmp_size, jpegr_metadata* meta * xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> * xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> * <rdf:Description * <rdf:Description * xmlns:Container="http://ns.google.com/photos/1.0/container/" * xmlns:Container="http://ns.google.com/photos/1.0/container/" * xmlns:Item="http://ns.google.com/photos/1.0/container/item/" * xmlns:Item="http://ns.google.com/photos/1.0/container/item/"> * xmlns:RecoveryMap="http://ns.google.com/photos/1.0/recoverymap/"> * <Container:Directory> * <Container:Directory> * <rdf:Seq> * <rdf:Seq> * <rdf:li> * <rdf:li> Loading @@ -78,10 +96,7 @@ bool getMetadataFromXMP(uint8_t* xmp_data, size_t xmp_size, jpegr_metadata* meta * <Container:Item * <Container:Item * Item:Semantic="RecoveryMap" * Item:Semantic="RecoveryMap" * Item:Mime="image/jpeg" * Item:Mime="image/jpeg" * Item:Length="1000" * Item:Length="1000"/> * RecoveryMap:Version="1" * RecoveryMap:MaxContentBoost="8.0" * RecoveryMap:MinContentBoost="0.5"/> * </rdf:li> * </rdf:li> * </rdf:Seq> * </rdf:Seq> * </Container:Directory> * </Container:Directory> Loading @@ -90,10 +105,40 @@ bool getMetadataFromXMP(uint8_t* xmp_data, size_t xmp_size, jpegr_metadata* meta * </x:xmpmeta> * </x:xmpmeta> * * * @param secondary_image_length length of secondary image * @param secondary_image_length length of secondary image * @return XMP metadata in type of string */ std::string generateXmpForPrimaryImage(int secondary_image_length); /* * This method generates XMP metadata for the recovery map image. * * below is an example of the XMP metadata that this function generates where * max_content_boost = 8.0 * min_content_boost = 0.5 * * <x:xmpmeta * xmlns:x="adobe:ns:meta/" * x:xmptk="Adobe XMP Core 5.1.2"> * <rdf:RDF * xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> * <rdf:Description * xmlns:hdrgm="http://ns.adobe.com/hdr-gain-map/1.0/" * hdrgm:Version="1" * hdrgm:GainMapMin="0.5" * hdrgm:GainMapMax="8.5" * hdrgm:Gamma="1" * hdrgm:OffsetSDR="0" * hdrgm:OffsetHDR="0" * hdrgm:HDRCapacityMin="0.5" * hdrgm:HDRCapacityMax="8.5" * hdrgm:BaseRendition="SDR"/> * </rdf:RDF> * </x:xmpmeta> * * @param metadata JPEG/R metadata to encode as XMP * @param metadata JPEG/R metadata to encode as XMP * @return XMP metadata in type of string * @return XMP metadata in type of string */ */ std::string generateXmp(int secondary_image_length, jpegr_metadata& metadata); std::string generateXmpForSecondaryImage(jpegr_metadata& metadata); } // namespace android::jpegrecoverymap } // namespace android::jpegrecoverymap #endif //ANDROID_JPEGRECOVERYMAP_JPEGRUTILS_H #endif //ANDROID_JPEGRECOVERYMAP_JPEGRUTILS_H