OSDN Git Service

fix: cannot preview with QT
[handbrake-jp/handbrake-jp.git] / libhb / ipodutil.cpp
1 /*
2  * MP4 library API functions
3  *
4  * These are wrapper functions that provide C linkage conventions
5  * to the library, and catch any internal errors, ensuring that
6  * a proper return value is given.
7  */
8
9 #include "mp4common.h"
10
11 static u_int8_t ipod_magic[] = {
12  0x6b, 0x68, 0x40, 0xf2, 0x5f, 0x24, 0x4f, 0xc5,
13  0xba, 0x39, 0xa5, 0x1b, 0xcf, 0x03, 0x23, 0xf3
14 };
15
16 class IPodUUIDAtom : public MP4Atom {
17 public:
18  IPodUUIDAtom() : MP4Atom("uuid")
19  {
20  SetExtendedType(ipod_magic);
21
22  MP4Integer32Property* value = new MP4Integer32Property("value");
23  value->SetValue(1);
24  AddProperty(value);
25  }
26 };
27
28 extern "C" void AddIPodUUID(MP4FileHandle hFile, MP4TrackId trackId)
29 {
30  MP4Track* track = ((MP4File*)hFile)->GetTrack(trackId);
31  MP4Atom* avc1 = track->GetTrakAtom()->FindChildAtom("mdia.minf.stbl.stsd.avc1");
32  avc1->AddChildAtom(new IPodUUIDAtom());
33 }
34