vault backup: 2025-03-19 19:59:01
Affected files: 00. Inbox/MediaFoundation.canvas
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
{
|
||||
"nodes":[
|
||||
{"id":"d6c4368826cc2627","x":-317,"y":0,"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":"3df0dd59ad66c803","x":-278,"y":-260,"width":500,"height":140,"type":"text","text":"`IMFActivate(pDevice)`\n\n它就是你需要的裝置\n\n```cpp\nMFCreateDeviceSourceActivate(pDeviceAttributes, &pDevice)\n```\n"},
|
||||
{"id":"5ab8d6f75e911379","x":-294,"y":-620,"width":531,"height":264,"type":"text","text":"`IMFMediaSource`\n\n> 媒體來源是一種產生媒體資料的物件。 例如,資料可能來自視訊檔案、網路串流或硬體裝置,例如相機。 每個媒體來源都包含一或多個資料流程,而每個資料流程都會提供一種類型的資料,例如音訊或視訊。\n\n```cpp\nIMFMediaSource* pMediaSource = NULL;\npDevice->ActivateObject(IID_PPV_ARGS(&pMediaSource)\n```"}
|
||||
{"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":"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":"注意"}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user