Files
Obsidian-Main/00.01. 資料收集/MediaFoundation.canvas
Awin Huang 5d4e261181 vault backup: 2025-07-22 22:14:08
Affected files:
Too many files to list
2025-07-22 22:14:08 +08:00

15 lines
2.5 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"nodes":[
{"id":"d6c4368826cc2627","x":-672,"y":40,"width":577,"height":200,"type":"text","text":"`IMFAttributes`\n\n```cpp\npDeviceAttributes->SetGUID(\n MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE,\n MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_AUDCAP_GUID)\npDeviceAttributes->SetString(\n MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_AUDCAP_ENDPOINT_ID,\n deviceSymbolic.c_str())\n```\n"},
{"id":"671ac7c80cfb589a","x":-760,"y":-900,"width":754,"height":300,"type":"text","text":"`IMFSourceReader`\n> 用來讀取 MediaSource要搭配 `IMFAttributes` 指定讀取方式\n\n```cpp\nIMFSourceReader* pSourceReader = NULL;\nIMFAttributes* pAttributes = NULL;\n\nMFCreateAttributes(&pAttributes, 1);\npAttributes->SetUnknown(MF_SOURCE_READER_ASYNC_CALLBACK, returnDevice->sourceReaderCallback);\nMFCreateSourceReaderFromMediaSource(\n pMediaSource,\n pAttributes,\n &pSourceReader)\n```"},
{"id":"5ab8d6f75e911379","x":-649,"y":-500,"width":531,"height":204,"type":"text","text":"`IMFMediaSource`\n\n> 媒體來源是一種產生媒體資料的物件。 例如,資料可能來自視訊檔案、網路串流或硬體裝置,例如相機。 每個媒體來源都包含一或多個資料流程,而每個資料流程都會提供一種類型的資料,例如音訊或視訊。\n\n```cpp\nIMFMediaSource* pMediaSource = NULL;\npDevice->ActivateObject(IID_PPV_ARGS(&pMediaSource)\n```"},
{"id":"3df0dd59ad66c803","x":-633,"y":-200,"width":500,"height":140,"type":"text","text":"`IMFActivate(pDevice)`\n\n它就是你需要的裝置\n\n```cpp\nMFCreateDeviceSourceActivate(pDeviceAttributes, &pDevice)\n```\n"},
{"id":"c0627e6385587472","x":-1280,"y":-750,"width":440,"height":150,"color":"3","type":"text","text":"因為使用了 `MF_SOURCE_READER_ASYNC_CALLBACK`\n\n所以要在另一個 thread 裡面呼叫 `pSourceReader->ReadSample`\n\n`pSourceReader` 會透過我們自己定義的 `SourceReaderCB::OnReadSample()` 取得畫面或是聲音資料。"}
],
"edges":[
{"id":"90da9679f52c2406","fromNode":"d6c4368826cc2627","fromSide":"top","toNode":"3df0dd59ad66c803","toSide":"bottom","label":"建立"},
{"id":"53dfe096135de053","fromNode":"3df0dd59ad66c803","fromSide":"top","toNode":"5ab8d6f75e911379","toSide":"bottom","label":"建立"},
{"id":"899dd7ccd8fbfd50","fromNode":"5ab8d6f75e911379","fromSide":"top","toNode":"671ac7c80cfb589a","toSide":"bottom","label":"建立"},
{"id":"eec5fdc23644aa48","fromNode":"671ac7c80cfb589a","fromSide":"left","toNode":"c0627e6385587472","toSide":"right","color":"3","label":"注意"}
]
}