windows - Should I create a new thread for RTSP client or just use custom IMFMediaSource in Media Foundation -
i'm writing rtsp client , using media foundation stream multiple ip camera video feeds windows display. understand built-in mf rtsp doesn't handle ip cameras i'll have write custom media source:
writing custom media source: https://msdn.microsoft.com/en-us/library/windows/desktop/ms700134(v=vs.85).aspx
also following post gives useful tips not implementation details:
capture h264/aac stream via rtsp using media foundation: https://social.msdn.microsoft.com/forums/windowsdesktop/en-us/8f67d241-7e72-4509-b5f8-e2ba3d1a33ad/capture-h264aac-stream-via-rtsp-using-media-foundation?forum=mediafoundationdevelopment
if write rtsp code within custom media source object, able run sufficiently in it's own thread , use blocking "recv" network call receive camera stream data? or com object not separate thread can handle type of task? there potential conflict between blocking on "recv" call , blocking on com's work queue?
or should create new thread using "createthread" handle rtsp details , forward camera stream data media source object?
any advice point me in right direction great!
implement media source , inside implementation:
- createthread when media source "started": https://msdn.microsoft.com/en-us/library/windows/desktop/ms700134(v=vs.85).aspx#starting
- use blocking recv (or can implement more complex iocp threads) inside thread point 1.
- queue each rtsp frame obtained recv
- deliver corresponding frame (top of queue) when new sample requested: https://msdn.microsoft.com/en-us/library/windows/desktop/ms700134(v=vs.85).aspx#source_data
you can introduce gap if needed or repeat last sample if not enough data obtained.
Comments
Post a Comment