diff options
author | Aleksoid <aleksoid@users.sourceforge.net> | 2011-05-05 14:49:58 +0400 |
---|---|---|
committer | Aleksoid <aleksoid@users.sourceforge.net> | 2011-05-05 14:49:58 +0400 |
commit | 7dc0a565fbb7d98d5883115205f742b7509bacf3 (patch) | |
tree | 770aa12e4ed0144bd3c35df5178c767b89d75ed8 /src/filters/parser/MP4Splitter/AP4 | |
parent | bdff8b3d82da78bdaea6b18e8e2eb8cb254b54d6 (diff) |
Fix : MP4Splitter read correct Aspect Ratio from video field header, ticket #285;
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@3084 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters/parser/MP4Splitter/AP4')
4 files changed, 74 insertions, 0 deletions
diff --git a/src/filters/parser/MP4Splitter/AP4/Core/Ap4Atom.h b/src/filters/parser/MP4Splitter/AP4/Core/Ap4Atom.h index 69339653d..cd3941852 100644 --- a/src/filters/parser/MP4Splitter/AP4/Core/Ap4Atom.h +++ b/src/filters/parser/MP4Splitter/AP4/Core/Ap4Atom.h @@ -305,6 +305,8 @@ const AP4_Atom::Type AP4_ATOM_TYPE_3IV2 = AP4_ATOM_TYPE('3','I','V','2'); const AP4_Atom::Type AP4_ATOM_TYPE_IV32 = AP4_ATOM_TYPE('I','V','3','2');
const AP4_Atom::Type AP4_ATOM_TYPE_VP31 = AP4_ATOM_TYPE('V','P','3','1');
const AP4_Atom::Type AP4_ATOM_TYPE_YV12 = AP4_ATOM_TYPE('y','v','1','2');
+
+const AP4_Atom::Type AP4_ATOM_TYPE_PASP = AP4_ATOM_TYPE('p','a','s','p');
/*----------------------------------------------------------------------
| AP4_AtomListInspector
+---------------------------------------------------------------------*/
diff --git a/src/filters/parser/MP4Splitter/AP4/Core/Ap4AtomFactory.cpp b/src/filters/parser/MP4Splitter/AP4/Core/Ap4AtomFactory.cpp index e90e66294..304ad443b 100644 --- a/src/filters/parser/MP4Splitter/AP4/Core/Ap4AtomFactory.cpp +++ b/src/filters/parser/MP4Splitter/AP4/Core/Ap4AtomFactory.cpp @@ -70,6 +70,7 @@ #include "Ap4DcomAtom.h"
#include "Ap4CmvdAtom.h"
#include "Ap4EndaAtom.h"
+#include "Ap4PaspAtom.h"
/*----------------------------------------------------------------------
| class variables
+---------------------------------------------------------------------*/
@@ -461,6 +462,10 @@ AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream& stream, atom = DNew AP4_EndaAtom(size, stream);
break;
+ case AP4_ATOM_TYPE_PASP:
+ atom = DNew AP4_PaspAtom(size, stream);
+ break;
+
default:
if(parent && parent->GetType() == AP4_ATOM_TYPE_STSD && (type & 0xffff0000) == AP4_ATOM_TYPE('m', 's', 0, 0))
diff --git a/src/filters/parser/MP4Splitter/AP4/Core/Ap4PaspAtom.cpp b/src/filters/parser/MP4Splitter/AP4/Core/Ap4PaspAtom.cpp new file mode 100644 index 000000000..ba140a524 --- /dev/null +++ b/src/filters/parser/MP4Splitter/AP4/Core/Ap4PaspAtom.cpp @@ -0,0 +1,26 @@ +/*****************************************************************
+|
+| AP4 - pasp Atom
+|
+| Copyright 2011 Aleksoid1978
+|
+ ****************************************************************/
+
+/*----------------------------------------------------------------------
+| includes
++---------------------------------------------------------------------*/
+
+#include "Ap4PaspAtom.h"
+
+/*----------------------------------------------------------------------
+| AP4_PaspAtom::AP4_PaspAtom
++---------------------------------------------------------------------*/
+
+AP4_PaspAtom::AP4_PaspAtom(AP4_Size size,
+ AP4_ByteStream& stream)
+ : AP4_Atom(AP4_ATOM_TYPE_PASP)
+{
+ size -= AP4_ATOM_HEADER_SIZE;
+ stream.ReadUI32(m_num);
+ stream.ReadUI32(m_den);
+}
diff --git a/src/filters/parser/MP4Splitter/AP4/Core/Ap4PaspAtom.h b/src/filters/parser/MP4Splitter/AP4/Core/Ap4PaspAtom.h new file mode 100644 index 000000000..8947ac79b --- /dev/null +++ b/src/filters/parser/MP4Splitter/AP4/Core/Ap4PaspAtom.h @@ -0,0 +1,41 @@ +/*****************************************************************
+|
+| AP4 - pasp Atom
+|
+| Copyright 2011 Aleksoid1978
+|
+ ****************************************************************/
+
+#ifndef _AP4_PASP_ATOM_H_
+#define _AP4_PASP_ATOM_H_
+
+/*----------------------------------------------------------------------
+| includes
++---------------------------------------------------------------------*/
+#include "Ap4Atom.h"
+#include "Ap4Types.h"
+#include "Ap4Array.h"
+#include "Ap4DataBuffer.h"
+
+/*----------------------------------------------------------------------
+| AP4_PaspAtom
++---------------------------------------------------------------------*/
+
+class AP4_PaspAtom : public AP4_Atom
+{
+public:
+ AP4_PaspAtom(AP4_Size size,
+ AP4_ByteStream& stream);
+
+ AP4_Result WriteFields(AP4_ByteStream& stream) { return AP4_FAILURE; }
+
+ AP4_UI32 GetNum() const { return m_num; }
+ AP4_UI32 GetDen() const { return m_den; }
+
+private:
+ AP4_UI32 m_num;
+ AP4_UI32 m_den;
+
+};
+
+#endif // _AP4_PASP_ATOM_H_
|