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:

  1. createthread when media source "started": https://msdn.microsoft.com/en-us/library/windows/desktop/ms700134(v=vs.85).aspx#starting
  2. use blocking recv (or can implement more complex iocp threads) inside thread point 1.
  3. queue each rtsp frame obtained recv
  4. 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

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -