remove the b_low_latency_ from the RocVideoDecoder class (#111)

This commit is contained in:
Aryan Salmanpour
2023-11-30 22:09:13 -05:00
committed by GitHub
orang tua a878a106fb
melakukan e001d78859
7 mengubah file dengan 10 tambahan dan 14 penghapusan
+1 -1
Melihat File
@@ -135,7 +135,7 @@ int main(int argc, char **argv) {
try {
VideoDemuxer demuxer(input_file_path.c_str());
rocDecVideoCodec rocdec_codec_id = AVCodec2RocDecVideoCodec(demuxer.GetCodecID());
RocVideoDecoder viddec(device_id, mem_type, rocdec_codec_id, false, b_force_zero_latency, p_crop_rect, b_extract_sei_messages);
RocVideoDecoder viddec(device_id, mem_type, rocdec_codec_id, b_force_zero_latency, p_crop_rect, b_extract_sei_messages);
std::string device_name, gcn_arch_name;
int pci_bus_id, pci_domain_id, pci_device_id;
@@ -168,7 +168,7 @@ int main(int argc, char **argv) {
std::unique_ptr<VideoDemuxer> demuxer(new VideoDemuxer(input_file_path.c_str()));
rocDecVideoCodec rocdec_codec_id = AVCodec2RocDecVideoCodec(demuxer->GetCodecID());
v_device_id[i] = (i % 2 == 0) ? 0 : sd;
std::unique_ptr<RocVideoDecoder> dec(new RocVideoDecoder(v_device_id[i], mem_type, rocdec_codec_id, false, b_force_zero_latency, p_crop_rect));
std::unique_ptr<RocVideoDecoder> dec(new RocVideoDecoder(v_device_id[i], mem_type, rocdec_codec_id, b_force_zero_latency, p_crop_rect));
v_demuxer.push_back(std::move(demuxer));
v_viddec.push_back(std::move(dec));
}
+1 -1
Melihat File
@@ -150,7 +150,7 @@ int main(int argc, char **argv) {
FileStreamProvider stream_provider(input_file_path.c_str());
VideoDemuxer demuxer(&stream_provider);
rocDecVideoCodec rocdec_codec_id = AVCodec2RocDecVideoCodec(demuxer.GetCodecID());
RocVideoDecoder viddec(device_id, mem_type, rocdec_codec_id, false, b_force_zero_latency, p_crop_rect, b_extract_sei_messages);
RocVideoDecoder viddec(device_id, mem_type, rocdec_codec_id, b_force_zero_latency, p_crop_rect, b_extract_sei_messages);
std::string device_name, gcn_arch_name;
int pci_bus_id, pci_domain_id, pci_device_id;
@@ -158,7 +158,7 @@ int main(int argc, char **argv) {
multi_file_data.pop_front();
VideoDemuxer demuxer(file_data.in_file.c_str());
rocDecVideoCodec rocdec_codec_id = AVCodec2RocDecVideoCodec(demuxer.GetCodecID());
RocVideoDecoder viddec(device_id, file_data.mem_type, rocdec_codec_id, false, file_data.b_force_zero_latency, file_data.p_crop_rect, file_data.b_extract_sei_messages);
RocVideoDecoder viddec(device_id, file_data.mem_type, rocdec_codec_id, file_data.b_force_zero_latency, file_data.p_crop_rect, file_data.b_extract_sei_messages);
std::string device_name, gcn_arch_name;
int pci_bus_id, pci_domain_id, pci_device_id;
@@ -175,7 +175,7 @@ int main(int argc, char **argv) {
std::unique_ptr<VideoDemuxer> demuxer(new VideoDemuxer(input_file_path.c_str()));
rocDecVideoCodec rocdec_codec_id = AVCodec2RocDecVideoCodec(demuxer->GetCodecID());
v_device_id[i] = (i % 2 == 0) ? 0 : sd;
std::unique_ptr<RocVideoDecoder> dec(new RocVideoDecoder(v_device_id[i], mem_type, rocdec_codec_id, false, b_force_zero_latency, p_crop_rect));
std::unique_ptr<RocVideoDecoder> dec(new RocVideoDecoder(v_device_id[i], mem_type, rocdec_codec_id, b_force_zero_latency, p_crop_rect));
v_demuxer.push_back(std::move(demuxer));
v_viddec.push_back(std::move(dec));
}
+4 -7
Melihat File
@@ -22,10 +22,9 @@ THE SOFTWARE.
#include "roc_video_dec.h"
RocVideoDecoder::RocVideoDecoder(int device_id, OutputSurfaceMemoryType out_mem_type, rocDecVideoCodec codec, bool b_low_latency, bool force_zero_latency,
const Rect *p_crop_rect, bool extract_user_sei_Message, int max_width, int max_height,uint32_t clk_rate) :
device_id_{device_id}, out_mem_type_(out_mem_type), codec_id_(codec), b_low_latency_(b_low_latency),
b_force_zero_latency_(force_zero_latency), b_extract_sei_message_(extract_user_sei_Message),
RocVideoDecoder::RocVideoDecoder(int device_id, OutputSurfaceMemoryType out_mem_type, rocDecVideoCodec codec, bool force_zero_latency,
const Rect *p_crop_rect, bool extract_user_sei_Message, int max_width, int max_height, uint32_t clk_rate) :
device_id_{device_id}, out_mem_type_(out_mem_type), codec_id_(codec), b_force_zero_latency_(force_zero_latency), b_extract_sei_message_(extract_user_sei_Message),
max_width_ (max_width), max_height_(max_height) {
if (!InitHIP(device_id_)) {
@@ -42,7 +41,7 @@ RocVideoDecoder::RocVideoDecoder(int device_id, OutputSurfaceMemoryType out_mem_
parser_params.CodecType = codec_id_;
parser_params.ulMaxNumDecodeSurfaces = 1;
parser_params.ulClockRate = clk_rate;
parser_params.ulMaxDisplayDelay = b_low_latency ? 0 : 1;
parser_params.ulMaxDisplayDelay = 0;
parser_params.pUserData = this;
parser_params.pfnSequenceCallback = HandleVideoSequenceProc;
parser_params.pfnDecodePicture = HandlePictureDecodeProc;
@@ -232,8 +231,6 @@ int RocVideoDecoder::HandleVideoSequence(RocdecVideoFormat *p_video_format) {
input_video_info_str_.clear();
input_video_info_str_ << "Input Video Information" << std::endl
<< "\tCodec : " << GetCodecFmtName(p_video_format->codec) << std::endl
<< "\tFrame rate : " << p_video_format->frame_rate.numerator << "/" << p_video_format->frame_rate.denominator
<< " = " << 1.0 * p_video_format->frame_rate.numerator / p_video_format->frame_rate.denominator << " fps" << std::endl
<< "\tSequence : " << (p_video_format->progressive_sequence ? "Progressive" : "Interlaced") << std::endl
<< "\tCoded size : [" << p_video_format->coded_width << ", " << p_video_format->coded_height << "]" << std::endl
<< "\tDisplay area : [" << p_video_format->display_area.left << ", " << p_video_format->display_area.top << ", "
+1 -2
Melihat File
@@ -152,7 +152,7 @@ class RocVideoDecoder {
* @param clk_rate
* @param force_zero_latency
*/
RocVideoDecoder(int device_id, OutputSurfaceMemoryType out_mem_type, rocDecVideoCodec codec, bool b_low_latency, bool force_zero_latency = false,
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);
~RocVideoDecoder();
@@ -365,7 +365,6 @@ class RocVideoDecoder {
rocDecDecoderHandle roc_decoder_ = nullptr;
OutputSurfaceMemoryType out_mem_type_ = OUT_SURFACE_MEM_DEV_INTERNAL;
bool b_extract_sei_message_ = false;
bool b_low_latency_ = true;
bool b_force_zero_latency_ = false;
//bool b_device_frame_pitched_ = true;
hipDeviceProp_t hip_dev_prop_;