• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * cl_3a_image_processor.cpp - CL 3A image processor
3  *
4  *  Copyright (c) 2015 Intel Corporation
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *      http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  * Author: wangfei <feix.w.wang@intel.com>
19  */
20 #include "cl_csc_image_processor.h"
21 #include "cl_context.h"
22 #include "cl_csc_handler.h"
23 
24 
25 namespace XCam {
26 
CLCscImageProcessor()27 CLCscImageProcessor::CLCscImageProcessor ()
28     : CLImageProcessor ("CLCscImageProcessor")
29 {
30     XCAM_LOG_DEBUG ("CLCscImageProcessor constructed");
31 }
32 
~CLCscImageProcessor()33 CLCscImageProcessor::~CLCscImageProcessor ()
34 {
35     XCAM_LOG_DEBUG ("CLCscImageProcessor destructed");
36 }
37 
38 XCamReturn
create_handlers()39 CLCscImageProcessor::create_handlers ()
40 {
41     SmartPtr<CLImageHandler> image_handler;
42     SmartPtr<CLContext> context = get_cl_context ();
43 
44     XCAM_ASSERT (context.ptr ());
45 
46     /* color space conversion */
47     image_handler = create_cl_csc_image_handler (context, CL_CSC_TYPE_YUYVTORGBA);
48     _csc = image_handler.dynamic_cast_ptr<CLCscImageHandler> ();
49     XCAM_FAIL_RETURN (
50         WARNING,
51         _csc .ptr (),
52         XCAM_RETURN_ERROR_CL,
53         "CLCscImageProcessor create csc handler failed");
54 
55     image_handler->set_pool_type (CLImageHandler::CLVideoPoolType);
56     add_handler (image_handler);
57 
58     return XCAM_RETURN_NO_ERROR;
59 }
60 
61 };
62