summaryrefslogtreecommitdiffstats
path: root/libmediafork/ipodutil.cpp
diff options
context:
space:
mode:
authorprigaux <[email protected]>2007-02-11 20:00:15 +0000
committerprigaux <[email protected]>2007-02-11 20:00:15 +0000
commita74fd5a1ec37e53fe7008f022639af6ede0e82c9 (patch)
tree0a6a32640a840b72653149aa11efa264674df976 /libmediafork/ipodutil.cpp
parentf45dfeb2afb1b0bf46054959e8ea9494f3b7d14f (diff)
Merge the 0.8.0_mpeg4ip branch into the trunk
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@285 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libmediafork/ipodutil.cpp')
-rw-r--r--libmediafork/ipodutil.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/libmediafork/ipodutil.cpp b/libmediafork/ipodutil.cpp
new file mode 100644
index 000000000..ba37e4768
--- /dev/null
+++ b/libmediafork/ipodutil.cpp
@@ -0,0 +1,34 @@
+/*
+ * MP4 library API functions
+ *
+ * These are wrapper functions that provide C linkage conventions
+ * to the library, and catch any internal errors, ensuring that
+ * a proper return value is given.
+ */
+
+#include "mp4common.h"
+
+static u_int8_t ipod_magic[] = {
+ 0x6b, 0x68, 0x40, 0xf2, 0x5f, 0x24, 0x4f, 0xc5,
+ 0xba, 0x39, 0xa5, 0x1b, 0xcf, 0x03, 0x23, 0xf3
+};
+
+class IPodUUIDAtom : public MP4Atom {
+public:
+ IPodUUIDAtom() : MP4Atom("uuid")
+ {
+ SetExtendedType(ipod_magic);
+
+ MP4Integer32Property* value = new MP4Integer32Property("value");
+ value->SetValue(1);
+ AddProperty(value);
+ }
+};
+
+extern "C" void AddIPodUUID(MP4FileHandle hFile, MP4TrackId trackId)
+{
+ MP4Track* track = ((MP4File*)hFile)->GetTrack(trackId);
+ MP4Atom* avc1 = track->GetTrakAtom()->FindChildAtom("mdia.minf.stbl.stsd.avc1");
+ avc1->AddChildAtom(new IPodUUIDAtom());
+}
+