123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- #include "mp4common.h"
- MP4SdpAtom::MP4SdpAtom() : MP4Atom("sdp ")
- {
- AddProperty(
- new MP4StringProperty("sdpText"));
- }
- void MP4SdpAtom::Read()
- {
-
- u_int64_t size = GetEnd() - m_pFile->GetPosition();
- char* data = (char*)MP4Malloc(size + 1);
- ASSERT(data != NULL);
- m_pFile->ReadBytes((u_int8_t*)data, size);
- data[size] = '\0';
- ((MP4StringProperty*)m_pProperties[0])->SetValue(data);
- MP4Free(data);
- }
- void MP4SdpAtom::Write()
- {
-
-
- MP4StringProperty* pSdp = (MP4StringProperty*)m_pProperties[0];
- const char* sdpText = pSdp->GetValue();
- if (sdpText) {
- pSdp->SetFixedLength((u_int32_t)strlen(sdpText));
- }
- MP4Atom::Write();
- pSdp->SetFixedLength(0);
- }
|