Skip to content

Commit

Permalink
Issue #46: using BGRA-specific frame rate in Epiphan SDK video source
Browse files Browse the repository at this point in the history
  • Loading branch information
dzhoshkun committed Apr 16, 2019
1 parent 94d8dd5 commit 0dc7a0f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/epiphansdk/epiphansdk_video_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ bool VideoSourceEpiphanSDK::get_frame(VideoFrame & frame)

double VideoSourceEpiphanSDK::get_frame_rate()
{
double frame_rate = -1;
if (_frame_grabber)
{
#if defined(Epiphan_DVI2PCIeDuo_DVI) && \
Expand All @@ -135,9 +136,18 @@ double VideoSourceEpiphanSDK::get_frame_rate()
defined(Epiphan_DVI2PCIeDuo_SDI_MAX_FRAME_RATE)
std::string port_id = FrmGrab_GetId(_frame_grabber);
if (port_id == Epiphan_DVI2PCIeDuo_DVI)
return Epiphan_DVI2PCIeDuo_DVI_MAX_FRAME_RATE;
frame_rate = Epiphan_DVI2PCIeDuo_DVI_MAX_FRAME_RATE;
else if (port_id == Epiphan_DVI2PCIeDuo_SDI)
return Epiphan_DVI2PCIeDuo_SDI_MAX_FRAME_RATE;
frame_rate = Epiphan_DVI2PCIeDuo_SDI_MAX_FRAME_RATE;
if (frame_rate > 0)
{
/* The above max frame rates are defined for I420,
* and are halved for BGRA, due to hardware bandwidth
*/
if (_colour == BGRA)
frame_rate /= 2.0;
return frame_rate;
}
#endif
}

Expand Down

0 comments on commit 0dc7a0f

Please sign in to comment.