docs-6.1.0/utils/rocvideodecode/roc_video_dec.h Source File#
roc_video_dec.h
Go to the documentation of this file.
66 } OutputSurfaceMemoryType;
82 explicit RocVideoDecodeException(const std::string& message, const int err_code):_message(message), _err_code(err_code) {}
93 #define ROCDEC_THROW(X, CODE) throw RocVideoDecodeException(" { " + std::string(__func__) + " } " + X , CODE);
101 error_log << #rocDecAPI << " returned " << rocDecGetErrorName(error_code) << " at " <<__FILE__ <<":" << __LINE__;\
174 RocVideoDecoder(int device_id, OutputSurfaceMemoryType out_mem_type, rocDecVideoCodec codec, bool force_zero_latency = false,
175 const Rect *p_crop_rect = nullptr, bool extract_user_SEI_Message = false, int max_width = 0, int max_height = 0,
211 int GetFrameSize() { assert(disp_width_); return disp_width_ * (disp_height_ + (chroma_height_ * num_chroma_planes_)) * byte_per_pixel_; }
216 int GetFrameSizePitched() { assert(surface_stride_); return surface_stride_ * (disp_height_ + (chroma_height_ * num_chroma_planes_)); }
298 //void SaveImage(std::string output_file_name, void* dev_mem, OutputImageInfo* image_info, bool is_output_RGB = 0);
309 void GetDeviceinfo(std::string &device_name, std::string &gcn_arch_name, int &pci_bus_id, int &pci_domain_id, int &pci_device_id);
318 void SaveFrameToFile(std::string output_file_name, void *surf_mem, OutputSurfaceInfo *surf_info);
351 static int ROCDECAPI HandleVideoSequenceProc(void *p_user_data, RocdecVideoFormat *p_video_format) { return ((RocVideoDecoder *)p_user_data)->HandleVideoSequence(p_video_format); }
356 static int ROCDECAPI HandlePictureDecodeProc(void *p_user_data, RocdecPicParams *p_pic_params) { return ((RocVideoDecoder *)p_user_data)->HandlePictureDecode(p_pic_params); }
361 static int ROCDECAPI HandlePictureDisplayProc(void *p_user_data, RocdecParserDispInfo *p_disp_info) { return ((RocVideoDecoder *)p_user_data)->HandlePictureDisplay(p_disp_info); }
366 static int ROCDECAPI HandleSEIMessagesProc(void *p_user_data, RocdecSeiMessageInfo *p_sei_message_info) { return ((RocVideoDecoder *)p_user_data)->GetSEIMessage(p_sei_message_info); }
441 uint32_t surface_vstride_ = 0, chroma_vstride_ = 0; // vertical stride between planes: used when using internal dev memory
Definition: roc_video_dec.h:79
Definition: roc_video_dec.h:156
int GetFrameSize()
This function is used to get the current frame size based on pixel format.
Definition: roc_video_dec.h:211
uint8_t * GetFrame(int64_t *pts)
This function returns a decoded frame and timestamp. This should be called in a loop fetching all the...
int32_t GetNumOfFlushedFrames()
Get the Num Of Flushed Frames from video decoder object.
Definition: roc_video_dec.h:344
const char * GetCodecFmtName(rocDecVideoCodec codec_id)
Get the name of the output format.
uint32_t GetWidth()
Get the output frame width.
Definition: roc_video_dec.h:186
int GetNumChromaPlanes()
This function is used to get the number of chroma planes.
Definition: roc_video_dec.h:206
int GetChromaHeight()
This function is used to get the current chroma height.
Definition: roc_video_dec.h:201
uint32_t GetHeight()
Get the output frame height.
Definition: roc_video_dec.h:196
RocVideoDecoder(int device_id, OutputSurfaceMemoryType out_mem_type, rocDecVideoCodec codec, bool force_zero_latency=false, const Rect *p_crop_rect=nullptr, bool extract_user_SEI_Message=false, int max_width=0, int max_height=0, uint32_t clk_rate=1000)
Construct a new Roc Video Decoder object.
bool SetReconfigParams(ReconfigParams *p_reconfig_params)
Function to set the Reconfig Params object.
uint32_t GetBitDepth()
Get the Bit Depth and BytesPerPixel associated with the pixel format.
Definition: roc_video_dec.h:223
int GetFrameSizePitched()
This function is used to get the current frame size based on pitch.
Definition: roc_video_dec.h:216
bool ReleaseFrame(int64_t pTimestamp, bool b_flushing=false)
function to release frame after use by the application: Only used with "OUT_SURFACE_MEM_DEV_INTERNAL"
void GetDeviceinfo(std::string &device_name, std::string &gcn_arch_name, int &pci_bus_id, int &pci_domain_id, int &pci_device_id)
utility function to save image to a file
const char * GetSurfaceFmtName(rocDecVideoSurfaceFormat surface_format_id)
function to return the name from surface_format_id
void SaveFrameToFile(std::string output_file_name, void *surf_mem, OutputSurfaceInfo *surf_info)
Helper function to dump decoded output surface to file.
bool GetOutputSurfaceInfo(OutputSurfaceInfo **surface_info)
Get the pointer to the Output Image Info.
int DecodeFrame(const uint8_t *data, size_t size, int pkt_flags, int64_t pts=0)
this function decodes a frame and returns the number of frames avalable for display
size_t GetSurfaceSize()
Functions to get the output surface attributes.
Definition: roc_video_dec.h:228
void UpdateMd5ForFrame(void *surf_mem, OutputSurfaceInfo *surf_info)
Helper function to dump decoded output surface to file.
void FinalizeMd5(uint8_t **digest)
Helper function to complete MD5 calculation.
int GetDecodeWidth()
This function is used to get the actual decode width.
Definition: roc_video_dec.h:191
The AMD rocDecode Library.
The AMD rocParser Library.
Definition: roc_video_dec.h:128
Definition: roc_video_dec.h:135
uint64_t output_surface_size_in_bytes
Definition: roc_video_dec.h:143
rocDecVideoSurfaceFormat surface_format
Definition: roc_video_dec.h:144
Definition: roc_video_dec.h:148
Definition: roc_video_dec.h:120
Timing Info struct\Used in rocdecParseVideoData API with PFNVIDDISPLAYCALLBACK pfn_display_picture.
Definition: rocdecode.h:797