MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / MEM_PTR_CHECK

Function MEM_PTR_CHECK

plugins/wasmedge_ffmpeg/avutil/samplefmt.cpp:50–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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
59Expect<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
71Expect<int32_t>
72AVSamplesAllocArrayAndSamples::body(const Runtime::CallingFrame &Frame,

Callers

nothing calls this directly

Calls 1

c_strMethod · 0.80

Tested by

no test coverage detected