1 /* 2 * gst_xcam_utils.h - gst xcam utilities 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@intel.com> 19 */ 20 21 #ifndef GST_XCAM_UTILS_H 22 #define GST_XCAM_UTILS_H 23 24 #include "dma_video_buffer.h" 25 26 class DmaGstBuffer 27 : public XCam::DmaVideoBuffer 28 { 29 public: DmaGstBuffer(const XCam::VideoBufferInfo & info,int dma_fd,GstBuffer * gst_buf)30 DmaGstBuffer (const XCam::VideoBufferInfo &info, int dma_fd, GstBuffer *gst_buf) 31 : XCam::DmaVideoBuffer (info, dma_fd) 32 , _gst_buf (gst_buf) 33 { 34 gst_buffer_ref (_gst_buf); 35 } 36 ~DmaGstBuffer()37 ~DmaGstBuffer () { 38 gst_buffer_unref (_gst_buf); 39 } 40 41 private: 42 XCAM_DEAD_COPY (DmaGstBuffer); 43 44 private: 45 GstBuffer *_gst_buf; 46 }; 47 48 #endif // GST_XCAM_UTILS_H 49