有什么方法可以使用 QuickTime (C) API来获取 QuickTime Movie Track 的Edit Atom(即“edts”)的一般内容和它的Edit List Atom(即“elst” )的内容?
目标是识别给定轨道中的任何编辑及其持续时间和开始时间。
在过去的两个小时里,我一直在检查 QuickTime 参考库(旧版和当前版),但无法识别任何 API 来实现这一点。
任何提示将不胜感激。
干杯,
\比约恩
有什么方法可以使用 QuickTime (C) API来获取 QuickTime Movie Track 的Edit Atom(即“edts”)的一般内容和它的Edit List Atom(即“elst” )的内容?
目标是识别给定轨道中的任何编辑及其持续时间和开始时间。
在过去的两个小时里,我一直在检查 QuickTime 参考库(旧版和当前版),但无法识别任何 API 来实现这一点。
任何提示将不胜感激。
干杯,
\比约恩
回答我自己的问题:
轨道编辑列表的内容(如果有),即轨道中存在的编辑/片段可以通过GetTrackNextInterestingTime()
API 函数(从 Movies.h 中提取的代码)确定:
/*
* GetTrackNextInterestingTime()
*
* Availability:
* Non-Carbon CFM: in QuickTimeLib 2.5 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
* Windows: in qtmlClient.lib 3.0 and later
*/
EXTERN_API( void )
GetTrackNextInterestingTime(
Track theTrack,
short interestingTimeFlags,
TimeValue time,
Fixed rate,
TimeValue * interestingTime,
TimeValue * interestingDuration);
通过在. nextTimeTrackEdit
_nextTimeEdgeOK
interestingTimeFlags
对于您可能对轨道中存在的编辑感兴趣的大多数情况,您必须将返回interestingTime
的轨道时间映射到媒体时间(如果您一直在检查轨道的编辑以确定可能的轨道偏移量)。
这是通过TrackTimeToMediaTime()
API 函数完成的:
/*
* TrackTimeToMediaTime()
*
* Availability:
* Non-Carbon CFM: in QuickTimeLib 2.5 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
* Windows: in qtmlClient.lib 3.0 and later
*/
EXTERN_API( TimeValue )
TrackTimeToMediaTime(
TimeValue value,
Track theTrack);
编辑
将轨道时间转换为媒体时间的最先进方法是TrackTimeToMediaDisplayTime()
:
/*
* TrackTimeToMediaDisplayTime()
*
* Summary:
* Converts a track's time value to a display time value that is
* appropriate to the track's media, using the track's edit list.
* This is a 64-bit replacement for TrackTimeToMediaTime.
*
* Discussion:
* This function maps the track time through the track's edit list
* to come up with the media time. This time value contains the
* track's time value according to the media's time coordinate
* system. If the time you specified lies outside of the movie's
* active segment or corresponds to empty space in the track, this
* function returns a value of -1. Hence you can use it to determine
* whether a specified track edit is empty.
*
* Parameters:
*
* value:
* The track's time value; must be expressed in the time scale of
* the movie that contains the track.
*
* theTrack:
* The track for this operation. Your application obtains this
* track identifier from such functions as NewMovieTrack and
* GetMovieTrack.
*
* Result:
* The corresponding time in media display time, in the media's time
* coordinate system. If the track time corresponds to empty space,
* this function returns a value of -1.
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: not available
* Mac OS X: in version 10.4 (or QuickTime 7.0) and later
* Windows: in qtmlClient.lib version 10.4 (or QuickTime 7.0) and later
*/
EXTERN_API( TimeValue64 )
TrackTimeToMediaDisplayTime(
TimeValue64 value,
Track theTrack);