VideoToSequence sample (#373)

* videoToSequence sample initial commit

* add frame_num calculation when seeking

* update README

* addressed review comments

* added FlushAndReconfigure() to flush out frames with seek
This commit is contained in:
Rajy Rawther
2024-07-22 05:42:58 -07:00
کامیت شده توسط GitHub
والد ac82d17e9f
کامیت fe5f63428c
5فایلهای تغییر یافته به همراه696 افزوده شده و 6 حذف شده
@@ -267,7 +267,14 @@ class RocVideoDecoder {
* @return true : success
* @return false : fail
*/
bool SetReconfigParams(ReconfigParams *p_reconfig_params);
bool SetReconfigParams(ReconfigParams *p_reconfig_params, bool b_force_reconfig_flush = false);
/**
* @brief Function to force Reconfigure Flush: needed for random seeking to key frames
*
* @return int 1: Success 0: Fail
*/
int FlushAndReconfigure();
/**
* @brief this function decodes a frame and returns the number of frames avalable for display
*
@@ -451,6 +458,7 @@ class RocVideoDecoder {
bool b_force_zero_latency_ = false;
uint32_t disp_delay_;
ReconfigParams *p_reconfig_params_ = nullptr;
bool b_force_recofig_flush_ = false;
int32_t num_frames_flushed_during_reconfig_ = 0;
hipDeviceProp_t hip_dev_prop_;
hipStream_t hip_stream_;
@@ -459,6 +467,7 @@ class RocVideoDecoder {
rocDecVideoSurfaceFormat video_surface_format_ = rocDecVideoSurfaceFormat_NV12;
RocdecSeiMessageInfo *curr_sei_message_ptr_ = nullptr;
RocdecSeiMessageInfo sei_message_display_q_[MAX_FRAME_NUM];
RocdecVideoFormat *curr_video_format_ptr_ = nullptr;
int decoded_frame_cnt_ = 0, decoded_frame_cnt_ret_ = 0;
int decode_poc_ = 0, pic_num_in_dec_order_[MAX_FRAME_NUM];
int num_alloced_frames_ = 0;