bool findInt32(uint32_t key, int32_t *value)函数 =>个人理解!
2013-05-11 11:59
495 查看
最近应用工作原因在看Android多媒体框架的源码!看到了AwesomePlayer.cpp源码!发现有很多 bool findInt32(uint32_t key, int32_t *value);类似的代码!看不懂什么意思!现在豁然开朗!也是个人理解!假设!猜测!做个笔记!
1)有以上得出个人理解:kKeyDisplayWidth、kKeyDisplayHeight是个"键",它对应的有个值!findInt32就是找到对应的值赋值给displayWidth, displayHeight;
2)在源码搜索kKeyDisplayWidth、kKeyDisplayHeight果然搜到键值对应enum在MetaData.h源码里:
具体这些键值什么意思有待进一步分析!
AwesomePlayer.cpp里面有如下函数: int32_t displayWidth, displayHeight; bool success = meta->findInt32(kKeyDisplayWidth, &displayWidth/*输出参数*/); if (success) { success = meta->findInt32(kKeyDisplayHeight, &displayHeight/*输出参数*/); } if (success) { mDisplayWidth = displayWidth; mDisplayHeight = displayHeight; }
1)有以上得出个人理解:kKeyDisplayWidth、kKeyDisplayHeight是个"键",它对应的有个值!findInt32就是找到对应的值赋值给displayWidth, displayHeight;
2)在源码搜索kKeyDisplayWidth、kKeyDisplayHeight果然搜到键值对应enum在MetaData.h源码里:
// The following keys map to int32_t data unless indicated otherwise. enum { kKeyMIMEType = 'mime', // cstring kKeyWidth = 'widt', // int32_t, image pixel kKeyHeight = 'heig', // int32_t, image pixel kKeyDisplayWidth = 'dWid', // int32_t, display/presentation kKeyDisplayHeight = 'dHgt', // int32_t, display/presentation // a rectangle, if absent assumed to be (0, 0, width - 1, height - 1) kKeyCropRect = 'crop', kKeyRotation = 'rotA', // int32_t (angle in degrees) kKeyIFramesInterval = 'ifiv', // int32_t kKeyStride = 'strd', // int32_t kKeySliceHeight = 'slht', // int32_t kKeyChannelCount = '#chn', // int32_t kKeySampleRate = 'srte', // int32_t (audio sampling rate Hz) kKeyFrameRate = 'frmR', // int32_t (video frame rate fps) kKeyBitRate = 'brte', // int32_t (bps) kKeyESDS = 'esds', // raw data kKey***CC = 'avcc', // raw data #ifdef OMAP_ENHANCEMENT kKeyHdr = 'hdrd', // raw data kKeySARIdc = 'sari', // Sample aspect ratio of the luma samples (int32_t) kKeySARWidth = 'sarw', // Sample aspect ratio width (int32_t) kKeySARHeight = 'sarh', // Sample aspect ratio height (int32_t) #endif kKeyD263 = 'd263', // raw data kKeyVorbisInfo = 'vinf', // raw data kKeyVorbisBooks = 'vboo', // raw data kKeyWantsNALFragments = 'NALf', kKeyIsSyncFrame = 'sync', // int32_t (bool) kKeyIsCodecConfig = 'conf', // int32_t (bool) kKeyTime = 'time', // int64_t (usecs) kKeyDecodingTime = 'decT', // int64_t (decoding timestamp in usecs) kKeyNTPTime = 'ntpT', // uint64_t (ntp-timestamp) kKeyTargetTime = 'tarT', // int64_t (usecs) kKeyDriftTime = 'dftT', // int64_t (usecs) kKeyAnchorTime = 'ancT', // int64_t (usecs) kKeyDuration = 'dura', // int64_t (usecs) kKeyColorFormat = 'colf', kKeyPlatformPrivate = 'priv', // pointer kKeyDecoderComponent = 'decC', // cstring kKeyBufferID = 'bfID', kKeyMaxInputSize = 'inpS', kKeyThumbnailTime = 'thbT', // int64_t (usecs) kKeyTrackID = 'trID', kKeyIsDRM = 'idrm', // int32_t (bool) kKeyAlbum = 'albu', // cstring kKeyArtist = 'arti', // cstring kKeyAlbumArtist = 'aart', // cstring kKeyComposer = 'comp', // cstring kKeyGenre = 'genr', // cstring kKeyTitle = 'titl', // cstring kKeyYear = 'year', // cstring kKeyAlbumArt = 'albA', // compressed image data kKeyAlbumArtMIME = 'alAM', // cstring kKeyAuthor = 'auth', // cstring kKeyCDTrackNumber = 'cdtr', // cstring kKeyDiscNumber = 'dnum', // cstring kKeyDate = 'date', // cstring kKeyWriter = 'writ', // cstring kKeyCompilation = 'cpil', // cstring kKeyLocation = 'loc ', // cstring kKeyTimeScale = 'tmsl', // int32_t // video profile and level kKeyVideoProfile = 'vprf', // int32_t kKeyVideoLevel = 'vlev', // int32_t // Set this key to enable authoring files in 64-bit offset kKey64BitFileOffset = 'fobt', // int32_t (bool) kKey2ByteNalLength = '2NAL', // int32_t (bool) // Identify the file output format for authoring // Please see <media/mediarecorder.h> for the supported // file output formats. kKeyFileType = 'ftyp', // int32_t // Track authoring progress status // kKeyTrackTimeStatus is used to track progress in elapsed time kKeyTrackTimeStatus = 'tktm', // int64_t kKeyNotRealTime = 'ntrt', // bool (int32_t) // Ogg files can be tagged to be automatically looping... kKeyAutoLoop = 'autL', // bool (int32_t) kKeyValidSamples = 'valD', // int32_t kKeyIsUnreadable = 'unre', // bool (int32_t) // An indication that a video buffer has been rendered. kKeyRendered = 'rend', // bool (int32_t) // The language code for this media kKeyMediaLanguage = 'lang', // cstring // To store the timed text format data kKeyTextFormatData = 'text', // raw data kKeyRequiresSecureBuffers = 'secu', // bool (int32_t) #ifdef OMAP_ENHANCEMENT_S3D kKeyS3DLayout = 's3dl', #endif #ifdef OMAP_ENHANCEMENT kKeyBufferLayout = 'lout', kKeyVideoFPS = 'vfps', // int32_t #endif }; enum { kTypeESDS = 'esds', kType***CC = 'avcc', #ifdef OMAP_ENHANCEMENT kTypeHdr = 'hdrd', #endif kTypeD263 = 'd263', };
具体这些键值什么意思有待进一步分析!
相关文章推荐
- 关于参考帧中的x264_reference_update函数的补充及h->frames.unused[]的理解
- 关于参考帧中的x264_reference_update函数的补充及h->frames.unused[]的理解
- 个人对泛型Class<T>的理解
- <深入理解计算机系统> 通过程序的机器级表示来理解函数栈
- 嵌入式裸机开发学习:MMU代码中的virtuladdr >> 20 的个人理解
- 深层次理解JNI中的GetArray<PrimitiveType>Elements()函数
- C++中重载数组下标访问操作符[ ] 和 赋值操作符 = ,* 和 -> 操作符和取反 !以及转化操作符bool和void*
- Java 中的 int 与 Integer 用于 List<Integer> 时,以及通过打印变量检测程序运行和函数调用次数计数
- JS中三种主要方法(函数定义)类别理解 —(JS面向对象&原型)
- c<string.h>函数
- HDU 1599 find the mincost route (Floyd求最小环) >>
- jsp <input type="file"> 清空value值的一种方式
- #include<algorithm>里的函数
- shell之输出重定向(理解2>&1)
- MsAjax Lib-> Date.localeFormat 函数
- <为什么>要有virtual,及如何理解晚捆绑
- SQL Server XML基础学习之<6>--XQuery的 value() 方法、 exist() 方法 和 nodes() 方法
- Android 源码系列之<一>从源码的角度深入理解ImageView的ScaleType属性
- 学习<简明python教程>之个人总结
- <操作系统>进程与线程的有趣理解