Skip to content

Commit 42b6db0

Browse files
Sergiy Bilobrovfacebook-github-bot
authored andcommitted
[xpalt][mediacore] Fork torchvision streaming decoder
Summary: Created a copy of torchvison decoder for VUE fork Differential Revision: D42952641 Privacy Context Container: L1105083 fbshipit-source-id: 65add9b72c94c1a640c463055f465c5e713af3d7
1 parent 562bab3 commit 42b6db0

File tree

13 files changed

+16
-5
lines changed

13 files changed

+16
-5
lines changed

torchvision/csrc/io/decoder/audio_sampler.cpp

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

45
#define AVRESAMPLE_MAX_CHANNELS 32
@@ -120,6 +121,8 @@ int AudioSampler::sample(
120121
return result;
121122
}
122123

124+
TORCH_CHECK_LE(result, outNumSamples);
125+
123126
if (result) {
124127
if ((result = av_samples_get_buffer_size(
125128
nullptr,
@@ -163,6 +166,8 @@ int AudioSampler::sample(
163166

164167
av_free(tmpBuffer);
165168

169+
TORCH_CHECK_LE(result, outNumSamples);
170+
166171
if (result) {
167172
result = av_samples_get_buffer_size(
168173
nullptr,

torchvision/csrc/io/decoder/audio_stream.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "audio_stream.h"
2+
#include <c10/util/Logging.h>
23
#include <limits>
34
#include "util.h"
45

torchvision/csrc/io/decoder/decoder.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "decoder.h"
2+
#include <c10/util/Logging.h>
23
#include <libavutil/avutil.h>
34
#include <future>
45
#include <iostream>

torchvision/csrc/io/decoder/defs.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ 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
2520

2621
namespace ffmpeg {
2722

torchvision/csrc/io/decoder/memory_buffer.cpp

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

34
namespace ffmpeg {
45

torchvision/csrc/io/decoder/seekable_buffer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "seekable_buffer.h"
2+
#include <c10/util/Logging.h>
23
#include <chrono>
34
#include "memory_buffer.h"
45

torchvision/csrc/io/decoder/stream.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "stream.h"
2+
#include <c10/util/Logging.h>
23
#include <stdio.h>
34
#include <string.h>
45
#include "util.h"

torchvision/csrc/io/decoder/subtitle_sampler.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "subtitle_sampler.h"
2+
#include <c10/util/Logging.h>
23
#include "util.h"
34

45
namespace ffmpeg {

torchvision/csrc/io/decoder/subtitle_stream.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "subtitle_stream.h"
2+
#include <c10/util/Logging.h>
23
#include <limits>
34
#include "util.h"
45

torchvision/csrc/io/decoder/sync_decoder_test.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include <c10/util/Logging.h>
12
#include <dirent.h>
23
#include <gtest/gtest.h>
34
#include "memory_buffer.h"

0 commit comments

Comments
 (0)