Commit 1c1abd7d authored by Mickaël Turnel's avatar Mickaël Turnel

Add the use of MSFrameRateController to filter fps for windows 10

parent c65322b5
...@@ -272,6 +272,7 @@ int MSWinRTCap::activate() ...@@ -272,6 +272,7 @@ int MSWinRTCap::activate()
if (!mIsInitialized) initialize(); if (!mIsInitialized) initialize();
ms_average_fps_init(&mAvgFps, "[MSWinRTCap] fps=%f"); ms_average_fps_init(&mAvgFps, "[MSWinRTCap] fps=%f");
ms_video_init_framerate_controller(&mFpsControl, mFps);
configure(); configure();
applyVideoSize(); applyVideoSize();
applyFps(); applyFps();
...@@ -309,12 +310,14 @@ void MSWinRTCap::stop() ...@@ -309,12 +310,14 @@ void MSWinRTCap::stop()
int MSWinRTCap::feed(MSFilter *f) int MSWinRTCap::feed(MSFilter *f)
{ {
mblk_t *im; if (ms_video_capture_new_frame(&mFpsControl, f->ticker->time)) {
mblk_t *im;
// Send queued samples
while ((im = mHelper->GetSample()) != NULL) { // Send queued samples
ms_queue_put(f->outputs[0], im); while ((im = mHelper->GetSample()) != NULL) {
ms_average_fps_update(&mAvgFps, (uint32_t)f->ticker->time); ms_queue_put(f->outputs[0], im);
ms_average_fps_update(&mAvgFps, (uint32_t)f->ticker->time);
}
} }
return 0; return 0;
...@@ -324,6 +327,8 @@ int MSWinRTCap::feed(MSFilter *f) ...@@ -324,6 +327,8 @@ int MSWinRTCap::feed(MSFilter *f)
void MSWinRTCap::setFps(float fps) void MSWinRTCap::setFps(float fps)
{ {
mFps = fps; mFps = fps;
ms_average_fps_init(&mAvgFps, "[MSWinRTCap] fps=%f");
ms_video_init_framerate_controller(&mFpsControl, fps);
applyFps(); applyFps();
} }
......
...@@ -132,5 +132,6 @@ namespace libmswinrtvid ...@@ -132,5 +132,6 @@ namespace libmswinrtvid
bool mExternal; bool mExternal;
MSWinRTCapHelper^ mHelper; MSWinRTCapHelper^ mHelper;
MediaEncodingProfile^ mEncodingProfile; MediaEncodingProfile^ mEncodingProfile;
MSFrameRateController mFpsControl;
}; };
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment