Skip to content

Commit 5571c67

Browse files
committed
Merge branch 'main' of github.com:pytorch/torchcodec into remove_getNextAVFrameNoDemux
2 parents 21b8ff2 + ad3049b commit 5571c67

File tree

10 files changed

+67
-232
lines changed

10 files changed

+67
-232
lines changed

.clang-format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ PenaltyExcessCharacter: 1000000
8383
PenaltyReturnTypeOnItsOwnLine: 200
8484
PointerAlignment: Left
8585
ReflowComments: true
86+
SeparateDefinitionBlocks: Always
8687
SortIncludes: true
8788
SortUsingDeclarations: true
8889
SpaceAfterCStyleCast: false

benchmarks/decoders/BenchmarkDecodersMain.cpp

Lines changed: 0 additions & 189 deletions
This file was deleted.

src/torchcodec/decoders/_core/CPUOnlyDevice.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ namespace facebook::torchcodec {
1717
void convertAVFrameToFrameOutputOnCuda(
1818
const torch::Device& device,
1919
[[maybe_unused]] const VideoDecoder::VideoStreamOptions& videoStreamOptions,
20-
[[maybe_unused]] VideoDecoder::AVFrameWithStreamIndex&
21-
avFrameWithStreamIndex,
20+
[[maybe_unused]] VideoDecoder::AVFrameStream& avFrameStream,
2221
[[maybe_unused]] VideoDecoder::FrameOutput& frameOutput,
2322
[[maybe_unused]] std::optional<torch::Tensor> preAllocatedOutputTensor) {
2423
throwUnsupportedDeviceError(device);

src/torchcodec/decoders/_core/CudaDevice.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,10 @@ void initializeContextOnCuda(
186186
void convertAVFrameToFrameOutputOnCuda(
187187
const torch::Device& device,
188188
const VideoDecoder::VideoStreamOptions& videoStreamOptions,
189-
VideoDecoder::AVFrameWithStreamIndex& avFrameWithStreamIndex,
189+
VideoDecoder::AVFrameStream& avFrameStream,
190190
VideoDecoder::FrameOutput& frameOutput,
191191
std::optional<torch::Tensor> preAllocatedOutputTensor) {
192-
AVFrame* avFrame = avFrameWithStreamIndex.avFrame.get();
192+
AVFrame* avFrame = avFrameStream.avFrame.get();
193193

194194
TORCH_CHECK(
195195
avFrame->format == AV_PIX_FMT_CUDA,

src/torchcodec/decoders/_core/DeviceInterface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ void initializeContextOnCuda(
3232
void convertAVFrameToFrameOutputOnCuda(
3333
const torch::Device& device,
3434
const VideoDecoder::VideoStreamOptions& videoStreamOptions,
35-
VideoDecoder::AVFrameWithStreamIndex& avFrameWithStreamIndex,
35+
VideoDecoder::AVFrameStream& avFrameStream,
3636
VideoDecoder::FrameOutput& frameOutput,
3737
std::optional<torch::Tensor> preAllocatedOutputTensor = std::nullopt);
3838

src/torchcodec/decoders/_core/FFMPEGCommon.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,22 @@ namespace facebook::torchcodec {
1313
AutoAVPacket::AutoAVPacket() : avPacket_(av_packet_alloc()) {
1414
TORCH_CHECK(avPacket_ != nullptr, "Couldn't allocate avPacket.");
1515
}
16+
1617
AutoAVPacket::~AutoAVPacket() {
1718
av_packet_free(&avPacket_);
1819
}
1920

2021
ReferenceAVPacket::ReferenceAVPacket(AutoAVPacket& shared)
2122
: avPacket_(shared.avPacket_) {}
23+
2224
ReferenceAVPacket::~ReferenceAVPacket() {
2325
av_packet_unref(avPacket_);
2426
}
27+
2528
AVPacket* ReferenceAVPacket::get() {
2629
return avPacket_;
2730
}
31+
2832
AVPacket* ReferenceAVPacket::operator->() {
2933
return avPacket_;
3034
}

0 commit comments

Comments
 (0)