Skip to content

Commit 562bab3

Browse files
Sergiy Bilobrovfacebook-github-bot
authored andcommitted
[xplat][torchvision] Add torchvision streaming decoder
Summary: added compiler flag to replace c10 log by glog and remove dependency on c10 for non-pytorch applications (Note: this ignores all push blocking failures!) Differential Revision: D42837755 fbshipit-source-id: cc9661905fd3f8e91aa5fee2e58e3e0dd02fa325
1 parent e92a118 commit 562bab3

File tree

13 files changed

+5
-17
lines changed

13 files changed

+5
-17
lines changed

torchvision/csrc/io/decoder/audio_sampler.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "audio_sampler.h"
2-
#include <c10/util/Logging.h>
32
#include "util.h"
43

54
#define AVRESAMPLE_MAX_CHANNELS 32
@@ -121,8 +120,6 @@ int AudioSampler::sample(
121120
return result;
122121
}
123122

124-
TORCH_CHECK_LE(result, outNumSamples);
125-
126123
if (result) {
127124
if ((result = av_samples_get_buffer_size(
128125
nullptr,
@@ -166,8 +163,6 @@ int AudioSampler::sample(
166163

167164
av_free(tmpBuffer);
168165

169-
TORCH_CHECK_LE(result, outNumSamples);
170-
171166
if (result) {
172167
result = av_samples_get_buffer_size(
173168
nullptr,

torchvision/csrc/io/decoder/audio_stream.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "audio_stream.h"
2-
#include <c10/util/Logging.h>
32
#include <limits>
43
#include "util.h"
54

torchvision/csrc/io/decoder/decoder.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "decoder.h"
2-
#include <c10/util/Logging.h>
32
#include <libavutil/avutil.h>
43
#include <future>
54
#include <iostream>

torchvision/csrc/io/decoder/defs.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ extern "C" {
1717
#include <libswresample/swresample.h>
1818
#include "libswscale/swscale.h"
1919
}
20+
#ifdef USE_GLOG
21+
#include <glog/logging.h>
22+
#else
23+
#include <c10/util/Logging.h>
24+
#endif
2025

2126
namespace ffmpeg {
2227

torchvision/csrc/io/decoder/memory_buffer.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "memory_buffer.h"
2-
#include <c10/util/Logging.h>
32

43
namespace ffmpeg {
54

torchvision/csrc/io/decoder/seekable_buffer.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "seekable_buffer.h"
2-
#include <c10/util/Logging.h>
32
#include <chrono>
43
#include "memory_buffer.h"
54

torchvision/csrc/io/decoder/stream.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "stream.h"
2-
#include <c10/util/Logging.h>
32
#include <stdio.h>
43
#include <string.h>
54
#include "util.h"

torchvision/csrc/io/decoder/subtitle_sampler.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "subtitle_sampler.h"
2-
#include <c10/util/Logging.h>
32
#include "util.h"
43

54
namespace ffmpeg {

torchvision/csrc/io/decoder/subtitle_stream.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "subtitle_stream.h"
2-
#include <c10/util/Logging.h>
32
#include <limits>
43
#include "util.h"
54

torchvision/csrc/io/decoder/sync_decoder_test.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#include <c10/util/Logging.h>
21
#include <dirent.h>
32
#include <gtest/gtest.h>
43
#include "memory_buffer.h"

0 commit comments

Comments
 (0)