Skip to content

Commit

Permalink
Add audio
Browse files Browse the repository at this point in the history
  • Loading branch information
msg7086 committed May 29, 2020
1 parent 6b451a2 commit ce2f8bb
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion include/dualsynth/ds_videoinfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ struct DSVideoInfo
int Width {0}, Height {0};
int Frames {0};

int Audio_SPS {0};
int Audio_SType {0};
int64_t Audio_NSamples {0};
int Audio_NChannels {0};

DSVideoInfo() {}
DSVideoInfo(const VSVideoInfo* vsvi, const VSCore* vscore, const VSAPI* vsapi)
: Format(vsvi->format, vscore, vsapi)
Expand All @@ -26,11 +31,15 @@ struct DSVideoInfo
, FPSNum(avsvi.fps_numerator), FPSDenom(avsvi.fps_denominator)
, Width(avsvi.width), Height(avsvi.height)
, Frames(avsvi.num_frames)
, Audio_SPS(avsvi.audio_samples_per_second)
, Audio_SType(avsvi.sample_type)
, Audio_NSamples(avsvi.num_audio_samples)
, Audio_NChannels(avsvi.nchannels)
{}
const VSVideoInfo* ToVSVI() {
return new VSVideoInfo {Format.ToVSFormat(), FPSNum, FPSDenom, Width, Height, Frames, 0};
}
const VideoInfo ToAVSVI() {
return VideoInfo{Width, Height, static_cast<unsigned>(FPSNum), static_cast<unsigned>(FPSDenom), Frames, Format.ToAVSFormat()};
return VideoInfo{Width, Height, static_cast<unsigned>(FPSNum), static_cast<unsigned>(FPSDenom), Frames, Format.ToAVSFormat(), Audio_SPS, Audio_SType, Audio_NSamples, Audio_NChannels};
}
};

0 comments on commit ce2f8bb

Please sign in to comment.