Loading media/codec2/components/hevc/C2SoftHevcEnc.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -123,7 +123,7 @@ class C2SoftHevcEnc::IntfImpl : public SimpleInterface<void>::BaseParams { // matches size limits in codec library addParameter( DefineParam(mSize, C2_PARAMKEY_PICTURE_SIZE) .withDefault(new C2StreamPictureSizeInfo::input(0u, 320, 240)) .withDefault(new C2StreamPictureSizeInfo::input(0u, 64, 64)) .withFields({ C2F(mSize, width).inRange(2, 1920, 2), C2F(mSize, height).inRange(2, 1088, 2), Loading @@ -133,7 +133,7 @@ class C2SoftHevcEnc::IntfImpl : public SimpleInterface<void>::BaseParams { addParameter( DefineParam(mFrameRate, C2_PARAMKEY_FRAME_RATE) .withDefault(new C2StreamFrameRateInfo::output(0u, 30.)) .withDefault(new C2StreamFrameRateInfo::output(0u, 1.)) .withFields({C2F(mFrameRate, value).greaterThan(0.)}) .withSetter( Setter<decltype(*mFrameRate)>::StrictValueWithNoDeps) Loading media/libaudiohal/impl/Android.bp +4 −2 Original line number Diff line number Diff line Loading @@ -143,8 +143,9 @@ cc_library_shared { ":audio_core_hal_client_sources", ":audio_effect_hal_client_sources", ], shared_libs: [ static_libs: [ "android.hardware.audio.common@7.0", "android.hardware.audio.common@7.0-enums", "android.hardware.audio.common@7.0-util", "android.hardware.audio.effect@7.0", "android.hardware.audio.effect@7.0-util", Loading @@ -164,8 +165,9 @@ cc_library_shared { srcs: [ ":audio_core_hal_client_sources", ], shared_libs: [ static_libs: [ "android.hardware.audio.common@7.0", "android.hardware.audio.common@7.1-enums", "android.hardware.audio.common@7.1-util", "android.hardware.audio@7.0", "android.hardware.audio@7.1", Loading services/camera/libcameraservice/api2/CompositeStream.h +35 −0 Original line number Diff line number Diff line Loading @@ -117,6 +117,41 @@ protected: // Composite streams should behave accordingly. void enableErrorState(); // Utility class to lock and unlock a GraphicBuffer class GraphicBufferLocker { public: GraphicBufferLocker(sp<GraphicBuffer> buffer) : _buffer(buffer) {} status_t lockAsync(void** dstBuffer, int fenceFd) { if (_buffer == nullptr) return BAD_VALUE; status_t res = OK; if (!_locked) { status_t res = _buffer->lockAsync(GRALLOC_USAGE_SW_WRITE_OFTEN, dstBuffer, fenceFd); if (res == OK) { _locked = true; } } return res; } ~GraphicBufferLocker() { if (_locked && _buffer != nullptr) { auto res = _buffer->unlock(); if (res != OK) { ALOGE("%s: Error trying to unlock buffer: %s (%d)", __FUNCTION__, strerror(-res), res); } } } private: sp<GraphicBuffer> _buffer; bool _locked = false; }; wp<CameraDeviceBase> mDevice; wp<camera3::StatusTracker> mStatusTracker; wp<hardware::camera2::ICameraDeviceCallbacks> mRemoteCallback; Loading services/camera/libcameraservice/api2/DepthCompositeStream.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -297,7 +297,8 @@ status_t DepthCompositeStream::processInputFrame(nsecs_t ts, const InputFrame &i } sp<GraphicBuffer> gb = GraphicBuffer::from(anb); res = gb->lockAsync(GRALLOC_USAGE_SW_WRITE_OFTEN, &dstBuffer, fenceFd); GraphicBufferLocker gbLocker(gb); res = gbLocker.lockAsync(&dstBuffer, fenceFd); if (res != OK) { ALOGE("%s: Error trying to lock output buffer fence: %s (%d)", __FUNCTION__, strerror(-res), res); Loading services/camera/libcameraservice/api2/HeicCompositeStream.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -1130,7 +1130,8 @@ status_t HeicCompositeStream::processCompletedInputFrame(int64_t frameNumber, // Copy the content of the file to memory. sp<GraphicBuffer> gb = GraphicBuffer::from(inputFrame.anb); void* dstBuffer; auto res = gb->lockAsync(GRALLOC_USAGE_SW_WRITE_OFTEN, &dstBuffer, inputFrame.fenceFd); GraphicBufferLocker gbLocker(gb); auto res = gbLocker.lockAsync(&dstBuffer, inputFrame.fenceFd); if (res != OK) { ALOGE("%s: Error trying to lock output buffer fence: %s (%d)", __FUNCTION__, strerror(-res), res); Loading Loading
media/codec2/components/hevc/C2SoftHevcEnc.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -123,7 +123,7 @@ class C2SoftHevcEnc::IntfImpl : public SimpleInterface<void>::BaseParams { // matches size limits in codec library addParameter( DefineParam(mSize, C2_PARAMKEY_PICTURE_SIZE) .withDefault(new C2StreamPictureSizeInfo::input(0u, 320, 240)) .withDefault(new C2StreamPictureSizeInfo::input(0u, 64, 64)) .withFields({ C2F(mSize, width).inRange(2, 1920, 2), C2F(mSize, height).inRange(2, 1088, 2), Loading @@ -133,7 +133,7 @@ class C2SoftHevcEnc::IntfImpl : public SimpleInterface<void>::BaseParams { addParameter( DefineParam(mFrameRate, C2_PARAMKEY_FRAME_RATE) .withDefault(new C2StreamFrameRateInfo::output(0u, 30.)) .withDefault(new C2StreamFrameRateInfo::output(0u, 1.)) .withFields({C2F(mFrameRate, value).greaterThan(0.)}) .withSetter( Setter<decltype(*mFrameRate)>::StrictValueWithNoDeps) Loading
media/libaudiohal/impl/Android.bp +4 −2 Original line number Diff line number Diff line Loading @@ -143,8 +143,9 @@ cc_library_shared { ":audio_core_hal_client_sources", ":audio_effect_hal_client_sources", ], shared_libs: [ static_libs: [ "android.hardware.audio.common@7.0", "android.hardware.audio.common@7.0-enums", "android.hardware.audio.common@7.0-util", "android.hardware.audio.effect@7.0", "android.hardware.audio.effect@7.0-util", Loading @@ -164,8 +165,9 @@ cc_library_shared { srcs: [ ":audio_core_hal_client_sources", ], shared_libs: [ static_libs: [ "android.hardware.audio.common@7.0", "android.hardware.audio.common@7.1-enums", "android.hardware.audio.common@7.1-util", "android.hardware.audio@7.0", "android.hardware.audio@7.1", Loading
services/camera/libcameraservice/api2/CompositeStream.h +35 −0 Original line number Diff line number Diff line Loading @@ -117,6 +117,41 @@ protected: // Composite streams should behave accordingly. void enableErrorState(); // Utility class to lock and unlock a GraphicBuffer class GraphicBufferLocker { public: GraphicBufferLocker(sp<GraphicBuffer> buffer) : _buffer(buffer) {} status_t lockAsync(void** dstBuffer, int fenceFd) { if (_buffer == nullptr) return BAD_VALUE; status_t res = OK; if (!_locked) { status_t res = _buffer->lockAsync(GRALLOC_USAGE_SW_WRITE_OFTEN, dstBuffer, fenceFd); if (res == OK) { _locked = true; } } return res; } ~GraphicBufferLocker() { if (_locked && _buffer != nullptr) { auto res = _buffer->unlock(); if (res != OK) { ALOGE("%s: Error trying to unlock buffer: %s (%d)", __FUNCTION__, strerror(-res), res); } } } private: sp<GraphicBuffer> _buffer; bool _locked = false; }; wp<CameraDeviceBase> mDevice; wp<camera3::StatusTracker> mStatusTracker; wp<hardware::camera2::ICameraDeviceCallbacks> mRemoteCallback; Loading
services/camera/libcameraservice/api2/DepthCompositeStream.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -297,7 +297,8 @@ status_t DepthCompositeStream::processInputFrame(nsecs_t ts, const InputFrame &i } sp<GraphicBuffer> gb = GraphicBuffer::from(anb); res = gb->lockAsync(GRALLOC_USAGE_SW_WRITE_OFTEN, &dstBuffer, fenceFd); GraphicBufferLocker gbLocker(gb); res = gbLocker.lockAsync(&dstBuffer, fenceFd); if (res != OK) { ALOGE("%s: Error trying to lock output buffer fence: %s (%d)", __FUNCTION__, strerror(-res), res); Loading
services/camera/libcameraservice/api2/HeicCompositeStream.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -1130,7 +1130,8 @@ status_t HeicCompositeStream::processCompletedInputFrame(int64_t frameNumber, // Copy the content of the file to memory. sp<GraphicBuffer> gb = GraphicBuffer::from(inputFrame.anb); void* dstBuffer; auto res = gb->lockAsync(GRALLOC_USAGE_SW_WRITE_OFTEN, &dstBuffer, inputFrame.fenceFd); GraphicBufferLocker gbLocker(gb); auto res = gbLocker.lockAsync(&dstBuffer, inputFrame.fenceFd); if (res != OK) { ALOGE("%s: Error trying to lock output buffer fence: %s (%d)", __FUNCTION__, strerror(-res), res); Loading