Skip to content

Commit f6b7b3c

Browse files
authored
Merge pull request #33 from podborski/newMedia
New media, entity groups, large mdat, few bug fixes related to non-timed items, cleanups, catch2 update, etc. etc. No-one from MPEG was able to review and during MPEG#139 we agreed to go ahead and merge it. close #36 close #35
2 parents a21fc6c + 790e745 commit f6b7b3c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+5526
-3773
lines changed

.github/workflows/c-cpp.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@ on:
44
push:
55
branches: [ master ]
66
pull_request:
7-
branches: [ master ]
87

98
jobs:
109
linux:
1110
runs-on: ubuntu-latest
1211
steps:
1312
- uses: actions/checkout@v2
1413
- name: configure
15-
run: mkdir build && cd build && cmake ..
14+
run: mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release ..
1615
- name: build
1716
run: cmake --build build
1817
- name: test
@@ -27,7 +26,7 @@ jobs:
2726
- name: build
2827
run: cmake --build build
2928
- name: test
30-
run: ./bin/unit_tests --wait-for-keypress never -d yes
29+
run: ./bin/unit_tests --wait-for-keypress never -d yes exclude:large_files
3130

3231
windows:
3332
runs-on: windows-latest
@@ -38,4 +37,4 @@ jobs:
3837
- name: build
3938
run: cmake --build build --config Debug
4039
- name: test
41-
run: ./bin/Debug/unit_tests --wait-for-keypress never -d yes
40+
run: ./bin/Debug/unit_tests --wait-for-keypress never -d yes exclude:large_files

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
*.mp4
2+
13
# Build results
24
[Dd]ebug/
35
[Dd]ebugPublic/
Lines changed: 100 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,15 @@
1-
/*
2-
This software module was originally developed by Apple Computer, Inc.
3-
in the course of development of MPEG-4.
4-
This software module is an implementation of a part of one or
5-
more MPEG-4 tools as specified by MPEG-4.
6-
ISO/IEC gives users of MPEG-4 free license to this
7-
software module or modifications thereof for use in hardware
8-
or software products claiming conformance to MPEG-4.
9-
Those intending to use this software module in hardware or software
10-
products are advised that its use may infringe existing patents.
11-
The original developer of this software module and his/her company,
12-
the subsequent editors and their companies, and ISO/IEC have no
13-
liability for use of this software module or modifications thereof
14-
in an implementation.
15-
Copyright is not released for non MPEG-4 conforming
16-
products. Apple Computer, Inc. retains full right to use the code for its own
17-
purpose, assign or donate the code to a third party and to
18-
inhibit third parties from using the code for non
19-
MPEG-4 conforming products.
20-
This copyright notice must be included in all copies or
21-
derivative works. Copyright (c) 1999.
1+
/* This software module was originally developed by Apple Computer, Inc. in the course of
2+
* development of MPEG-4. This software module is an implementation of a part of one or more MPEG-4
3+
* tools as specified by MPEG-4. ISO/IEC gives users of MPEG-4 free license to this software module
4+
* or modifications thereof for use in hardware or software products claiming conformance to MPEG-4.
5+
* Those intending to use this software module in hardware or software products are advised that its
6+
* use may infringe existing patents. The original developer of this software module and his/her
7+
* company, the subsequent editors and their companies, and ISO/IEC have no liability for use of
8+
* this software module or modifications thereof in an implementation. Copyright is not released for
9+
* non MPEG-4 conforming products. Apple Computer, Inc. retains full right to use the code for its
10+
* own purpose, assign or donate the code to a third party and to inhibit third parties from using
11+
* the code for non MPEG-4 conforming products. This copyright notice must be included in all copies
12+
* or derivative works. Copyright (c) 1999.
2213
*/
2314
/*
2415
$Id: HEVCConfigurationAtom.c,v 1.1.1.1 2016/09/14 armin Exp $
@@ -29,108 +20,117 @@
2920
#include <stdlib.h>
3021
#include <string.h>
3122

32-
static void destroy( MP4AtomPtr s )
23+
static void destroy(MP4AtomPtr s)
3324
{
34-
MP4Err err;
35-
ISOIFF_HEVCConfigurationAtomPtr self = (ISOIFF_HEVCConfigurationAtomPtr) s;
36-
err = MP4NoErr;
37-
38-
if ( self == NULL )
39-
BAILWITHERROR( MP4BadParamErr )
40-
41-
if ( self->super )
42-
self->super->destroy( s );
25+
MP4Err err;
26+
ISOIFF_HEVCConfigurationAtomPtr self = (ISOIFF_HEVCConfigurationAtomPtr)s;
27+
err = MP4NoErr;
28+
29+
if(self == NULL) BAILWITHERROR(MP4BadParamErr)
30+
31+
if(self->super) self->super->destroy(s);
4332
bail:
44-
TEST_RETURN( err );
45-
46-
return;
33+
TEST_RETURN(err);
34+
35+
return;
4736
}
4837

49-
static MP4Err serialize( struct MP4Atom* s, char* buffer )
38+
static MP4Err serialize(struct MP4Atom *s, char *buffer)
5039
{
51-
MP4Err err;
52-
u32 configSize;
53-
ISOIFF_HEVCConfigurationAtomPtr self = (ISOIFF_HEVCConfigurationAtomPtr) s;
54-
err = MP4NoErr;
55-
56-
err = MP4SerializeCommonBaseAtomFields( (MP4AtomPtr) s, buffer ); if (err) goto bail;
57-
buffer += self->bytesWritten;
58-
59-
err = MP4GetHandleSize(self->configRecordHandle, &configSize); if (err) goto bail;
60-
61-
PUTBYTES(*self->configRecordHandle, configSize);
62-
63-
assert( self->bytesWritten == self->size );
40+
MP4Err err;
41+
u32 configSize;
42+
ISOIFF_HEVCConfigurationAtomPtr self = (ISOIFF_HEVCConfigurationAtomPtr)s;
43+
err = MP4NoErr;
44+
45+
err = MP4SerializeCommonBaseAtomFields((MP4AtomPtr)s, buffer);
46+
if(err) goto bail;
47+
buffer += self->bytesWritten;
48+
49+
err = MP4GetHandleSize(self->configRecordHandle, &configSize);
50+
if(err) goto bail;
51+
52+
PUTBYTES(*self->configRecordHandle, configSize);
53+
54+
assert(self->bytesWritten == self->size);
6455
bail:
65-
TEST_RETURN( err );
66-
67-
return err;
56+
TEST_RETURN(err);
57+
58+
return err;
6859
}
6960

70-
static MP4Err calculateSize( struct MP4Atom* s )
61+
static MP4Err calculateSize(struct MP4Atom *s)
7162
{
72-
MP4Err err;
73-
u32 configSize;
74-
ISOIFF_HEVCConfigurationAtomPtr self = (ISOIFF_HEVCConfigurationAtomPtr) s;
75-
err = MP4NoErr;
76-
77-
err = MP4CalculateBaseAtomFieldSize( (MP4AtomPtr) s ); if (err) goto bail;
63+
MP4Err err;
64+
u32 configSize;
65+
ISOIFF_HEVCConfigurationAtomPtr self = (ISOIFF_HEVCConfigurationAtomPtr)s;
66+
err = MP4NoErr;
7867

79-
err = MP4GetHandleSize(self->configRecordHandle, &configSize); if (err) goto bail;
80-
self->size += configSize;
68+
err = MP4CalculateBaseAtomFieldSize((MP4AtomPtr)s);
69+
if(err) goto bail;
70+
71+
err = MP4GetHandleSize(self->configRecordHandle, &configSize);
72+
if(err) goto bail;
73+
self->size += configSize;
8174

8275
bail:
83-
TEST_RETURN( err );
84-
85-
return err;
76+
TEST_RETURN(err);
77+
78+
return err;
8679
}
8780

88-
static MP4Err createFromInputStream( MP4AtomPtr s, MP4AtomPtr proto, MP4InputStreamPtr inputStream )
81+
static MP4Err createFromInputStream(MP4AtomPtr s, MP4AtomPtr proto, MP4InputStreamPtr inputStream)
8982
{
90-
MP4Err err;
91-
long bytesToRead;
92-
ISOIFF_HEVCConfigurationAtomPtr self = (ISOIFF_HEVCConfigurationAtomPtr)s;
83+
MP4Err err;
84+
long bytesToRead;
85+
ISOIFF_HEVCConfigurationAtomPtr self = (ISOIFF_HEVCConfigurationAtomPtr)s;
9386

94-
err = MP4NoErr;
95-
if (self == NULL) BAILWITHERROR(MP4BadParamErr)
96-
err = self->super->createFromInputStream(s, proto, (char*)inputStream); if (err) goto bail;
87+
err = MP4NoErr;
88+
if(self == NULL) BAILWITHERROR(MP4BadParamErr)
89+
err = self->super->createFromInputStream(s, proto, (char *)inputStream);
90+
if(err) goto bail;
9791

98-
bytesToRead = s->size - s->bytesRead;
99-
err = MP4NewHandle(bytesToRead, &self->configRecordHandle); if (err) goto bail;
100-
GETBYTES_V(bytesToRead, *self->configRecordHandle);
92+
bytesToRead = s->size - s->bytesRead;
93+
err = MP4NewHandle(bytesToRead, &self->configRecordHandle);
94+
if(err) goto bail;
95+
GETBYTES_V(bytesToRead, *self->configRecordHandle);
10196

102-
err = ISOIFF_CreateHEVCDecConfRecFromHandle(self->configRecordHandle, &self->configRecord); if (err) goto bail;
97+
err = ISOIFF_CreateHEVCDecConfRecFromHandle(self->configRecordHandle, &self->configRecord);
98+
if(err) goto bail;
10399

104100
bail:
105-
TEST_RETURN(err);
101+
TEST_RETURN(err);
106102

107-
return err;
103+
return err;
108104
}
109105

110-
MP4Err ISOIFF_CreateHEVCConfigurationAtom( ISOIFF_HEVCConfigurationAtomPtr *outAtom, ISOIFF_HEVCDecoderConfigRecord configRecord)
106+
MP4Err ISOIFF_CreateHEVCConfigurationAtom(ISOIFF_HEVCConfigurationAtomPtr *outAtom,
107+
ISOIFF_HEVCDecoderConfigRecord configRecord)
111108
{
112-
MP4Err err;
113-
ISOIFF_HEVCConfigurationAtomPtr self;
114-
115-
self = (ISOIFF_HEVCConfigurationAtomPtr) calloc( 1, sizeof(ISOIFF_HEVCConfigurationAtom) );
116-
TESTMALLOC( self );
117-
118-
err = MP4CreateBaseAtom( (MP4AtomPtr) self ); if ( err ) goto bail;
119-
120-
self->type = ISOIFF_4CC_hvcC;
121-
self->name = "HEVC Configuration";
122-
self->createFromInputStream = (cisfunc) createFromInputStream;
123-
self->destroy = destroy;
124-
self->calculateSize = calculateSize;
125-
self->serialize = serialize;
126-
self->configRecord = configRecord;
127-
128-
err = MP4NewHandle(0, &self->configRecordHandle); if (err) goto bail;
129-
err = ISOIFF_PutHEVCDecConfRecordIntoHandle(configRecord, self->configRecordHandle); if (err) goto bail;
130-
131-
*outAtom = self;
109+
MP4Err err;
110+
ISOIFF_HEVCConfigurationAtomPtr self;
111+
112+
self = (ISOIFF_HEVCConfigurationAtomPtr)calloc(1, sizeof(ISOIFF_HEVCConfigurationAtom));
113+
TESTMALLOC(self);
114+
115+
err = MP4CreateBaseAtom((MP4AtomPtr)self);
116+
if(err) goto bail;
117+
118+
self->type = ISOIFF_4CC_hvcC;
119+
self->name = "HEVC Configuration";
120+
self->createFromInputStream = (cisfunc)createFromInputStream;
121+
self->destroy = destroy;
122+
self->calculateSize = calculateSize;
123+
self->serialize = serialize;
124+
self->configRecord = configRecord;
125+
126+
err = MP4NewHandle(0, &self->configRecordHandle);
127+
if(err) goto bail;
128+
err = ISOIFF_PutHEVCDecConfRecordIntoHandle(configRecord, self->configRecordHandle);
129+
if(err) goto bail;
130+
131+
*outAtom = self;
132132
bail:
133-
TEST_RETURN( err );
134-
135-
return err;
133+
TEST_RETURN(err);
134+
135+
return err;
136136
}

0 commit comments

Comments
 (0)