@@ -46,43 +46,28 @@ MP4Err MP4ParseAtomUsingProtoList(MP4InputStreamPtr inputStream, u32 *protoList,
4646 MP4AtomPtr * outAtom );
4747
4848#ifdef ISMACrypt
49- u32 MP4SampleEntryProtos [] = {MP4MPEGSampleEntryAtomType ,
50- MP4VisualSampleEntryAtomType ,
51- MP4AudioSampleEntryAtomType ,
52- MP4EncAudioSampleEntryAtomType ,
53- MP4EncVisualSampleEntryAtomType ,
54- MP4XMLMetaSampleEntryAtomType ,
55- MP4TextMetaSampleEntryAtomType ,
56- MP4AMRSampleEntryAtomType ,
57- MP4AWBSampleEntryAtomType ,
58- MP4AMRWPSampleEntryAtomType ,
59- MP4H263SampleEntryAtomType ,
60- MP4RestrictedVideoSampleEntryAtomType ,
61- MP4BoxedMetadataSampleEntryType ,
62- ISOAVCSampleEntryAtomType ,
63- ISOHEVCSampleEntryAtomType ,
64- ISOVVCSampleEntryAtomTypeInBand ,
65- ISOVVCSampleEntryAtomTypeOutOfBand ,
66- ISOVVCSubpicSampleEntryAtomType ,
67- 0 };
49+ u32 MP4SampleEntryProtos [] = {
50+ MP4MPEGSampleEntryAtomType , MP4VisualSampleEntryAtomType ,
51+ MP4AudioSampleEntryAtomType , MP4EncAudioSampleEntryAtomType ,
52+ MP4EncVisualSampleEntryAtomType , MP4XMLMetaSampleEntryAtomType ,
53+ MP4TextMetaSampleEntryAtomType , MP4AMRSampleEntryAtomType ,
54+ MP4AWBSampleEntryAtomType , MP4AMRWPSampleEntryAtomType ,
55+ MP4H263SampleEntryAtomType , MP4RestrictedVideoSampleEntryAtomType ,
56+ MP4BoxedMetadataSampleEntryType , MP4T35SampleGroupEntry ,
57+ ISOAVCSampleEntryAtomType , ISOHEVCSampleEntryAtomType ,
58+ ISOVVCSampleEntryAtomTypeInBand , ISOVVCSampleEntryAtomTypeOutOfBand ,
59+ ISOVVCSubpicSampleEntryAtomType , 0 };
6860#else
69- u32 MP4SampleEntryProtos [] = {MP4MPEGSampleEntryAtomType ,
70- MP4VisualSampleEntryAtomType ,
71- MP4AudioSampleEntryAtomType ,
72- MP4XMLMetaSampleEntryAtomType ,
73- MP4TextMetaSampleEntryAtomType ,
74- MP4AMRSampleEntryAtomType ,
75- MP4AWBSampleEntryAtomType ,
76- MP4AMRWPSampleEntryAtomType ,
77- MP4H263SampleEntryAtomType ,
78- MP4RestrictedVideoSampleEntryAtomType ,
79- MP4BoxedMetadataSampleEntryType ,
80- ISOAVCSampleEntryAtomType ,
81- ISOHEVCSampleEntryAtomType ,
82- ISOVVCSampleEntryAtomTypeInBand ,
83- ISOVVCSampleEntryAtomTypeOutOfBand ,
84- ISOVVCSubpicSampleEntryAtomType ,
85- 0 };
61+ u32 MP4SampleEntryProtos [] = {
62+ MP4MPEGSampleEntryAtomType , MP4VisualSampleEntryAtomType ,
63+ MP4AudioSampleEntryAtomType , MP4XMLMetaSampleEntryAtomType ,
64+ MP4TextMetaSampleEntryAtomType , MP4AMRSampleEntryAtomType ,
65+ MP4AWBSampleEntryAtomType , MP4AMRWPSampleEntryAtomType ,
66+ MP4H263SampleEntryAtomType , MP4RestrictedVideoSampleEntryAtomType ,
67+ MP4BoxedMetadataSampleEntryType , MP4T35SampleGroupEntry ,
68+ ISOAVCSampleEntryAtomType , ISOHEVCSampleEntryAtomType ,
69+ ISOVVCSampleEntryAtomTypeInBand , ISOVVCSampleEntryAtomTypeOutOfBand ,
70+ ISOVVCSubpicSampleEntryAtomType , 0 };
8671#endif
8772
8873MP4Err sampleEntryHToAtomPtr (MP4Handle sampleEntryH , MP4AtomPtr * entryPtr , u32 defaultType )
@@ -2505,6 +2490,7 @@ ISONewT35SampleDescription(MP4T35MetadataSampleEntryPtr *outSE, u32 dataReferenc
25052490{
25062491 MP4Err err ;
25072492 MP4T35MetadataSampleEntryPtr it35 ;
2493+ MP4HumanReadableStreamDescriptionAtomPtr hrsd ;
25082494 u8 * identifier = NULL ;
25092495 u32 identifierSize = 0 ;
25102496 char * description = NULL ;
@@ -2520,10 +2506,23 @@ ISONewT35SampleDescription(MP4T35MetadataSampleEntryPtr *outSE, u32 dataReferenc
25202506 if (err ) goto bail ;
25212507 it35 -> dataReferenceIndex = dataReferenceIndex ;
25222508
2523- /* Set description and t35_identifier fields */
2524- it35 -> description = description ;
2525- it35 -> t35_identifier = identifier ;
2526- it35 -> t35_identifier_size = identifierSize ;
2509+ /* Set t35_identifier_length and t35_identifier fields */
2510+ it35 -> t35_identifier_length = identifierSize ;
2511+ it35 -> t35_identifier = identifier ;
2512+
2513+ if (description != NULL && description [0 ] != '\0' )
2514+ {
2515+ err = MP4MakeLinkedList (& it35 -> ExtensionAtomList );
2516+ if (err ) goto bail ;
2517+
2518+ err = MP4CreateHumanReadableStreamDescriptionAtom (& hrsd );
2519+ if (err ) goto bail ;
2520+ hrsd -> description = strdup (description );
2521+ TESTMALLOC (hrsd -> description );
2522+
2523+ err = MP4AddListEntry ((void * )hrsd , it35 -> ExtensionAtomList );
2524+ if (err ) goto bail ;
2525+ }
25272526
25282527 * outSE = it35 ;
25292528
@@ -2606,41 +2605,3 @@ ISONewT35MetadataTrack(MP4Movie theMovie, u32 timescale, const char *t35_prefix_
26062605 TEST_RETURN (err );
26072606 return err ;
26082607}
2609-
2610- ISO_EXTERN (ISOErr )
2611- ISOGetT35SampleEntryFields (MP4Handle sampleEntryH , u8 * * outIdentifier , u32 * outIdentifierSize ,
2612- char * * outDescription )
2613- {
2614- MP4Err err ;
2615- MP4T35MetadataSampleEntryPtr it35 = NULL ;
2616-
2617- if (sampleEntryH == NULL || outIdentifier == NULL || outIdentifierSize == NULL )
2618- BAILWITHERROR (MP4BadParamErr );
2619-
2620- * outIdentifier = NULL ;
2621- * outIdentifierSize = 0 ;
2622- if (outDescription ) * outDescription = NULL ;
2623-
2624- err = sampleEntryHToAtomPtr (sampleEntryH , (MP4AtomPtr * )& it35 , MP4T35MetadataSampleEntryType );
2625- if (err ) goto bail ;
2626-
2627- if (it35 -> t35_identifier == NULL || it35 -> t35_identifier_size == 0 ) BAILWITHERROR (MP4NotFoundErr );
2628-
2629- * outIdentifier = (u8 * )calloc (it35 -> t35_identifier_size , 1 );
2630- TESTMALLOC (* outIdentifier );
2631- memcpy (* outIdentifier , it35 -> t35_identifier , it35 -> t35_identifier_size );
2632- * outIdentifierSize = it35 -> t35_identifier_size ;
2633-
2634- if (outDescription && it35 -> description && it35 -> description [0 ] != '\0' )
2635- {
2636- u32 len = (u32 )strlen (it35 -> description ) + 1 ;
2637- * outDescription = (char * )calloc (len , 1 );
2638- TESTMALLOC (* outDescription );
2639- memcpy (* outDescription , it35 -> description , len );
2640- }
2641-
2642- bail :
2643- if (it35 ) it35 -> destroy ((MP4AtomPtr )it35 );
2644- TEST_RETURN (err );
2645- return err ;
2646- }
0 commit comments