|
| 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