From 7a2628b49a80defe48637417158416acc60bf207 Mon Sep 17 00:00:00 2001 From: prigaux Date: Thu, 8 Feb 2007 22:47:55 +0000 Subject: [PATCH] Add mpeg4ip wrapper file git-svn-id: svn://svn.handbrake.fr/HandBrake/branches/MediaFork_0.8.0_mpeg4ip@274 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- libmediafork/ipodutil.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 libmediafork/ipodutil.cpp diff --git a/libmediafork/ipodutil.cpp b/libmediafork/ipodutil.cpp new file mode 100644 index 000000000..99fd2c9b3 --- /dev/null +++ b/libmediafork/ipodutil.cpp @@ -0,0 +1,33 @@ +/* + * 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()); +} \ No newline at end of file -- 2.40.0