bool findInt32(uint32_t key, int32_t *value)函數 =>個人理解!

來源:互聯網
上載者:User

       最近應用工作原因在看Android多媒體架構的源碼!看到了AwesomePlayer.cpp源碼!發現有很多 bool findInt32(uint32_t key, int32_t *value);類似的代碼!看不懂什麼意思!現在豁然開朗!也是個人理解!假設!猜測!做個筆記!

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    kKeyAVCC              = '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',    kTypeAVCC        = 'avcc',#ifdef OMAP_ENHANCEMENT    kTypeHdr         = 'hdrd',#endif    kTypeD263        = 'd263',};

 

      具體這些索引值什麼意思有待進一步分析!

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.