1MP4(3) MP4 File Format Library MP4(3)
2
3
4
6 MP4GetSampleIdFromTime - Get the sample id of a specified time
7
9 #include <mp4.h>
10
11 MP4SampleId MP4GetSampleIdFromTime(
12 MP4FileHandle hFile,
13 MP4TrackId trackId,
14 MP4Timestamp when,
15 bool wantSyncSample = false
16 );
17
19 hFile Specifies the mp4 file to which the operation applies.
20
21 trackId
22 Specifies the track to which the operation applies.
23
24 when Specifies the time in the track time scale that is desired.
25
26 wantSyncSample
27 Specifies if the returned sample id must correspond to a sample
28 whose sync/random access flag is true.
29
30
32 Upon success, the sample id that occurs at the specified time. Upon an
33 error, MP4_INVALID_SAMPLE_ID.
34
36 MP4GetSampleIdFromTime returns the sample id of the track sample in
37 which the specified time occurs.
38
39 The specified time should be in the track time scale. See MP4ConvertTo‐
40 TrackTimestamp() for how to map a time value to this time scale.
41
42 It is wise to use MP4GetSampleTime() with the returned sample id so one
43 can adjust for any difference between the specified time and the actual
44 start time of the sample.
45
46 If the calling application needs a sample that can be accessed randomly
47 then the 'wantSyncSample' argument should be set to true. This could be
48 the case for a player that is implementing a positioning function and
49 needs to be able to start decoding a track from the returned sample id.
50
51
53 MP4(3) MP4GetSampleIdFromEditTime(3)
54
55
56
57Cisco Systems Inc. Version 0.9 MP4(3)