Skip to content

Commit bda5c88

Browse files
authored
Remove unused fields from RawDecodedOutput struct (#456)
1 parent 261b9b2 commit bda5c88

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed

src/torchcodec/decoders/_core/VideoDecoder.h

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -160,33 +160,13 @@ class VideoDecoder {
160160
// Calling getNextFrameOutputNoDemuxInternal() will return the first frame at
161161
// or after this position.
162162
void setCursorPtsInSeconds(double seconds);
163-
// This is an internal structure that is used to store the decoded output
164-
// from decoding a frame through color conversion. Example usage is:
165-
//
166-
// RawDecodedOutput rawOutput = getDecodedOutputWithFilter();
167-
// // Now allocate a single tensor or a batch tensor.
168-
// torch::Tensor userOutput = torch::empty(...);
169-
// // Now fill in `data` and `size`.
170-
// rawOutput.data = userOutput.data_ptr();
171-
// // Now run the color conversion.
172-
// convertFrameToBufferUsingSwsScale(rawOutput);
173-
//
174-
// This structure ensures we always keep the streamIndex and frame together
175-
// with the data output. Note that AVFrame itself doesn't retain the
176-
// streamIndex.
163+
// This structure ensures we always keep the streamIndex and AVFrame together
164+
// Note that AVFrame itself doesn't retain the streamIndex.
177165
struct RawDecodedOutput {
178166
// The actual decoded output as a unique pointer to an AVFrame.
179167
UniqueAVFrame frame;
180168
// The stream index of the decoded frame.
181169
int streamIndex;
182-
// This is an unowned pointer that we copy the frame data to after color
183-
// conversion.
184-
// For a single tensor this points to the start of data_ptr. For a batch
185-
// tensor it may point to the middle of the allocated batch tensor.
186-
void* data = nullptr;
187-
// We carry around the size to ensure we don't stomp on memory while doing
188-
// color conversion.
189-
size_t size = 0;
190170
};
191171
struct DecodedOutput {
192172
// The actual decoded output as a Tensor.

0 commit comments

Comments
 (0)