Skip to content

Commit 622fe44

Browse files
authored
Merge pull request #28 from chemag/main
AVC support
2 parents c34ade3 + 6173649 commit 622fe44

File tree

7 files changed

+940
-0
lines changed

7 files changed

+940
-0
lines changed

ISOBMFF/include/ISOBMFF.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
#include <ISOBMFF/INFE.hpp>
6262
#include <ISOBMFF/IROT.hpp>
6363
#include <ISOBMFF/HVCC.hpp>
64+
#include <ISOBMFF/AVCC.hpp>
6465
#include <ISOBMFF/SingleItemTypeReferenceBox.hpp>
6566
#include <ISOBMFF/DIMG.hpp>
6667
#include <ISOBMFF/THMB.hpp>
@@ -77,6 +78,7 @@
7778
#include <ISOBMFF/FRMA.hpp>
7879
#include <ISOBMFF/SCHM.hpp>
7980
#include <ISOBMFF/HVC1.hpp>
81+
#include <ISOBMFF/AVC1.hpp>
8082

8183
#ifdef _WIN32
8284
#include <ISOBMFF/WIN32.hpp>

ISOBMFF/include/ISOBMFF/AVC1.hpp

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
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 AVC1.hpp
27+
* @copyright (c) 2017, DigiDNA - www.digidna.net
28+
* @author Jean-David Gadina - www.digidna.net
29+
*/
30+
31+
#ifndef ISOBMFF_AVC1_HPP
32+
#define ISOBMFF_AVC1_HPP
33+
34+
#include <memory>
35+
#include <algorithm>
36+
#include <ISOBMFF/Macros.hpp>
37+
#include <ISOBMFF/FullBox.hpp>
38+
#include <ISOBMFF/Container.hpp>
39+
#include <cstdint>
40+
41+
namespace ISOBMFF
42+
{
43+
class ISOBMFF_EXPORT AVC1: public FullBox, public Container
44+
{
45+
public:
46+
47+
AVC1();
48+
AVC1( const AVC1 & o );
49+
AVC1( AVC1 && o ) noexcept;
50+
virtual ~AVC1() override;
51+
52+
AVC1 & operator =( AVC1 o );
53+
54+
void ReadData( Parser & parser, BinaryStream & stream ) override;
55+
void WriteDescription( std::ostream & os, std::size_t indentLevel ) const override;
56+
57+
std::vector< std::pair< std::string, std::string > > GetDisplayableProperties() const override;
58+
59+
uint16_t GetDataReferenceIndex() const;
60+
uint16_t GetWidth() const;
61+
uint16_t GetHeight() const;
62+
uint32_t GetHorizResolution() const;
63+
uint32_t GetVertResolution() const;
64+
uint16_t GetFrameCount() const;
65+
std::string GetCompressorName() const;
66+
uint16_t GetDepth() const;
67+
68+
void SetDataReferenceIndex( uint16_t value );
69+
void SetWidth( uint16_t value );
70+
void SetHeight( uint16_t value );
71+
void SetHorizResolution( uint32_t value );
72+
void SetVertResolution( uint32_t value );
73+
void SetFrameCount( uint16_t value );
74+
void SetCompressorName( std::string value );
75+
void SetDepth( uint16_t value );
76+
77+
void AddBox( std::shared_ptr< Box > box ) override;
78+
std::vector< std::shared_ptr< Box > > GetBoxes() const override;
79+
80+
ISOBMFF_EXPORT friend void swap( AVC1 & o1, AVC1 & o2 );
81+
82+
private:
83+
84+
class IMPL;
85+
86+
std::unique_ptr< IMPL > impl;
87+
};
88+
}
89+
90+
#endif /* ISOBMFF_AVC1_HPP */

