Commit b1f5dd8124b6405fd6ae465c4c52d5b92263bba7
1 parent
70689dac
注释无效代码
Showing
1 changed file
with
17 additions
and
17 deletions
src/decoder/dvpp/FFRecoder.cpp
@@ -74,11 +74,11 @@ bool FFRecoder::init(int w, int h, int fps, int bit_rate, const char* outfile_na | @@ -74,11 +74,11 @@ bool FFRecoder::init(int w, int h, int fps, int bit_rate, const char* outfile_na | ||
74 | av_opt_set(codec_ctx_->priv_data, "tune", "zerolatency", 0); | 74 | av_opt_set(codec_ctx_->priv_data, "tune", "zerolatency", 0); |
75 | 75 | ||
76 | // 打开解码器 | 76 | // 打开解码器 |
77 | - int ret = avcodec_open2(codec_ctx_, encoder, nullptr); | ||
78 | - if (ret < 0) { | ||
79 | - fprintf(stderr, "Open encoder failed!\n"); | ||
80 | - return false; | ||
81 | - } | 77 | + // int ret = avcodec_open2(codec_ctx_, encoder, nullptr); |
78 | + // if (ret < 0) { | ||
79 | + // fprintf(stderr, "Open encoder failed!\n"); | ||
80 | + // return false; | ||
81 | + // } | ||
82 | 82 | ||
83 | // [2] 创建输出上下文 | 83 | // [2] 创建输出上下文 |
84 | avformat_alloc_output_context2(&fmt_ctx_, nullptr, nullptr, outfile_name); | 84 | avformat_alloc_output_context2(&fmt_ctx_, nullptr, nullptr, outfile_name); |
@@ -91,18 +91,18 @@ bool FFRecoder::init(int w, int h, int fps, int bit_rate, const char* outfile_na | @@ -91,18 +91,18 @@ bool FFRecoder::init(int w, int h, int fps, int bit_rate, const char* outfile_na | ||
91 | 91 | ||
92 | av_dump_format(fmt_ctx_, out_stream_->id, outfile_name, 1); | 92 | av_dump_format(fmt_ctx_, out_stream_->id, outfile_name, 1); |
93 | 93 | ||
94 | - // 创建YUV格式帧 | ||
95 | - yuv_frame_ = av_frame_alloc(); | ||
96 | - yuv_frame_->format = AV_PIX_FMT_YUV420P; | ||
97 | - yuv_frame_->width = width_; | ||
98 | - yuv_frame_->height = height_; | ||
99 | - // 为创建的YUV帧分配内存 | ||
100 | - if (av_frame_get_buffer(yuv_frame_, 0) < 0) { | ||
101 | - av_frame_free(&yuv_frame_); | ||
102 | - yuv_frame_ = nullptr; | ||
103 | - fprintf(stderr, "Frame get buffer failed!\n"); | ||
104 | - return false; | ||
105 | - } | 94 | + // // 创建YUV格式帧 |
95 | + // yuv_frame_ = av_frame_alloc(); | ||
96 | + // yuv_frame_->format = AV_PIX_FMT_YUV420P; | ||
97 | + // yuv_frame_->width = width_; | ||
98 | + // yuv_frame_->height = height_; | ||
99 | + // // 为创建的YUV帧分配内存 | ||
100 | + // if (av_frame_get_buffer(yuv_frame_, 0) < 0) { | ||
101 | + // av_frame_free(&yuv_frame_); | ||
102 | + // yuv_frame_ = nullptr; | ||
103 | + // fprintf(stderr, "Frame get buffer failed!\n"); | ||
104 | + // return false; | ||
105 | + // } | ||
106 | 106 | ||
107 | // [5] 打开输出视频文件并写入视频头信息 | 107 | // [5] 打开输出视频文件并写入视频头信息 |
108 | if (avio_open(&fmt_ctx_->pb, outfile_name, AVIO_FLAG_WRITE) < 0) { | 108 | if (avio_open(&fmt_ctx_->pb, outfile_name, AVIO_FLAG_WRITE) < 0) { |