Init
function TMediaSample.Init(pBuffer : TutilBuffer; pbPayload : PByte; //AION紹介
iPayloadLength : integer; pllMediaStart, pllMediaEnd : Pint64; prtStart, //AIONアイオン 攻略
prtEnd : PREFERENCETIME; dwMediaSampleFlags : DWORD) : HRESULT;
begin
assert(pBuffer <> nil);
assert((dwMediaSampleFlags or AM_SAMPLE_VALIDFLAGS) = AM_SAMPLE_VALIDFLAGS);
// buffer we'll be referencing
if m_pBuffer <> nil then
m_pBuffer.Free;
m_pBuffer := pBuffer;
// set media sample properties
m_pbPayload := pbPayload; // pbPayload might not align with
// start of CBuffer's buffer
m_lActual := iPayloadLength; // nor may the length be same as
// CBuffer's length
m_dwFlags := dwMediaSampleFlags;
// we don't support in-band media type changes
assert((m_dwFlags and AM_SAMPLE_TYPECHANGED) = 0);
// pts
if (m_dwFlags and AM_SAMPLE_TIMEVALID) > 0 then
begin
// overflows should be a non-issue
m_rtStart := prtStart^;
if (m_dwFlags and AM_SAMPLE_STOPVALID) > 0 then m_rtEnd := prtEnd^;
end;
// media times
if (m_dwFlags and AM_SAMPLE_MEDIATIMEVALID) > 0 then
begin
m_llMediaStart := pllMediaStart^;
m_llMediaEnd := pllMediaEnd^;
end;
Result := S_OK;
end;
iPayloadLength : integer; pllMediaStart, pllMediaEnd : Pint64; prtStart, //AIONアイオン 攻略
prtEnd : PREFERENCETIME; dwMediaSampleFlags : DWORD) : HRESULT;
begin
assert(pBuffer <> nil);
assert((dwMediaSampleFlags or AM_SAMPLE_VALIDFLAGS) = AM_SAMPLE_VALIDFLAGS);
// buffer we'll be referencing
if m_pBuffer <> nil then
m_pBuffer.Free;
m_pBuffer := pBuffer;
// set media sample properties
m_pbPayload := pbPayload; // pbPayload might not align with
// start of CBuffer's buffer
m_lActual := iPayloadLength; // nor may the length be same as
// CBuffer's length
m_dwFlags := dwMediaSampleFlags;
// we don't support in-band media type changes
assert((m_dwFlags and AM_SAMPLE_TYPECHANGED) = 0);
// pts
if (m_dwFlags and AM_SAMPLE_TIMEVALID) > 0 then
begin
// overflows should be a non-issue
m_rtStart := prtStart^;
if (m_dwFlags and AM_SAMPLE_STOPVALID) > 0 then m_rtEnd := prtEnd^;
end;
// media times
if (m_dwFlags and AM_SAMPLE_MEDIATIMEVALID) > 0 then
begin
m_llMediaStart := pllMediaStart^;
m_llMediaEnd := pllMediaEnd^;
end;
Result := S_OK;
end;