/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-rocdecode/checkouts/docs-6.2.1/utils/rocvideodecode/roc_video_dec.h Source File#
roc_video_dec.h
Go to the documentation of this file.
67 } OutputSurfaceMemoryType;
83 explicit RocVideoDecodeException(const std::string& message, const int err_code):_message(message), _err_code(err_code) {}
94 #define ROCDEC_THROW(X, CODE) throw RocVideoDecodeException(" { " + std::string(__func__) + " } " + X , CODE);
102 error_log << #rocDecAPI << " returned " << rocDecGetErrorName(error_code) << " at " <<__FILE__ <<":" << __LINE__;\
180 RocVideoDecoder(int device_id, OutputSurfaceMemoryType out_mem_type, rocDecVideoCodec codec, bool force_zero_latency = false,
181 const Rect *p_crop_rect = nullptr, bool extract_user_SEI_Message = false, uint32_t disp_delay = 0, int max_width = 0, int max_height = 0,
217 int GetFrameSize() { assert(disp_width_); return disp_width_ * (disp_height_ + (chroma_height_ * num_chroma_planes_)) * byte_per_pixel_; }
222 int GetFrameSizePitched() { assert(surface_stride_); return surface_stride_ * (disp_height_ + (chroma_height_ * num_chroma_planes_)); }
304 //void SaveImage(std::string output_file_name, void* dev_mem, OutputImageInfo* image_info, bool is_output_RGB = 0);
315 void GetDeviceinfo(std::string &device_name, std::string &gcn_arch_name, int &pci_bus_id, int &pci_domain_id, int &pci_device_id);
325 void SaveFrameToFile(std::string output_file_name, void *surf_mem, OutputSurfaceInfo *surf_info, size_t rgb_image_size = 0);
365 static int ROCDECAPI HandleVideoSequenceProc(void *p_user_data, RocdecVideoFormat *p_video_format) { return ((RocVideoDecoder *)p_user_data)->HandleVideoSequence(p_video_format); }
370 static int ROCDECAPI HandlePictureDecodeProc(void *p_user_data, RocdecPicParams *p_pic_params) { return ((RocVideoDecoder *)p_user_data)->HandlePictureDecode(p_pic_params); }
375 static int ROCDECAPI HandlePictureDisplayProc(void *p_user_data, RocdecParserDispInfo *p_disp_info) { return ((RocVideoDecoder *)p_user_data)->HandlePictureDisplay(p_disp_info); }
380 static int ROCDECAPI HandleSEIMessagesProc(void *p_user_data, RocdecSeiMessageInfo *p_sei_message_info) { return ((RocVideoDecoder *)p_user_data)->GetSEIMessage(p_sei_message_info); }
457 uint32_t surface_vstride_ = 0, chroma_vstride_ = 0; // vertical stride between planes: used when using internal dev memory
Definition: roc_video_dec.h:80
Definition: roc_video_dec.h:162
int GetFrameSize()
This function is used to get the current frame size based on pixel format.
Definition: roc_video_dec.h:217
void SaveFrameToFile(std::string output_file_name, void *surf_mem, OutputSurfaceInfo *surf_info, size_t rgb_image_size=0)
Helper function to dump decoded output surface to file.
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:358
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:192
int GetNumChromaPlanes()
This function is used to get the number of chroma planes.
Definition: roc_video_dec.h:212
int GetChromaHeight()
This function is used to get the current chroma height.
Definition: roc_video_dec.h:207
uint32_t GetHeight()
Get the output frame height.
Definition: roc_video_dec.h:202
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:229
int GetFrameSizePitched()
This function is used to get the current frame size based on pitch.
Definition: roc_video_dec.h:222
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 ResetSaveFrameToFile()
Helper funtion to close a existing file and dump to new file in case of multiple files using same dec...
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:234
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, uint32_t disp_delay=0, int max_width=0, int max_height=0, uint32_t clk_rate=1000)
Construct a new Roc Video Decoder object.
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:197
The AMD rocDecode Library.
The AMD rocParser Library.
Definition: roc_video_dec.h:136
Definition: roc_video_dec.h:128
Definition: roc_video_dec.h:143
uint64_t output_surface_size_in_bytes
Definition: roc_video_dec.h:151
rocDecVideoSurfaceFormat surface_format
Definition: roc_video_dec.h:152
Definition: roc_video_dec.h:156
Definition: roc_video_dec.h:121
Timing Info struct\Used in rocdecParseVideoData API with PFNVIDDISPLAYCALLBACK pfn_display_picture.
Definition: rocdecode.h:1374