Skip to content

Commit 5dc25e3

Browse files
authored
Merge pull request #25 from chemag/main
isobmff: add C dependency
2 parents 061d894 + 8df12c3 commit 5dc25e3

File tree

7 files changed

+590
-0
lines changed

7 files changed

+590
-0
lines changed

ISOBMFF/include/ISOBMFF.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
#include <ISOBMFF/TKHD.hpp>
5151
#include <ISOBMFF/META.hpp>
5252
#include <ISOBMFF/HDLR.hpp>
53+
#include <ISOBMFF/MDHD.hpp>
5354
#include <ISOBMFF/PITM.hpp>
5455
#include <ISOBMFF/IINF.hpp>
5556
#include <ISOBMFF/DREF.hpp>
@@ -71,6 +72,7 @@
7172
#include <ISOBMFF/IPCO.hpp>
7273
#include <ISOBMFF/ImageGrid.hpp>
7374
#include <ISOBMFF/STSD.hpp>
75+
#include <ISOBMFF/STTS.hpp>
7476
#include <ISOBMFF/FRMA.hpp>
7577
#include <ISOBMFF/SCHM.hpp>
7678

ISOBMFF/include/ISOBMFF/MDHD.hpp

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
/*******************************************************************************
2+
* The MIT License (MIT)
3+
*
4+
* Copyright (c) 2017 DigiDNA - www.digidna.net
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
******************************************************************************/
24+
25+
/*!
26+
* @header MDHD.hpp
27+
* @copyright (c) 2017, DigiDNA - www.digidna.net
28+
* @author Jean-David Gadina - www.digidna.net
29+
*/
30+
31+
#ifndef ISOBMFF_MDHD_HPP
32+
#define ISOBMFF_MDHD_HPP
33+
34+
#include <memory>
35+
#include <algorithm>
36+
#include <ISOBMFF/Macros.hpp>
37+
#include <ISOBMFF/FullBox.hpp>
38+
#include <ISOBMFF/DisplayableObjectContainer.hpp>
39+
#include <cstdint>
40+
#include <vector>
41+
42+
namespace ISOBMFF
43+
{
44+
class ISOBMFF_EXPORT MDHD: public FullBox, public DisplayableObjectContainer
45+
{
46+
public:
47+
48+
MDHD();
49+
MDHD( const MDHD & o );
50+
MDHD( MDHD && o ) noexcept;
51+
virtual ~MDHD() override;
52+
53+
MDHD & operator =( MDHD o );
54+
55+
void ReadData( Parser & parser, BinaryStream & stream ) override;
56+
void WriteDescription( std::ostream & os, std::size_t indentLevel ) const override;
57+
58+
virtual std::vector< std::shared_ptr< DisplayableObject > > GetDisplayableObjects() const override;
59+
virtual std::vector< std::pair< std::string, std::string > > GetDisplayableProperties() const override;
60+
61+
uint64_t GetCreationTime() const;
62+
uint64_t GetModificationTime() const;
63+
uint32_t GetTimescale() const;
64+
uint64_t GetDuration() const;
65+
uint8_t GetPad() const;
66+
uint8_t GetLanguage0() const;
67+
uint8_t GetLanguage1() const;
68+
uint8_t GetLanguage2() const;
69+
uint16_t GetPredefined() const;
70+
71+
void SetCreationTime( uint64_t value );
72+
void SetModificationTime( uint64_t value );
73+
void SetTimescale( uint32_t value );
74+
void SetDuration( uint64_t value );
75+
void SetPad( uint8_t value );
76+
void SetLanguage0( uint8_t value );
77+
void SetLanguage1( uint8_t value );
78+
void SetLanguage2( uint8_t value );
79+
void SetPredefined( uint16_t value );
80+
81+
ISOBMFF_EXPORT friend void swap( MDHD & o1, MDHD & o2 );
82+
83+
private:
84+
85+
class IMPL;
86+
87+
std::unique_ptr< IMPL > impl;
88+
};
89+
}
90+
91+
#endif /* ISOBMFF_MDHD_HPP */

ISOBMFF/include/ISOBMFF/STTS.hpp

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
/*******************************************************************************
2+
* The MIT License (MIT)
3+
*
4+
* Copyright (c) 2017 DigiDNA - www.digidna.net
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
******************************************************************************/
24+
25+
/*!
26+
* @header STTS.hpp
27+
* @copyright (c) 2017, DigiDNA - www.digidna.net
28+
* @author Jean-David Gadina - www.digidna.net
29+
*/
30+
31+
#ifndef ISOBMFF_STTS_HPP
32+
#define ISOBMFF_STTS_HPP
33+
34+
#include <memory>
35+
#include <algorithm>
36+
#include <ISOBMFF/Macros.hpp>
37+
#include <ISOBMFF/FullBox.hpp>
38+
#include <string>
39+
40+
namespace ISOBMFF
41+
{
42+
class ISOBMFF_EXPORT STTS: public FullBox
43+
{
44+
public:
45+
46+
STTS();
47+
STTS( const STTS & o );
48+
STTS( STTS && o ) noexcept;
49+
virtual ~STTS() override;
50+
51+
STTS & operator =( STTS o );
52+
53+
void ReadData( Parser & parser, BinaryStream & stream ) override;
54+
std::vector< std::pair< std::string, std::string > > GetDisplayableProperties() const override;
55+
56+
uint32_t GetEntryCount() const;
57+
uint32_t GetSampleCount(unsigned int index) const;
58+
uint32_t GetSampleOffset(unsigned int index) const;
59+
60+
ISOBMFF_EXPORT friend void swap( STTS & o1, STTS & o2 );
61+
62+
private:
63+
64+
class IMPL;
65+
66+
std::unique_ptr< IMPL > impl;
67+
};
68+
}
69+
70+
#endif /* ISOBMFF_STTS_HPP */

ISOBMFF/source/BinaryDataStream.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
* @author Jean-David Gadina - www.digidna.net
2929
*/
3030

31+
#include <string.h>
32+
3133
#include <fstream>
3234
#include <cmath>
3335
#include <vector>

0 commit comments

Comments
 (0)