Home | History | Annotate | Download | only in gstreamer
      1 /*
      2   * main_pipe_manager.h -main pipe manager
      3   *
      4   *  Copyright (c) 2016 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: Yinhang Liu <yinhangx.liu (at) intel.com>
     19   */
     20 
     21 #ifndef XCAMFILTER_MAIN_PIPE_MANAGER_H
     22 #define XCAMFILTER_MAIN_PIPE_MANAGER_H
     23 
     24 #ifdef HAVE_CONFIG_H
     25 #include <config.h>
     26 #endif
     27 
     28 #include <pipe_manager.h>
     29 #include <video_buffer.h>
     30 #include <smart_analyzer_loader.h>
     31 #include <ocl/cl_post_image_processor.h>
     32 
     33 namespace GstXCam {
     34 
     35 class MainPipeManager
     36     : public XCam::PipeManager
     37 {
     38 public:
     39     MainPipeManager () {};
     40     ~MainPipeManager () {};
     41 
     42     XCam::SmartPtr<XCam::VideoBuffer> dequeue_buffer (const int32_t timeout);
     43     void pause_dequeue ();
     44     void resume_dequeue ();
     45 
     46     void set_image_processor (XCam::SmartPtr<XCam::CLPostImageProcessor> &processor) {
     47         _image_processor = processor;
     48     }
     49 
     50     XCam::SmartPtr<XCam::CLPostImageProcessor> &get_image_processor () {
     51         return _image_processor;
     52     }
     53 
     54 protected:
     55     virtual void post_buffer (const XCam::SmartPtr<XCam::VideoBuffer> &buf);
     56 
     57 private:
     58     XCam::SafeList<XCam::VideoBuffer>           _ready_buffers;
     59     XCam::SmartPtr<XCam::CLPostImageProcessor>  _image_processor;
     60 };
     61 
     62 };
     63 
     64 #endif // XCAMFILTER_MAIN_PIPE_MANAGER_H
     65