123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- #include "mp4common.h"
- MP4ODUpdateDescriptor::MP4ODUpdateDescriptor()
- : MP4Descriptor(MP4ODUpdateODCommandTag)
- {
-
- AddProperty(
- new MP4DescriptorProperty(NULL,
- MP4FileODescrTag, 0, Required, Many));
- }
- MP4ODRemoveDescriptor::MP4ODRemoveDescriptor()
- : MP4Descriptor(MP4ODRemoveODCommandTag)
- {
- MP4Integer32Property* pCount =
- new MP4Integer32Property("entryCount");
- pCount->SetImplicit();
- AddProperty(pCount);
- MP4TableProperty* pTable =
- new MP4TableProperty("entries", pCount);
- AddProperty(pTable);
- pTable->AddProperty(
- new MP4BitfieldProperty("objectDescriptorId", 10));
- }
- void MP4ODRemoveDescriptor::Read(MP4File* pFile)
- {
-
- ((MP4Integer32Property*)m_pProperties[0])->SetReadOnly(false);
- ((MP4Integer32Property*)m_pProperties[0])->SetValue((m_size * 8) / 10);
- ((MP4Integer32Property*)m_pProperties[0])->SetReadOnly(true);
- MP4Descriptor::Read(pFile);
- }
- MP4ESUpdateDescriptor::MP4ESUpdateDescriptor()
- : MP4Descriptor(MP4ESUpdateODCommandTag)
- {
- AddProperty(
- new MP4BitfieldProperty("objectDescriptorId", 10));
- AddProperty(
- new MP4BitfieldProperty("pad", 6));
- AddProperty(
- new MP4DescriptorProperty("esIdRefs",
- MP4ESIDRefDescrTag, 0, Required, Many));
- }
- MP4ESRemoveDescriptor::MP4ESRemoveDescriptor()
- : MP4Descriptor(MP4ESRemoveODCommandTag)
- {
- AddProperty(
- new MP4BitfieldProperty("objectDescriptorId", 10));
- AddProperty(
- new MP4BitfieldProperty("pad", 6));
- AddProperty(
- new MP4DescriptorProperty("esIdRefs",
- MP4ESIDRefDescrTag, 0, Required, Many));
- }
- MP4Descriptor* CreateODCommand(u_int8_t tag)
- {
- MP4Descriptor* pDescriptor = NULL;
- switch (tag) {
- case MP4ODUpdateODCommandTag:
- pDescriptor = new MP4ODUpdateDescriptor();
- break;
- case MP4ODRemoveODCommandTag:
- pDescriptor = new MP4ODRemoveDescriptor();
- break;
- case MP4ESUpdateODCommandTag:
- pDescriptor = new MP4ESUpdateDescriptor();
- break;
- case MP4ESRemoveODCommandTag:
- pDescriptor = new MP4ESRemoveDescriptor();
- break;
- }
- return pDescriptor;
- }
|