@@ -55,24 +55,21 @@ namespace platf::dxgi {
55
55
return capture_e::ok;
56
56
}
57
57
58
- /* *
58
+ /* *
59
59
* @brief Get the next frame from the producer thread.
60
60
* If not available, the capture thread blocks until one is, or the wait times out.
61
61
* @param timeout how long to wait for the next frame
62
- * @param out a texture containing the frame just captured
63
- * @param out_time the timestamp of the frame just captured
62
+ * @param out pointer to AMFSurfacePtr
64
63
*/
65
64
capture_e
66
65
amd_capture_t::next_frame (std::chrono::milliseconds timeout, amf::AMFData** out) {
67
66
release_frame ();
68
- // this CONSUMER runs in the capture thread
69
- // Poll for the next frame
67
+
70
68
AMF_RESULT result;
71
69
auto capture_start = std::chrono::steady_clock::now ();
72
70
do {
73
71
result = captureComp->QueryOutput (out);
74
72
if (result == AMF_REPEAT) {
75
- // Check for capture timeout expiration
76
73
if (std::chrono::steady_clock::now () - capture_start >= timeout) {
77
74
return platf::capture_e::timeout;
78
75
}
@@ -81,7 +78,6 @@ namespace platf::dxgi {
81
78
} while (result == AMF_REPEAT);
82
79
83
80
if (result != AMF_OK) {
84
- BOOST_LOG (error) << " DisplayCapture::QueryOutput() failed: " sv << result;
85
81
return capture_e::timeout;
86
82
}
87
83
return capture_e::ok;
@@ -133,31 +129,11 @@ namespace platf::dxgi {
133
129
DXGI_ADAPTER_DESC adapter_desc;
134
130
display->adapter ->GetDesc (&adapter_desc);
135
131
136
- amf::AMFTrace* traceAMF;
137
- amf_factory->GetTrace (&traceAMF);
138
- traceAMF->SetGlobalLevel (AMF_TRACE_DEBUG);
139
- traceAMF->EnableWriter (AMF_TRACE_WRITER_FILE, true );
140
- traceAMF->SetWriterLevel (AMF_TRACE_WRITER_FILE, AMF_TRACE_DEBUG);
141
- traceAMF->SetPath (L" D:/amflog.txt" );
142
-
143
- amf::AMFDebug* debugAMF;
144
- amf_factory->GetDebug (&debugAMF);
145
- debugAMF->AssertsEnable (false );
146
-
147
132
// Bail if this is not an AMD GPU
148
133
if (adapter_desc.VendorId != 0x1002 ) {
149
134
return -1 ;
150
135
}
151
136
152
- // BOOST_LOG(info) << "### framerate " << config.framerate << " dynamicRange " << config.dynamicRange;
153
-
154
- // // FIXME: Don't use Direct Capture for a SDR P010 stream. The output is very dim.
155
- // // This seems like a possible bug in VideoConverter when upconverting 8-bit to 10-bit.
156
- // if (config.dynamicRange && !display->is_hdr()) {
157
- // BOOST_LOG(info) << "AMD Direct Capture is disabled while 10-bit stream is in SDR mode"sv;
158
- // return -1;
159
- // }
160
-
161
137
// Create the capture context
162
138
result = amf_factory->CreateContext (&context);
163
139
0 commit comments