Beispiel #1
0
void MP4RtpAtom::WriteHntiType()
{
    // since length of string is implicit in size of atom
    // we need to handle this specially, and not write the terminating \0
    MP4StringProperty* pSdp = (MP4StringProperty*)m_pProperties[1];
    pSdp->SetFixedLength(strlen(pSdp->GetValue()));
    MP4Atom::Write();
    pSdp->SetFixedLength(0);
}
Beispiel #2
0
void MP4SdpAtom::Write()
{
	// since length of string is implicit in size of atom
	// we need to handle this specially, and not write the terminating \0
	MP4StringProperty* pSdp = (MP4StringProperty*)m_pProperties[0];
	const char* sdpText = pSdp->GetValue();
	if (sdpText) {
		pSdp->SetFixedLength(strlen(sdpText));
	}
	MP4Atom::Write();
	pSdp->SetFixedLength(0);
}
Beispiel #3
0
MP4EncvAtom::MP4EncvAtom() 
	: MP4Atom("encv")
{
	AddReserved("reserved1", 6); /* 0 */

	AddProperty( /* 1 */
		new MP4Integer16Property("dataReferenceIndex"));

	AddReserved("reserved2", 16); /* 2 */

	AddProperty( /* 3 */
		new MP4Integer16Property("width"));
	AddProperty( /* 4 */
		new MP4Integer16Property("height"));

	AddReserved("reserved3", 14); /* 5 */

	MP4StringProperty* pProp = 
		new MP4StringProperty("compressorName");
	pProp->SetFixedLength(32);
	pProp->SetValue("");
	AddProperty(pProp); /* 6 */
	AddReserved("reserved4", 4); /* 7 */

	ExpectChildAtom("esds", Required, OnlyOne);
	ExpectChildAtom("sinf", Required, OnlyOne);
	ExpectChildAtom("avcC", Optional, OnlyOne);
}	
MP4AvspAtom::MP4AvspAtom() 
	: MP4Atom("avsp")
{
	AddReserved("reserved1", 6); /* 0 */

	AddProperty( /* 1 */
		new MP4Integer16Property("dataReferenceIndex"));

	AddReserved("reserved2", 16); /* 2 */

	AddProperty( /* 3 */
		new MP4Integer16Property("width"));
	AddProperty( /* 4 */
		new MP4Integer16Property("height"));

	AddReserved("reserved3", 14); /* 5 */

	MP4StringProperty* pProp = 
		new MP4StringProperty("compressorName");
	pProp->SetFixedLength(32);
	pProp->SetValue("AVS-M Parameters");
	AddProperty(pProp); /* 6 */

	AddReserved("reserved4", 4); /* 7 */

	ExpectChildAtom("avsc", Required, OnlyOne);
	ExpectChildAtom("btrt", Optional, OnlyOne);
	// for now ExpectChildAtom("m4ds", Optional, OnlyOne);
}
Beispiel #5
0
MP4Mp4vAtom::MP4Mp4vAtom(MP4File &file)
        : MP4Atom(file, "mp4v")
{
    AddReserved(*this, "reserved1", 6); /* 0 */

    AddProperty( /* 1 */
        new MP4Integer16Property(*this, "dataReferenceIndex"));

    AddReserved(*this, "reserved2", 16); /* 2 */

    AddProperty( /* 3 */
        new MP4Integer16Property(*this, "width"));
    AddProperty( /* 4 */
        new MP4Integer16Property(*this, "height"));

    AddReserved(*this, "reserved3", 14); /* 5 */

    MP4StringProperty* pProp =
        new MP4StringProperty(*this, "compressorName");
    pProp->SetFixedLength(32);
    pProp->SetCountedFormat(true);
    pProp->SetValue("");
    AddProperty(pProp); /* 6 */

    AddReserved(*this, "reserved4", 4); /* 7 */

    ExpectChildAtom("colr", Optional, OnlyOne);
    ExpectChildAtom("esds", Required, OnlyOne);
    ExpectChildAtom("pasp", Optional, OnlyOne);
}
Beispiel #6
0
MP4VideoAtom::MP4VideoAtom (const char *type)
        : MP4Atom(type)
{
    AddReserved("reserved1", 6); /* 0 */

    AddProperty( /* 1 */
        new MP4Integer16Property("dataReferenceIndex"));

    AddReserved("reserved2", 16); /* 2 */

    AddProperty( /* 3 */
        new MP4Integer16Property("width"));
    AddProperty( /* 4 */
        new MP4Integer16Property("height"));

    AddReserved("reserved3", 14); /* 5 */

    MP4StringProperty* pProp =
        new MP4StringProperty("compressorName");
    pProp->SetFixedLength(32);
    pProp->SetCountedFormat(true);
    pProp->SetValue("");
    AddProperty(pProp); /* 6 */

    AddProperty(/* 7 */
        new MP4Integer16Property("depth"));
    AddProperty(/* 8 */
        new MP4Integer16Property("colorTableId"));
    ExpectChildAtom("smi ", Optional, OnlyOne);
}
Beispiel #7
0
void MP4RtpAtom::AddPropertiesHntiType()
{
    MP4StringProperty* pProp =
        new MP4StringProperty("descriptionFormat");
    pProp->SetFixedLength(4);
    AddProperty(pProp); /* 0 */

    AddProperty( /* 1 */
        new MP4StringProperty("sdpText"));
}
Beispiel #8
0
MP4HdlrAtom::MP4HdlrAtom() 
    : MP4Atom("hdlr")
{
    AddVersionAndFlags(); /* 0, 1 */
    AddReserved("reserved1", 4); /* 2 */
    MP4StringProperty* pProp = new MP4StringProperty("handlerType");
    pProp->SetFixedLength(4);
    AddProperty(pProp); /* 3 */
    AddReserved("reserved2", 12); /* 4 */
    AddProperty( /* 5 */
        new MP4StringProperty("name"));
}
Beispiel #9
0
MP4ColrAtom::MP4ColrAtom()
        : MP4Atom("colr")
{
    MP4StringProperty* cpt = new MP4StringProperty("colorParameterType");
    cpt->SetFixedLength(4);
    AddProperty(cpt); /* 0 */

    AddProperty( /* 1 */ new MP4Integer16Property("primariesIndex"));

    AddProperty( /* 2 */ new MP4Integer16Property("transferFunctionIndex"));

    AddProperty( /* 3 */ new MP4Integer16Property("matrixIndex"));
}
Beispiel #10
0
MP4FtypAtom::MP4FtypAtom() 
	: MP4Atom("ftyp")
{
	MP4StringProperty* pProp = new MP4StringProperty("majorBrand");
	pProp->SetFixedLength(4);
	AddProperty(pProp); /* 0 */

	AddProperty( /* 1 */
		new MP4Integer32Property("minorVersion"));

	MP4Integer32Property* pCount = 
		new MP4Integer32Property("compatibleBrandsCount"); 
	pCount->SetImplicit();
	AddProperty(pCount); /* 2 */

	MP4TableProperty* pTable = 
		new MP4TableProperty("compatibleBrands", pCount);
	AddProperty(pTable); /* 3 */

	pProp = new MP4StringProperty("brand");
	pProp->SetFixedLength(4);
	pTable->AddProperty(pProp);
}