Skip to content

Commit

Permalink
Disambiguate audio sample stride
Browse files Browse the repository at this point in the history
Summary:
"Audio sample stride" has be used to designate the audio sample frame stride, meaning the stride of the group of audio samples captured synchronously, not the padded size of a single audio channel sample.
This diff changes the name of the constant and better documents what it means, without breaking compatibility with existing files, as the label saved in vrs files reamains unchanged.

Reviewed By: perdoch

Differential Revision: D64868230

fbshipit-source-id: 9ae1e85ccd1375f0812808cfcae84dfcd4bad2b9
  • Loading branch information
Georges Berenger authored and facebook-github-bot committed Oct 24, 2024
1 parent 0a3351b commit 48a30b7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions vrs/DataLayoutConventions.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,9 @@ class VideoFrameSpec : public AutoDataLayout {
constexpr const char* kAudioFormat = "audio_format";
/// DataLayout convention name for the audio sample format (see vrs::AudioSampleFormat).
constexpr const char* kAudioSampleFormat = "audio_sample_format";
/// DataLayout convention name for the padded number of bytes per sample.
constexpr const char* kAudioSampleStride = "audio_sample_stride";
/// DataLayout convention name for the padded number of bytes per sample frame.
/// A sample frame is made of kAudioChannelCount synchronous audio channel samples.
constexpr const char* kAudioSampleFrameStride = "audio_sample_stride";
/// DataLayout convention name for the audio channel count: mono = 1, stereo = 2, etc.
constexpr const char* kAudioChannelCount = "audio_channel_count";
/// DataLayout convention name for the sample rate (samples per seconde).
Expand All @@ -137,7 +138,7 @@ class AudioSpec : public AutoDataLayout {
public:
DataPieceEnum<AudioFormat, uint8_t> audioFormat{kAudioFormat}; ///< optional
DataPieceEnum<AudioSampleFormat, uint8_t> sampleType{kAudioSampleFormat};
DataPieceValue<uint8_t> sampleStride{kAudioSampleStride};
DataPieceValue<uint8_t> sampleStride{kAudioSampleFrameStride};
DataPieceValue<uint8_t> channelCount{kAudioChannelCount};
DataPieceValue<uint32_t> sampleRate{kAudioSampleRate};
DataPieceValue<uint32_t> sampleCount{kAudioSampleCount};
Expand Down

0 comments on commit 48a30b7

Please sign in to comment.