VART-X  0.3.0
vart_videoframe_impl_base.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2024-2026 Advanced Micro Devices Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
24 #include <vector>
25 #include "../vart_device.hpp"
26 #include "../vart_memory_types.hpp"
27 #include "../vart_videoframe_types.hpp"
28 
31 namespace vart {
32 
40  public:
41  VideoFrameImplBase() = delete;
42 
49  VideoFrameImplBase(std::shared_ptr<Device> dev) : device(std::move(dev)) {
50  vinfo = {};
51  vmap_info = {};
52  }
53 
55  virtual ~VideoFrameImplBase(){};
56 
68  virtual const VideoFrameMapInfo& map(DataMapFlags map_flags) = 0;
69 
73  virtual void unmap() = 0;
74 
82  virtual const VideoInfo& get_video_info() = 0;
83 
91  virtual std::shared_ptr<Device> get_device_handle() = 0;
92 
100  virtual int export_buffer() const = 0;
101 
102  protected:
105  std::shared_ptr<Device> device;
106 };
107 } // namespace vart
Abstract base class for video frame implementation used by VideoFrame.
Definition: vart_videoframe_impl_base.hpp:39
virtual void unmap()=0
unmap() - Unmaps video frame data from user space.
virtual int export_buffer() const =0
export_buffer() - Export the video frame buffer as a dma-buf file descriptor.
virtual std::shared_ptr< Device > get_device_handle()=0
get_device_handle() - Retrieves the device handle associated with the current frame
virtual const VideoInfo & get_video_info()=0
get_video_info() - Retrieves the video frame information from the current frame
VideoInfo vinfo
Definition: vart_videoframe_impl_base.hpp:103
virtual ~VideoFrameImplBase()
Virtual destructor to ensure proper cleanup of derived implementations.
Definition: vart_videoframe_impl_base.hpp:55
VideoFrameMapInfo vmap_info
Definition: vart_videoframe_impl_base.hpp:104
VideoFrameImplBase(std::shared_ptr< Device > dev)
VideoFrameImplBase() - Constructor that takes device instance as an input.
Definition: vart_videoframe_impl_base.hpp:49
std::shared_ptr< Device > device
Definition: vart_videoframe_impl_base.hpp:105
virtual const VideoFrameMapInfo & map(DataMapFlags map_flags)=0
map() - Maps video frame data to user space
VART (Vitis AI Runtime) public API namespace.
DataMapFlags
Definition: vart_memory_types.hpp:30
Structure encapsulating details of a video frame after a map operation.
Definition: vart_videoframe_types.hpp:214
Contains information related to a video frame.
Definition: vart_videoframe_types.hpp:144