2 * (C) 2006-2012 see Authors.txt
4 * This file is part of MPC-HC.
6 * MPC-HC is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
11 * MPC-HC is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
34 NALU_TYPE_EOSTREAM
= 11,
41 int forbidden_bit
; //! should be always FALSE
42 int nal_reference_idc
; //! NALU_PRIORITY_xxxx
43 NALU_TYPE nal_unit_type
; //! NALU_TYPE_xxxx
45 int m_nNALStartPos
; //! NALU start (including startcode / size)
46 int m_nNALDataPos
; //! Useful part
54 bool MoveToNextAnnexBStartcode();
55 bool MoveToNextRTPStartcode();
62 SetBuffer(NULL
, 0, 0);
65 NALU_TYPE
GetType() const { return nal_unit_type
; };
66 bool IsRefFrame() const { return (nal_reference_idc
!= 0); };
68 int GetDataLength() const { return m_nCurPos
- m_nNALDataPos
; };
69 BYTE
* GetDataBuffer() { return m_pBuffer
+ m_nNALDataPos
; };
70 int GetRoundedDataLength() const {
71 int nSize
= m_nCurPos
- m_nNALDataPos
;
72 return nSize
+ 128 - (nSize
% 128);
75 int GetLength() const { return m_nCurPos
- m_nNALStartPos
; };
76 BYTE
* GetNALBuffer() { return m_pBuffer
+ m_nNALStartPos
; };
77 bool IsEOF() const { return m_nCurPos
>= m_nSize
; };
79 void SetBuffer(BYTE
* pBuffer
, int nSize
, int nNALSize
);