Skip to content

Commit 0eb7eb0

Browse files
authored
Move torchcodec/decoders/_core into torchcodec/_core (#609)
1 parent f416dcf commit 0eb7eb0

35 files changed

+52
-51
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.18)
22
project(TorchCodec)
33

4-
add_subdirectory(src/torchcodec/decoders/_core)
4+
add_subdirectory(src/torchcodec/_core)
55

66

77
option(BUILD_TESTS "Build tests" OFF)

benchmarks/decoders/benchmark_decoders_library.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313

1414
import torch
1515
import torch.utils.benchmark as benchmark
16-
from torchcodec.decoders import VideoDecoder, VideoStreamMetadata
1716

18-
from torchcodec.decoders._core import (
17+
from torchcodec._core import (
1918
_add_video_stream,
2019
create_from_file,
2120
get_frames_at_indices,
@@ -24,6 +23,7 @@
2423
get_next_frame,
2524
seek_to_pts,
2625
)
26+
from torchcodec.decoders import VideoDecoder, VideoStreamMetadata
2727

2828
torch._dynamo.config.cache_size_limit = 100
2929
torch._dynamo.config.capture_dynamic_output_shape_ops = True

benchmarks/decoders/gpu_benchmark.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def decode_full_video(video_path, decode_device_string, resize_device_string):
2525
# We use the core API instead of SimpleVideoDecoder because the core API
2626
# allows us to natively resize as part of the decode step.
2727
print(f"{decode_device_string=} {resize_device_string=}")
28-
decoder = torchcodec.decoders._core.create_from_file(video_path)
28+
decoder = torchcodec._core.create_from_file(video_path)
2929
num_threads = None
3030
if "cuda" in decode_device_string:
3131
num_threads = 1
@@ -34,7 +34,7 @@ def decode_full_video(video_path, decode_device_string, resize_device_string):
3434
if "native" in resize_device_string:
3535
width = RESIZED_WIDTH
3636
height = RESIZED_HEIGHT
37-
torchcodec.decoders._core._add_video_stream(
37+
torchcodec._core._add_video_stream(
3838
decoder,
3939
stream_index=-1,
4040
device=decode_device_string,
@@ -47,7 +47,7 @@ def decode_full_video(video_path, decode_device_string, resize_device_string):
4747
frame_count = 0
4848
while True:
4949
try:
50-
frame, *_ = torchcodec.decoders._core.get_next_frame(decoder)
50+
frame, *_ = torchcodec._core.get_next_frame(decoder)
5151
if resize_device_string != "none" and "native" not in resize_device_string:
5252
frame = transfer_and_resize_frame(frame, resize_device_string)
5353

benchmarks/decoders/memprofile_decoders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import torch
1111
from memory_profiler import profile
12-
from torchcodec.decoders._core import add_video_stream, create_from_file, get_next_frame
12+
from torchcodec._core import add_video_stream, create_from_file, get_next_frame
1313

1414
torch._dynamo.config.cache_size_limit = 100
1515
torch._dynamo.config.capture_dynamic_output_shape_ops = True

src/torchcodec/decoders/_core/AVIOBytesContext.cpp renamed to src/torchcodec/_core/AVIOBytesContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// This source code is licensed under the BSD-style license found in the
55
// LICENSE file in the root directory of this source tree.
66

7-
#include "src/torchcodec/decoders/_core/AVIOBytesContext.h"
7+
#include "src/torchcodec/_core/AVIOBytesContext.h"
88
#include <torch/types.h>
99

1010
namespace facebook::torchcodec {

src/torchcodec/decoders/_core/AVIOBytesContext.h renamed to src/torchcodec/_core/AVIOBytesContext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#pragma once
88

9-
#include "src/torchcodec/decoders/_core/AVIOContextHolder.h"
9+
#include "src/torchcodec/_core/AVIOContextHolder.h"
1010

1111
namespace facebook::torchcodec {
1212

src/torchcodec/decoders/_core/AVIOContextHolder.cpp renamed to src/torchcodec/_core/AVIOContextHolder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// This source code is licensed under the BSD-style license found in the
55
// LICENSE file in the root directory of this source tree.
66

7-
#include "src/torchcodec/decoders/_core/AVIOContextHolder.h"
7+
#include "src/torchcodec/_core/AVIOContextHolder.h"
88
#include <torch/types.h>
99

1010
namespace facebook::torchcodec {

src/torchcodec/decoders/_core/AVIOContextHolder.h renamed to src/torchcodec/_core/AVIOContextHolder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#pragma once
88

9-
#include "src/torchcodec/decoders/_core/FFMPEGCommon.h"
9+
#include "src/torchcodec/_core/FFMPEGCommon.h"
1010

1111
namespace facebook::torchcodec {
1212

src/torchcodec/decoders/_core/AVIOFileLikeContext.cpp renamed to src/torchcodec/_core/AVIOFileLikeContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// This source code is licensed under the BSD-style license found in the
55
// LICENSE file in the root directory of this source tree.
66

7-
#include "src/torchcodec/decoders/_core/AVIOFileLikeContext.h"
7+
#include "src/torchcodec/_core/AVIOFileLikeContext.h"
88
#include <torch/types.h>
99

1010
namespace facebook::torchcodec {

src/torchcodec/decoders/_core/AVIOFileLikeContext.h renamed to src/torchcodec/_core/AVIOFileLikeContext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <pybind11/pybind11.h>
1010
#include <pybind11/stl.h>
1111

12-
#include "src/torchcodec/decoders/_core/AVIOContextHolder.h"
12+
#include "src/torchcodec/_core/AVIOContextHolder.h"
1313

1414
namespace py = pybind11;
1515

0 commit comments

Comments
 (0)