Loading services/camera/libcameraservice/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ cc_defaults { "libcamera_metadata", "libfmq", "libgui", "libguiflags", "libhardware", "libhidlbase", "libimage_io", Loading Loading @@ -169,6 +170,7 @@ cc_library { "device3/Camera3OutputStreamInterface.cpp", "device3/Camera3OutputUtils.cpp", "device3/Camera3DeviceInjectionMethods.cpp", "device3/deprecated/DeprecatedCamera3StreamSplitter.cpp", "device3/UHRCropAndMeteringRegionMapper.cpp", "device3/PreviewFrameSpacer.cpp", "device3/hidl/HidlCamera3Device.cpp", Loading services/camera/libcameraservice/device3/Camera3SharedOutputStream.cpp +11 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ #define ATRACE_TAG ATRACE_TAG_CAMERA //#define LOG_NDEBUG 0 #include "Flags.h" #include "Camera3SharedOutputStream.h" namespace android { Loading Loading @@ -59,7 +61,11 @@ Camera3SharedOutputStream::~Camera3SharedOutputStream() { status_t Camera3SharedOutputStream::connectStreamSplitterLocked() { status_t res = OK; mStreamSplitter = new Camera3StreamSplitter(mUseHalBufManager); #if USE_NEW_STREAM_SPLITTER mStreamSplitter = sp<Camera3StreamSplitter>::make(mUseHalBufManager); #else mStreamSplitter = sp<DeprecatedCamera3StreamSplitter>::make(mUseHalBufManager); #endif // USE_NEW_STREAM_SPLITTER uint64_t usage = 0; getEndpointUsage(&usage); Loading Loading @@ -90,7 +96,11 @@ status_t Camera3SharedOutputStream::attachBufferToSplitterLocked( // Attach the buffer to the splitter output queues. This could block if // the output queue doesn't have any empty slot. So unlock during the course // of attachBufferToOutputs. #if USE_NEW_STREAM_SPLITTER sp<Camera3StreamSplitter> splitter = mStreamSplitter; #else sp<DeprecatedCamera3StreamSplitter> splitter = mStreamSplitter; #endif // USE_NEW_STREAM_SPLITTER mLock.unlock(); res = splitter->attachBufferToOutputs(anb, surface_ids); mLock.lock(); Loading services/camera/libcameraservice/device3/Camera3SharedOutputStream.h +13 −2 Original line number Diff line number Diff line Loading @@ -18,9 +18,17 @@ #define ANDROID_SERVERS_CAMERA3_SHARED_OUTPUT_STREAM_H #include <array> #include "Camera3StreamSplitter.h" #include "Flags.h" #include "Camera3OutputStream.h" #if USE_NEW_STREAM_SPLITTER #include "Camera3StreamSplitter.h" #else #include "deprecated/DeprecatedCamera3StreamSplitter.h" #endif // USE_NEW_STREAM_SPLITTER namespace android { namespace camera3 { Loading Loading @@ -106,8 +114,11 @@ private: * The Camera3StreamSplitter object this stream uses for stream * sharing. */ #if USE_NEW_STREAM_SPLITTER sp<Camera3StreamSplitter> mStreamSplitter; #else sp<DeprecatedCamera3StreamSplitter> mStreamSplitter; #endif // USE_NEW_STREAM_SPLITTER /** * Initialize stream splitter. */ Loading services/camera/libcameraservice/device3/Flags.h 0 → 100644 +27 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * 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. */ #pragma once #include <com_android_graphics_libgui_flags.h> #ifndef USE_NEW_STREAM_SPLITTER #define USE_NEW_STREAM_SPLITTER \ COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(WB_STREAM_SPLITTER) && \ COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(WB_PLATFORM_API_IMPROVEMENTS) #endif // USE_NEW_STREAM_SPLITTER services/camera/libcameraservice/device3/deprecated/DeprecatedCamera3StreamSplitter.cpp 0 → 100644 +820 −0 File added.Preview size limit exceeded, changes collapsed. Show changes Loading
services/camera/libcameraservice/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ cc_defaults { "libcamera_metadata", "libfmq", "libgui", "libguiflags", "libhardware", "libhidlbase", "libimage_io", Loading Loading @@ -169,6 +170,7 @@ cc_library { "device3/Camera3OutputStreamInterface.cpp", "device3/Camera3OutputUtils.cpp", "device3/Camera3DeviceInjectionMethods.cpp", "device3/deprecated/DeprecatedCamera3StreamSplitter.cpp", "device3/UHRCropAndMeteringRegionMapper.cpp", "device3/PreviewFrameSpacer.cpp", "device3/hidl/HidlCamera3Device.cpp", Loading
services/camera/libcameraservice/device3/Camera3SharedOutputStream.cpp +11 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ #define ATRACE_TAG ATRACE_TAG_CAMERA //#define LOG_NDEBUG 0 #include "Flags.h" #include "Camera3SharedOutputStream.h" namespace android { Loading Loading @@ -59,7 +61,11 @@ Camera3SharedOutputStream::~Camera3SharedOutputStream() { status_t Camera3SharedOutputStream::connectStreamSplitterLocked() { status_t res = OK; mStreamSplitter = new Camera3StreamSplitter(mUseHalBufManager); #if USE_NEW_STREAM_SPLITTER mStreamSplitter = sp<Camera3StreamSplitter>::make(mUseHalBufManager); #else mStreamSplitter = sp<DeprecatedCamera3StreamSplitter>::make(mUseHalBufManager); #endif // USE_NEW_STREAM_SPLITTER uint64_t usage = 0; getEndpointUsage(&usage); Loading Loading @@ -90,7 +96,11 @@ status_t Camera3SharedOutputStream::attachBufferToSplitterLocked( // Attach the buffer to the splitter output queues. This could block if // the output queue doesn't have any empty slot. So unlock during the course // of attachBufferToOutputs. #if USE_NEW_STREAM_SPLITTER sp<Camera3StreamSplitter> splitter = mStreamSplitter; #else sp<DeprecatedCamera3StreamSplitter> splitter = mStreamSplitter; #endif // USE_NEW_STREAM_SPLITTER mLock.unlock(); res = splitter->attachBufferToOutputs(anb, surface_ids); mLock.lock(); Loading
services/camera/libcameraservice/device3/Camera3SharedOutputStream.h +13 −2 Original line number Diff line number Diff line Loading @@ -18,9 +18,17 @@ #define ANDROID_SERVERS_CAMERA3_SHARED_OUTPUT_STREAM_H #include <array> #include "Camera3StreamSplitter.h" #include "Flags.h" #include "Camera3OutputStream.h" #if USE_NEW_STREAM_SPLITTER #include "Camera3StreamSplitter.h" #else #include "deprecated/DeprecatedCamera3StreamSplitter.h" #endif // USE_NEW_STREAM_SPLITTER namespace android { namespace camera3 { Loading Loading @@ -106,8 +114,11 @@ private: * The Camera3StreamSplitter object this stream uses for stream * sharing. */ #if USE_NEW_STREAM_SPLITTER sp<Camera3StreamSplitter> mStreamSplitter; #else sp<DeprecatedCamera3StreamSplitter> mStreamSplitter; #endif // USE_NEW_STREAM_SPLITTER /** * Initialize stream splitter. */ Loading
services/camera/libcameraservice/device3/Flags.h 0 → 100644 +27 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * 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. */ #pragma once #include <com_android_graphics_libgui_flags.h> #ifndef USE_NEW_STREAM_SPLITTER #define USE_NEW_STREAM_SPLITTER \ COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(WB_STREAM_SPLITTER) && \ COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(WB_PLATFORM_API_IMPROVEMENTS) #endif // USE_NEW_STREAM_SPLITTER
services/camera/libcameraservice/device3/deprecated/DeprecatedCamera3StreamSplitter.cpp 0 → 100644 +820 −0 File added.Preview size limit exceeded, changes collapsed. Show changes