| 48 | uint32_t Str, uint32_t StrLen) { |
| 49 | MEMINST_CHECK(MemInst, Frame, 0); |
| 50 | MEM_PTR_CHECK(StrId, MemInst, char, Str, ""); |
| 51 | |
| 52 | std::string TargetUrl; |
| 53 | std::copy_n(StrId, StrLen, std::back_inserter(TargetUrl)); |
| 54 | |
| 55 | AVSampleFormat const AvSampleFormat = av_get_sample_fmt(TargetUrl.c_str()); |
| 56 | return FFmpegUtils::SampleFmt::toSampleID(AvSampleFormat); |
| 57 | } |
| 58 | |
| 59 | Expect<int32_t> AVSamplesGetBufferSize::body(const Runtime::CallingFrame &, |
| 60 | int32_t NbChannels, |
| 61 | int32_t NbSamples, |
| 62 | uint32_t SampleFormatId, |
| 63 | int32_t Align) { |
| 64 | AVSampleFormat const AvSampleFormat = |
| 65 | FFmpegUtils::SampleFmt::fromSampleID(SampleFormatId); |
| 66 | return av_samples_get_buffer_size(nullptr, NbChannels, NbSamples, |
| 67 | AvSampleFormat, |
| 68 | Align); // linesize is NULL in RustSDK. |
| 69 | } |
| 70 | |
| 71 | Expect<int32_t> |
| 72 | AVSamplesAllocArrayAndSamples::body(const Runtime::CallingFrame &Frame, |