|
7 | 7 | #include "src/torchcodec/_core/SingleStreamDecoder.h"
|
8 | 8 | #include <cstdint>
|
9 | 9 | #include <cstdio>
|
10 |
| -#include <cstdlib> |
11 | 10 | #include <iostream>
|
12 | 11 | #include <limits>
|
13 | 12 | #include <sstream>
|
@@ -184,39 +183,6 @@ void SingleStreamDecoder::initializeDecoder() {
|
184 | 183 | initialized_ = true;
|
185 | 184 | }
|
186 | 185 |
|
187 |
| -void SingleStreamDecoder::setFFmpegLogLevel() { |
188 |
| - auto logLevel = AV_LOG_QUIET; |
189 |
| - const char* logLevelEnv = std::getenv("TORCHCODEC_FFMPEG_LOG_LEVEL"); |
190 |
| - if (logLevelEnv != nullptr) { |
191 |
| - if (std::strcmp(logLevelEnv, "QUIET") == 0) { |
192 |
| - logLevel = AV_LOG_QUIET; |
193 |
| - } else if (std::strcmp(logLevelEnv, "PANIC") == 0) { |
194 |
| - logLevel = AV_LOG_PANIC; |
195 |
| - } else if (std::strcmp(logLevelEnv, "FATAL") == 0) { |
196 |
| - logLevel = AV_LOG_FATAL; |
197 |
| - } else if (std::strcmp(logLevelEnv, "ERROR") == 0) { |
198 |
| - logLevel = AV_LOG_ERROR; |
199 |
| - } else if (std::strcmp(logLevelEnv, "WARNING") == 0) { |
200 |
| - logLevel = AV_LOG_WARNING; |
201 |
| - } else if (std::strcmp(logLevelEnv, "INFO") == 0) { |
202 |
| - logLevel = AV_LOG_INFO; |
203 |
| - } else if (std::strcmp(logLevelEnv, "VERBOSE") == 0) { |
204 |
| - logLevel = AV_LOG_VERBOSE; |
205 |
| - } else if (std::strcmp(logLevelEnv, "DEBUG") == 0) { |
206 |
| - logLevel = AV_LOG_DEBUG; |
207 |
| - } else if (std::strcmp(logLevelEnv, "TRACE") == 0) { |
208 |
| - logLevel = AV_LOG_TRACE; |
209 |
| - } else { |
210 |
| - TORCH_CHECK( |
211 |
| - false, |
212 |
| - "Invalid TORCHCODEC_FFMPEG_LOG_LEVEL: ", |
213 |
| - logLevelEnv, |
214 |
| - ". Use e.g. 'QUIET', 'PANIC', 'VERBOSE', etc."); |
215 |
| - } |
216 |
| - } |
217 |
| - av_log_set_level(logLevel); |
218 |
| -} |
219 |
| - |
220 | 186 | int SingleStreamDecoder::getBestStreamIndex(AVMediaType mediaType) {
|
221 | 187 | AVCodecOnlyUseForCallingAVFindBestStream avCodec = nullptr;
|
222 | 188 | int streamIndex =
|
|
0 commit comments