Skip to content

Commit

Permalink
added initial support for DASH on-demand profile
Browse files Browse the repository at this point in the history
more complete support for sidx atoms and indexing
  • Loading branch information
bok committed Jan 9, 2015
1 parent 7892730 commit df04891
Show file tree
Hide file tree
Showing 35 changed files with 1,639 additions and 313 deletions.
1 change: 1 addition & 0 deletions Build/Makefiles/Lib.mak
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ CORE_SOURCES = \
Ap4Movie.cpp \
Ap4MvhdAtom.cpp \
Ap4NmhdAtom.cpp \
Ap4SthdAtom.cpp \
Ap4OdafAtom.cpp \
Ap4OddaAtom.cpp \
Ap4OdheAtom.cpp \
Expand Down
249 changes: 180 additions & 69 deletions Build/Targets/universal-apple-macosx/Bento4.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@
<ClCompile Include="..\..\..\..\Source\C++\Core\Ap4Mpeg2Ts.cpp" />
<ClCompile Include="..\..\..\..\Source\C++\Core\Ap4MvhdAtom.cpp" />
<ClCompile Include="..\..\..\..\Source\C++\Core\Ap4NmhdAtom.cpp" />
<ClCompile Include="..\..\..\..\Source\C++\Core\Ap4SthdAtom.cpp" />
<ClCompile Include="..\..\..\..\Source\C++\Core\Ap4ObjectDescriptor.cpp" />
<ClCompile Include="..\..\..\..\Source\C++\Core\Ap4OdafAtom.cpp" />
<ClCompile Include="..\..\..\..\Source\C++\Core\Ap4OddaAtom.cpp" />
Expand Down Expand Up @@ -290,6 +291,7 @@
<ClInclude Include="..\..\..\..\Source\C++\Core\Ap4Mpeg2Ts.h" />
<ClInclude Include="..\..\..\..\Source\C++\Core\Ap4MvhdAtom.h" />
<ClInclude Include="..\..\..\..\Source\C++\Core\Ap4NmhdAtom.h" />
<ClInclude Include="..\..\..\..\Source\C++\Core\Ap4SthdAtom.h" />
<ClInclude Include="..\..\..\..\Source\C++\Core\Ap4ObjectDescriptor.h" />
<ClInclude Include="..\..\..\..\Source\C++\Core\Ap4OdafAtom.h" />
<ClInclude Include="..\..\..\..\Source\C++\Core\Ap4OddaAtom.h" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@
<ClCompile Include="..\..\..\..\Source\C++\Core\Ap4NmhdAtom.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\C++\Core\Ap4SthdAtom.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\C++\Core\Ap4ObjectDescriptor.cpp">
<Filter>Source Files</Filter>
</ClCompile>
Expand Down Expand Up @@ -581,6 +584,9 @@
<ClInclude Include="..\..\..\..\Source\C++\Core\Ap4NmhdAtom.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\C++\Core\Ap4SthdAtom.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\C++\Core\Ap4ObjectDescriptor.h">
<Filter>Header Files</Filter>
</ClInclude>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@
<ClCompile Include="..\..\..\..\Source\C++\Core\Ap4Mpeg2Ts.cpp" />
<ClCompile Include="..\..\..\..\Source\C++\Core\Ap4MvhdAtom.cpp" />
<ClCompile Include="..\..\..\..\Source\C++\Core\Ap4NmhdAtom.cpp" />
<ClCompile Include="..\..\..\..\Source\C++\Core\Ap4SthdAtom.cpp" />
<ClCompile Include="..\..\..\..\Source\C++\Core\Ap4ObjectDescriptor.cpp" />
<ClCompile Include="..\..\..\..\Source\C++\Core\Ap4OdafAtom.cpp" />
<ClCompile Include="..\..\..\..\Source\C++\Core\Ap4OddaAtom.cpp" />
Expand Down Expand Up @@ -293,6 +294,7 @@
<ClInclude Include="..\..\..\..\Source\C++\Core\Ap4Mpeg2Ts.h" />
<ClInclude Include="..\..\..\..\Source\C++\Core\Ap4MvhdAtom.h" />
<ClInclude Include="..\..\..\..\Source\C++\Core\Ap4NmhdAtom.h" />
<ClInclude Include="..\..\..\..\Source\C++\Core\Ap4SthdAtom.h" />
<ClInclude Include="..\..\..\..\Source\C++\Core\Ap4ObjectDescriptor.h" />
<ClInclude Include="..\..\..\..\Source\C++\Core\Ap4OdafAtom.h" />
<ClInclude Include="..\..\..\..\Source\C++\Core\Ap4OddaAtom.h" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@
<ClCompile Include="..\..\..\..\Source\C++\Core\Ap4NmhdAtom.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\C++\Core\Ap4SthdAtom.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\C++\Core\Ap4ObjectDescriptor.cpp">
<Filter>Source Files</Filter>
</ClCompile>
Expand Down Expand Up @@ -581,6 +584,9 @@
<ClInclude Include="..\..\..\..\Source\C++\Core\Ap4NmhdAtom.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\C++\Core\Ap4SthdAtom.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\C++\Core\Ap4ObjectDescriptor.h">
<Filter>Header Files</Filter>
</ClInclude>
Expand Down
3 changes: 3 additions & 0 deletions Build/Tools/SCons/gcc-generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,8 @@ def generate(env, gcc_cross_prefix=None, gcc_strict=True, gcc_stop_on_warning=Tr
env['CC'] = gcc_cross_prefix+'-gcc'
env['CXX'] = gcc_cross_prefix+'-g++'
env['LINK'] = gcc_cross_prefix+'-g++'
else:
env['CC'] = os.getenv('CC') or env['CC']
env['CXX'] = os.getenv('CXX') or env['CXX']

env.Append(CCFLAGS = gcc_extra_options)
13 changes: 7 additions & 6 deletions Source/C++/Apps/Mp4Compact/Mp4Compact.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@ AP4_CompactingProcessor::TrackHandler::ProcessTrack()
// find the stsz atom
AP4_ContainerAtom* stbl = AP4_DYNAMIC_CAST(AP4_ContainerAtom, m_TrakAtom->FindChild("mdia/minf/stbl"));
if (stbl == NULL) return AP4_SUCCESS;
m_StszAtom = AP4_DYNAMIC_CAST(AP4_StszAtom, stbl->GetChild(AP4_ATOM_TYPE_STSZ));
if (m_StszAtom == NULL) return AP4_SUCCESS;
AP4_StszAtom* stsz = AP4_DYNAMIC_CAST(AP4_StszAtom, stbl->GetChild(AP4_ATOM_TYPE_STSZ));
if (stsz == NULL) return AP4_SUCCESS;

// check if we can reduce the size of stsz by changing it to stz2
AP4_UI32 max_size = 0;
for (unsigned int i=1; i<=m_StszAtom->GetSampleCount(); i++) {
for (unsigned int i=1; i<=stsz->GetSampleCount(); i++) {
AP4_Size sample_size;
m_StszAtom->GetSampleSize(i, sample_size);
stsz->GetSampleSize(i, sample_size);
if (sample_size > max_size) {
max_size = sample_size;
}
Expand All @@ -148,14 +148,15 @@ AP4_CompactingProcessor::TrackHandler::ProcessTrack()
return AP4_SUCCESS;
} else {
if (m_Outer.m_Verbose) {
unsigned int reduction = (4-field_size)*m_StszAtom->GetSampleCount();
unsigned int reduction = (4-field_size)*stsz->GetSampleCount();
printf("stz2 reduction = %d bytes\n", reduction);
m_Outer.m_SizeReduction += reduction;
}
}

// detach the original stsz atom so we can destroy it later
m_StszAtom->Detach();
m_StszAtom = stsz;
stsz->Detach();

// create an stz2 atom and populate its entries
AP4_Stz2Atom* stz2 = new AP4_Stz2Atom(field_size);
Expand Down
Loading

0 comments on commit df04891

Please sign in to comment.