ISOBMFF/include/ISOBMFF/AVCC.hpp

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
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 AVCC.hpp
27+
* @copyright (c) 2017, DigiDNA - www.digidna.net
28+
* @author Jean-David Gadina - www.digidna.net
29+
*/
30+
31+
#ifndef ISOBMFF_AVCC_HPP
32+
#define ISOBMFF_AVCC_HPP
33+
34+
#include <memory>
35+
#include <algorithm>
36+
#include <ISOBMFF/Macros.hpp>
37+
#include <ISOBMFF/FullBox.hpp>
38+
#include <ISOBMFF/DisplayableObject.hpp>
39+
#include <ISOBMFF/DisplayableObjectContainer.hpp>
40+
#include <vector>
41+
#include <cstdint>
42+
43+
namespace ISOBMFF
44+
{
45+
class ISOBMFF_EXPORT AVCC: public Box, public DisplayableObjectContainer
46+
{
47+
public:
48+
49+
AVCC();
50+
AVCC( const AVCC & o );
51+
AVCC( AVCC && o ) noexcept;
52+
virtual ~AVCC() override;
53+
54+
AVCC & operator =( AVCC o );
55+
56+
void ReadData( Parser & parser, BinaryStream & stream ) override;
57+
void WriteDescription( std::ostream & os, std::size_t indentLevel ) const override;
58+
59+
virtual std::vector< std::shared_ptr< DisplayableObject > > GetDisplayableObjects() const override;
60+
virtual std::vector< std::pair< std::string, std::string > > GetDisplayableProperties() const override;
61+
62+
uint8_t GetConfigurationVersion() const;
63+
uint8_t GetAVCProfileIndication() const;
64+
uint8_t GetProfileCompatibility() const;
65+
uint8_t GetAVCLevelIndication() const;
66+
uint8_t GetLengthSizeMinusOne() const;
67+
uint8_t GetNumOfSequenceParameterSets() const;
68+
uint8_t GetNumOfPictureParameterSets() const;
69+
70+
void SetConfigurationVersion( uint8_t value );
71+
void SetAVCProfileIndication( uint8_t value );
72+
void SetProfileCompatibility( uint8_t value );
73+
void SetAVCLevelIndication( uint8_t value );
74+
void SetLengthSizeMinusOne( uint8_t value );
75+
void SetNumOfSequenceParameterSets( uint8_t value );
76+
void SetNumOfPictureParameterSets( uint8_t value );
77+
78+
79+
class ISOBMFF_EXPORT NALUnit: public DisplayableObject
80+
{
81+
public:
82+
83+
NALUnit();
84+
NALUnit( BinaryStream & stream );
85+
NALUnit( const NALUnit & o );
86+
NALUnit( NALUnit && o ) noexcept;
87+
virtual ~NALUnit() override;
88+
89+
NALUnit & operator =( NALUnit o );
90+
91+
std::string GetName() const override;
92+
93+
std::vector< uint8_t > GetData() const;
94+
void SetData( const std::vector< uint8_t > & value );
95+
96+
virtual std::vector< std::pair< std::string, std::string > > GetDisplayableProperties() const override;
97+
98+
ISOBMFF_EXPORT friend void swap( NALUnit & o1, NALUnit & o2 );
99+
100+
private:
101+
102+
class IMPL;
103+
104+
std::unique_ptr< IMPL > impl;
105+
};
106+
107+
108+
std::vector< std::shared_ptr< NALUnit > > GetSequenceParameterSetNALUnits() const;
109+
void AddSequenceParameterSetNALUnit( std::shared_ptr< NALUnit > nal_unit );
110+
111+
std::vector< std::shared_ptr< NALUnit > > GetPictureParameterSetNALUnits() const;
112+
void AddPictureParameterSetNALUnit( std::shared_ptr< NALUnit > nal_unit );
113+
114+
115+
ISOBMFF_EXPORT friend void swap( AVCC & o1, AVCC & o2 );
116+
117+
private:
118+
119+
class IMPL;
120+
121+
std::unique_ptr< IMPL > impl;
122+
};
123+
}
124+
125+
#endif /* ISOBMFF_AVCC_HPP */

0 commit comments

Comments
 (0)