• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022-2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include "scale_convert_process.h"
17 
18 #include "libyuv.h"
19 #include "dcamera_utils_tools.h"
20 #include "distributed_camera_constants.h"
21 #include "distributed_camera_errno.h"
22 #include "distributed_hardware_log.h"
23 #include "dcamera_frame_info.h"
24 
25 namespace OHOS {
26 namespace DistributedHardware {
~ScaleConvertProcess()27 ScaleConvertProcess::~ScaleConvertProcess()
28 {
29     if (isScaleConvert_.load()) {
30         DHLOGI("~ScaleConvertProcess : ReleaseProcessNode");
31         ReleaseProcessNode();
32     }
33 }
34 
InitNode(const VideoConfigParams & sourceConfig,const VideoConfigParams & targetConfig,VideoConfigParams & processedConfig)35 int32_t ScaleConvertProcess::InitNode(const VideoConfigParams& sourceConfig, const VideoConfigParams& targetConfig,
36     VideoConfigParams& processedConfig)
37 {
38     DHLOGI("ScaleConvertProcess : InitNode.");
39     sourceConfig_ = sourceConfig;
40     targetConfig_ = targetConfig;
41     processedConfig_ = sourceConfig;
42     processedConfig_.SetWidthAndHeight(targetConfig.GetWidth(), targetConfig.GetHeight());
43     processedConfig_.SetVideoformat(targetConfig.GetVideoformat());
44     processedConfig = processedConfig_;
45 
46     if (!IsConvertible(sourceConfig, targetConfig)) {
47         DHLOGI("sourceConfig: Videoformat %d Width %d, Height %d is the same as the targetConfig: "
48             "Videoformat %d Width %d, Height %d.",
49             sourceConfig.GetVideoformat(), sourceConfig.GetWidth(), sourceConfig.GetHeight(),
50             targetConfig.GetVideoformat(), targetConfig.GetWidth(), targetConfig.GetHeight());
51     }
52 
53     isScaleConvert_.store(true);
54     return DCAMERA_OK;
55 }
56 
IsConvertible(const VideoConfigParams & sourceConfig,const VideoConfigParams & targetConfig)57 bool ScaleConvertProcess::IsConvertible(const VideoConfigParams& sourceConfig, const VideoConfigParams& targetConfig)
58 {
59     return (sourceConfig_.GetWidth() != targetConfig.GetWidth()) ||
60         (sourceConfig_.GetHeight() != targetConfig.GetHeight()) ||
61         (sourceConfig_.GetVideoformat() != targetConfig.GetVideoformat());
62 }
63 
ReleaseProcessNode()64 void ScaleConvertProcess::ReleaseProcessNode()
65 {
66     DHLOGI("Start release [%d] node : ScaleConvertNode.", nodeRank_);
67     isScaleConvert_.store(false);
68 
69     if (nextDataProcess_ != nullptr) {
70         nextDataProcess_->ReleaseProcessNode();
71         nextDataProcess_ = nullptr;
72     }
73     DHLOGI("Release [%d] node : ScaleConvertNode end.", nodeRank_);
74 }
75 
ProcessData(std::vector<std::shared_ptr<DataBuffer>> & inputBuffers)76 int ScaleConvertProcess::ProcessData(std::vector<std::shared_ptr<DataBuffer>>& inputBuffers)
77 {
78     int64_t startScaleTime = GetNowTimeStampUs();
79     DHLOGD("Process data in ScaleConvertProcess.");
80     if (!isScaleConvert_.load()) {
81         DHLOGE("Scale Convert node occurred error or start release.");
82         return DCAMERA_DISABLE_PROCESS;
83     }
84 
85     if (inputBuffers.empty() || inputBuffers[0] == nullptr) {
86         DHLOGE("The input data buffers is empty.");
87         return DCAMERA_BAD_VALUE;
88     }
89     inputBuffers[0]->frameInfo_.timePonit.startScale = startScaleTime;
90 
91     if (!IsConvertible(sourceConfig_, processedConfig_)) {
92         DHLOGD("The target resolution: %dx%d format: %d is the same as the source resolution: %dx%d format: %d",
93             processedConfig_.GetWidth(), processedConfig_.GetHeight(), processedConfig_.GetVideoformat(),
94             sourceConfig_.GetWidth(), sourceConfig_.GetHeight(), sourceConfig_.GetVideoformat());
95         return ConvertDone(inputBuffers);
96     }
97 
98     ImageUnitInfo srcImgInfo {Videoformat::YUVI420, 0, 0, 0, 0, 0, 0, nullptr};
99     if ((GetImageUnitInfo(srcImgInfo, inputBuffers[0]) != DCAMERA_OK) || !CheckScaleProcessInputInfo(srcImgInfo)) {
100         DHLOGE("ScaleConvertProcess : srcImgInfo error.");
101         return DCAMERA_BAD_VALUE;
102     }
103 
104     size_t dstBuffSize = 0;
105     CalculateBuffSize(dstBuffSize);
106     std::shared_ptr<DataBuffer> dstBuf = std::make_shared<DataBuffer>(dstBuffSize);
107     ImageUnitInfo dstImgInfo = { processedConfig_.GetVideoformat(), processedConfig_.GetWidth(),
108         processedConfig_.GetHeight(), processedConfig_.GetWidth(), processedConfig_.GetHeight(),
109         processedConfig_.GetWidth() * processedConfig_.GetHeight(), dstBuf->Size(), dstBuf };
110     if (ScaleConvert(srcImgInfo, dstImgInfo) != DCAMERA_OK) {
111         DHLOGE("ScaleConvertProcess : Scale convert failed.");
112         return DCAMERA_BAD_OPERATE;
113     }
114 
115     dstBuf->frameInfo_ = inputBuffers[0]->frameInfo_;
116     dstBuf->SetInt32("Videoformat", static_cast<int32_t>(processedConfig_.GetVideoformat()));
117     dstBuf->SetInt32("alignedWidth", processedConfig_.GetWidth());
118     dstBuf->SetInt32("alignedHeight", processedConfig_.GetHeight());
119     dstBuf->SetInt32("width", processedConfig_.GetWidth());
120     dstBuf->SetInt32("height", processedConfig_.GetHeight());
121 
122     std::vector<std::shared_ptr<DataBuffer>> outputBuffers;
123     outputBuffers.push_back(dstBuf);
124     return ConvertDone(outputBuffers);
125 }
126 
CalculateBuffSize(size_t & dstBuffSize)127 void ScaleConvertProcess::CalculateBuffSize(size_t& dstBuffSize)
128 {
129     if (processedConfig_.GetVideoformat() == Videoformat::RGBA_8888) {
130         dstBuffSize = static_cast<size_t>(processedConfig_.GetWidth() * processedConfig_.GetHeight() *
131             RGB32_MEMORY_COEFFICIENT);
132     } else {
133         dstBuffSize = static_cast<size_t>(
134             processedConfig_.GetWidth() * processedConfig_.GetHeight() * YUV_BYTES_PER_PIXEL / Y2UV_RATIO);
135     }
136 }
137 
GetImageUnitInfo(ImageUnitInfo & imgInfo,const std::shared_ptr<DataBuffer> & imgBuf)138 int32_t ScaleConvertProcess::GetImageUnitInfo(ImageUnitInfo& imgInfo, const std::shared_ptr<DataBuffer>& imgBuf)
139 {
140     if (imgBuf == nullptr) {
141         DHLOGE("GetImageUnitInfo failed, imgBuf is nullptr.");
142         return DCAMERA_BAD_VALUE;
143     }
144 
145     bool findErr = true;
146     int32_t colorFormat = 0;
147     findErr = findErr && imgBuf->FindInt32("Videoformat", colorFormat);
148     if (!findErr) {
149         DHLOGE("GetImageUnitInfo failed, Videoformat is null.");
150         return DCAMERA_NOT_FOUND;
151     }
152     if (colorFormat != static_cast<int32_t>(Videoformat::YUVI420) &&
153         colorFormat != static_cast<int32_t>(Videoformat::NV12) &&
154         colorFormat != static_cast<int32_t>(Videoformat::NV21)) {
155         DHLOGE("GetImageUnitInfo failed, colorFormat %d are not supported.", colorFormat);
156         return DCAMERA_NOT_FOUND;
157     }
158     imgInfo.colorFormat = static_cast<Videoformat>(colorFormat);
159     findErr = findErr && imgBuf->FindInt32("width", imgInfo.width);
160     findErr = findErr && imgBuf->FindInt32("height", imgInfo.height);
161     findErr = findErr && imgBuf->FindInt32("alignedWidth", imgInfo.alignedWidth);
162     findErr = findErr && imgBuf->FindInt32("alignedHeight", imgInfo.alignedHeight);
163     if (!findErr) {
164         DHLOGE("GetImageUnitInfo failed, width %d, height %d, alignedWidth %d, alignedHeight %d.",
165             imgInfo.width, imgInfo.height, imgInfo.alignedWidth, imgInfo.alignedHeight);
166         return DCAMERA_NOT_FOUND;
167     }
168 
169     imgInfo.chromaOffset = static_cast<size_t>(imgInfo.alignedWidth * imgInfo.alignedHeight);
170     imgInfo.imgSize = imgBuf->Size();
171     imgInfo.imgData = imgBuf;
172 
173     DHLOGD("ScaleConvertProcess imgBuf info : Videoformat %d, alignedWidth %d, alignedHeight %d, width %d, height %d" +
174         ", chromaOffset %d, imgSize %d.", imgInfo.colorFormat, imgInfo.alignedWidth, imgInfo.alignedHeight,
175         imgInfo.width, imgInfo.height, imgInfo.chromaOffset, imgInfo.imgSize);
176     return DCAMERA_OK;
177 }
178 
CheckScaleProcessInputInfo(const ImageUnitInfo & srcImgInfo)179 bool ScaleConvertProcess::CheckScaleProcessInputInfo(const ImageUnitInfo& srcImgInfo)
180 {
181     return srcImgInfo.colorFormat == Videoformat::YUVI420 &&
182         srcImgInfo.width == sourceConfig_.GetWidth() &&
183         srcImgInfo.height == sourceConfig_.GetHeight() &&
184         IsCorrectImageUnitInfo(srcImgInfo);
185 }
186 
CheckScaleConvertInfo(const ImageUnitInfo & srcImgInfo,const ImageUnitInfo & dstImgInfo)187 bool ScaleConvertProcess::CheckScaleConvertInfo(const ImageUnitInfo& srcImgInfo, const ImageUnitInfo& dstImgInfo)
188 {
189     if (srcImgInfo.imgData == nullptr || dstImgInfo.imgData == nullptr) {
190         DHLOGE("The imgData of srcImgInfo or the imgData of dstImgInfo are null!");
191         return false;
192     }
193 
194     if (!IsCorrectImageUnitInfo(srcImgInfo)) {
195         DHLOGE("srcImginfo fail: width %d, height %d, alignedWidth %d, alignedHeight %d, chromaOffset %lld, " +
196             "imgSize %lld.", srcImgInfo.width, srcImgInfo.height, srcImgInfo.alignedWidth, srcImgInfo.alignedHeight,
197             srcImgInfo.chromaOffset, srcImgInfo.imgSize);
198         return false;
199     }
200 
201     if (!IsCorrectImageUnitInfo(dstImgInfo)) {
202         DHLOGE("dstImginfo fail: width %d, height %d, alignedWidth %d, alignedHeight %d, chromaOffset %lld, " +
203             "imgSize %lld.", dstImgInfo.width, dstImgInfo.height, dstImgInfo.alignedWidth, dstImgInfo.alignedHeight,
204             dstImgInfo.chromaOffset, dstImgInfo.imgSize);
205         return false;
206     }
207 
208     if ((dstImgInfo.width == srcImgInfo.alignedWidth) && (dstImgInfo.height == srcImgInfo.alignedHeight) &&
209         (dstImgInfo.colorFormat == srcImgInfo.colorFormat)) {
210         DHLOGE("Comparison ImgInfo fail: dstwidth %d, dstheight %d, dstColorFormat %d, "
211             "srcAlignedWidth %d, srcAlignedHeight %d, srcColorFormat %d.",
212             dstImgInfo.width, dstImgInfo.height, dstImgInfo.colorFormat,
213             srcImgInfo.alignedWidth, srcImgInfo.alignedHeight, srcImgInfo.colorFormat);
214         return false;
215     }
216 
217     return true;
218 }
219 
IsCorrectImageUnitInfo(const ImageUnitInfo & imgInfo)220 bool ScaleConvertProcess::IsCorrectImageUnitInfo(const ImageUnitInfo& imgInfo)
221 {
222     size_t expectedImgSize = static_cast<size_t>(imgInfo.alignedWidth * imgInfo.alignedHeight *
223         YUV_BYTES_PER_PIXEL / Y2UV_RATIO);
224     size_t expectedChromaOffset = static_cast<size_t>(imgInfo.alignedWidth * imgInfo.alignedHeight);
225     return (imgInfo.width <= imgInfo.alignedWidth && imgInfo.height <= imgInfo.alignedHeight &&
226         imgInfo.imgSize >= expectedImgSize && imgInfo.chromaOffset == expectedChromaOffset);
227 }
228 
ScaleConvert(ImageUnitInfo & srcImgInfo,ImageUnitInfo & dstImgInfo)229 int32_t ScaleConvertProcess::ScaleConvert(ImageUnitInfo& srcImgInfo, ImageUnitInfo& dstImgInfo)
230 {
231     DHLOGD("Scale convert start.");
232     if (!CheckScaleConvertInfo(srcImgInfo, dstImgInfo)) {
233         DHLOGE("CheckScaleConvertInfo failed.");
234         return DCAMERA_BAD_VALUE;
235     }
236 
237     std::shared_ptr<DataBuffer> dstBuf =
238         std::make_shared<DataBuffer>(dstImgInfo.width * dstImgInfo.height * YUV_BYTES_PER_PIXEL / Y2UV_RATIO);
239     int32_t ret = ConvertResolution(srcImgInfo, dstImgInfo, dstBuf);
240     if (ret != DCAMERA_OK) {
241         DHLOGE("Convert I420 scale failed.");
242         return ret;
243     }
244 
245     if (processedConfig_.GetVideoformat() == Videoformat::NV21) {
246         ret = ConvertFormatToNV21(srcImgInfo, dstImgInfo, dstBuf);
247     } else if (processedConfig_.GetVideoformat() == Videoformat::RGBA_8888) {
248         ret = ConvertFormatToRGBA(srcImgInfo, dstImgInfo, dstBuf);
249     }
250     if (ret != DCAMERA_OK) {
251         DHLOGE("Convert I420 to format: %d failed.", processedConfig_.GetVideoformat());
252         return ret;
253     }
254 
255     DHLOGD("Scale convert end.");
256     return DCAMERA_OK;
257 }
258 
ConvertResolution(ImageUnitInfo & srcImgInfo,ImageUnitInfo & dstImgInfo,std::shared_ptr<DataBuffer> & dstBuf)259 int32_t ScaleConvertProcess::ConvertResolution(ImageUnitInfo& srcImgInfo, ImageUnitInfo& dstImgInfo,
260     std::shared_ptr<DataBuffer>& dstBuf)
261 {
262     if ((srcImgInfo.width == dstImgInfo.width) && (srcImgInfo.height == dstImgInfo.height)) {
263         dstBuf = srcImgInfo.imgData;
264         DHLOGD("Convert I420 Scale: srcImgInfo is the same as dstImgInfo");
265         return DCAMERA_OK;
266     }
267 
268     DHLOGD("Convert I420 Scale: format=%d, width=[%d, %d], height=[%d, %d]", srcImgInfo.colorFormat,
269         srcImgInfo.width, srcImgInfo.alignedWidth, srcImgInfo.height, srcImgInfo.alignedHeight);
270     int srcSizeY = srcImgInfo.width * srcImgInfo.height;
271     int srcSizeUV = (static_cast<uint32_t>(srcImgInfo.width) >> MEMORY_RATIO_UV) *
272                     (static_cast<uint32_t>(srcImgInfo.height) >> MEMORY_RATIO_UV);
273     uint8_t *srcDataY = srcImgInfo.imgData->Data();
274     uint8_t *srcDataU = srcImgInfo.imgData->Data() + srcSizeY;
275     uint8_t *srcDataV = srcImgInfo.imgData->Data() + srcSizeY + srcSizeUV;
276 
277     int dstSizeY = dstImgInfo.width * dstImgInfo.height;
278     int dstSizeUV = (static_cast<uint32_t>(dstImgInfo.width) >> MEMORY_RATIO_UV) *
279                     (static_cast<uint32_t>(dstImgInfo.height) >> MEMORY_RATIO_UV);
280     uint8_t *dstDataY = dstBuf->Data();
281     uint8_t *dstDataU = dstBuf->Data() + dstSizeY;
282     uint8_t *dstDataV = dstBuf->Data() + dstSizeY + dstSizeUV;
283 
284     int32_t ret = libyuv::I420Scale(
285         srcDataY, srcImgInfo.width,
286         srcDataU, static_cast<uint32_t>(srcImgInfo.width) >> MEMORY_RATIO_UV,
287         srcDataV, static_cast<uint32_t>(srcImgInfo.width) >> MEMORY_RATIO_UV,
288         srcImgInfo.width, srcImgInfo.height,
289         dstDataY, dstImgInfo.width,
290         dstDataU, static_cast<uint32_t>(dstImgInfo.width) >> MEMORY_RATIO_UV,
291         dstDataV, static_cast<uint32_t>(dstImgInfo.width) >> MEMORY_RATIO_UV,
292         dstImgInfo.width, dstImgInfo.height,
293         libyuv::FilterMode::kFilterNone);
294     if (ret != DCAMERA_OK) {
295         DHLOGE("Convert I420 scale failed.");
296         return DCAMERA_BAD_VALUE;
297     }
298 
299     srcImgInfo.width = dstImgInfo.width;
300     srcImgInfo.height = dstImgInfo.height;
301     srcImgInfo.alignedWidth = dstImgInfo.alignedWidth;
302     srcImgInfo.alignedHeight = dstImgInfo.alignedHeight;
303     srcImgInfo.chromaOffset = static_cast<size_t>(srcImgInfo.alignedWidth * srcImgInfo.alignedHeight);
304     srcImgInfo.imgSize = dstBuf->Size();
305 
306     DHLOGD("Convert I420 scale success.");
307     return DCAMERA_OK;
308 }
309 
ConvertFormatToNV21(ImageUnitInfo & srcImgInfo,ImageUnitInfo & dstImgInfo,std::shared_ptr<DataBuffer> & dstBuf)310 int32_t ScaleConvertProcess::ConvertFormatToNV21(ImageUnitInfo& srcImgInfo, ImageUnitInfo& dstImgInfo,
311     std::shared_ptr<DataBuffer>& dstBuf)
312 {
313     if (srcImgInfo.colorFormat == dstImgInfo.colorFormat) {
314         DHLOGD("Convert format to NV21 srcImgInfo format is the same as dstImgInfo format");
315         return DCAMERA_OK;
316     }
317 
318     DHLOGD("Convert I420 to NV21: format=%d, width=[%d, %d], height=[%d, %d]", srcImgInfo.colorFormat,
319         srcImgInfo.width, srcImgInfo.alignedWidth, srcImgInfo.height, srcImgInfo.alignedHeight);
320     int srcSizeY = srcImgInfo.width * srcImgInfo.height;
321     int srcSizeUV = (static_cast<uint32_t>(srcImgInfo.width) >> MEMORY_RATIO_UV) *
322                     (static_cast<uint32_t>(srcImgInfo.height) >> MEMORY_RATIO_UV);
323     uint8_t *srcDataY = dstBuf->Data();
324     uint8_t *srcDataU = dstBuf->Data() + srcSizeY;
325     uint8_t *srcDataV = dstBuf->Data() + srcSizeY + srcSizeUV;
326 
327     int dstSizeY = dstImgInfo.width * dstImgInfo.height;
328     uint8_t *dstDataY = dstImgInfo.imgData->Data();
329     uint8_t *dstDataUV = dstImgInfo.imgData->Data() + dstSizeY;
330 
331     int32_t ret = libyuv::I420ToNV21(
332         srcDataY, srcImgInfo.width,
333         srcDataU, static_cast<uint32_t>(srcImgInfo.width) >> MEMORY_RATIO_UV,
334         srcDataV, static_cast<uint32_t>(srcImgInfo.width) >> MEMORY_RATIO_UV,
335         dstDataY, dstImgInfo.width,
336         dstDataUV, dstImgInfo.width,
337         dstImgInfo.width, dstImgInfo.height);
338     if (ret != DCAMERA_OK) {
339         DHLOGE("Convert I420 to NV21 failed.");
340         return DCAMERA_BAD_VALUE;
341     }
342 
343     DHLOGD("Convert I420 to NV21 success.");
344     return DCAMERA_OK;
345 }
346 
ConvertFormatToRGBA(ImageUnitInfo & srcImgInfo,ImageUnitInfo & dstImgInfo,std::shared_ptr<DataBuffer> & dstBuf)347 int32_t ScaleConvertProcess::ConvertFormatToRGBA(ImageUnitInfo& srcImgInfo, ImageUnitInfo& dstImgInfo,
348     std::shared_ptr<DataBuffer>& dstBuf)
349 {
350     if (srcImgInfo.colorFormat == dstImgInfo.colorFormat) {
351         DHLOGD("Convert format to RGBA srcImgInfo format is the same as dstImgInfo format");
352         return DCAMERA_OK;
353     }
354 
355     DHLOGI("Convert I420 to RGBA: format=%d, width=[%d, %d], height=[%d, %d]", srcImgInfo.colorFormat,
356         srcImgInfo.width, srcImgInfo.alignedWidth, srcImgInfo.height, srcImgInfo.alignedHeight);
357     int srcSizeY = srcImgInfo.width * srcImgInfo.height;
358     int srcSizeUV = (static_cast<uint32_t>(srcImgInfo.width) >> MEMORY_RATIO_UV) *
359                     (static_cast<uint32_t>(srcImgInfo.height) >> MEMORY_RATIO_UV);
360     uint8_t *srcDataY = dstBuf->Data();
361     uint8_t *srcDataU = dstBuf->Data() + srcSizeY;
362     uint8_t *srcDataV = dstBuf->Data() + srcSizeY + srcSizeUV;
363 
364     uint8_t *dstDataRGBA = dstImgInfo.imgData->Data();
365     int32_t ret = libyuv::I420ToRGBA(
366         srcDataY, srcImgInfo.width,
367         srcDataU, static_cast<uint32_t>(srcImgInfo.width) >> MEMORY_RATIO_UV,
368         srcDataV, static_cast<uint32_t>(srcImgInfo.width) >> MEMORY_RATIO_UV,
369         dstDataRGBA, dstImgInfo.width * RGB32_MEMORY_COEFFICIENT,
370         dstImgInfo.width, dstImgInfo.height);
371     if (ret != DCAMERA_OK) {
372         DHLOGE("Convert I420 to RGBA failed.");
373         return DCAMERA_BAD_VALUE;
374     }
375 
376     DHLOGD("Convert I420 to RGBA success.");
377     return DCAMERA_OK;
378 }
379 
ConvertDone(std::vector<std::shared_ptr<DataBuffer>> & outputBuffers)380 int32_t ScaleConvertProcess::ConvertDone(std::vector<std::shared_ptr<DataBuffer>>& outputBuffers)
381 {
382     int64_t finishScaleTime = GetNowTimeStampUs();
383     DHLOGD("ScaleConvertProcess : Convert Done.");
384     if (outputBuffers.empty()) {
385         DHLOGE("The received data buffer is empty.");
386         return DCAMERA_BAD_VALUE;
387     }
388     outputBuffers[0]->frameInfo_.timePonit.finishScale = finishScaleTime;
389 
390     if (nextDataProcess_ != nullptr) {
391         DHLOGD("Send to the next node of the scale convert for processing.");
392         int32_t err = nextDataProcess_->ProcessData(outputBuffers);
393         if (err != DCAMERA_OK) {
394             DHLOGE("Some node after the scale convert processes failed.");
395         }
396         return err;
397     }
398 
399     DHLOGD("The current node is the last noed, and output the processed video buffer.");
400     std::shared_ptr<DCameraPipelineSource> targetPipelineSource = callbackPipelineSource_.lock();
401     if (targetPipelineSource == nullptr) {
402         DHLOGE("callbackPipelineSource_ is nullptr.");
403         return DCAMERA_BAD_VALUE;
404     }
405     targetPipelineSource->OnProcessedVideoBuffer(outputBuffers[0]);
406     return DCAMERA_OK;
407 }
408 
GetProperty(const std::string & propertyName,PropertyCarrier & propertyCarrier)409 int32_t ScaleConvertProcess::GetProperty(const std::string& propertyName, PropertyCarrier& propertyCarrier)
410 {
411     return DCAMERA_OK;
412 }
413 } // namespace DistributedHardware
414 } // namespace OHOS
415