[RFC] TV support under Win32 using DirectShow
Hi, All Some time ago i have started to developing subj. And now i have got some usable results. Current status: working, but some code cleanup (and probably rewriting some not obvious parts) is required. Implementation: Driver consist of two parts: 1. DirectShow filter with one video and one audio input pin to grab media samples from live source (almost finished) 2. tvi_dshow - tv.c subdriver, which initializes DirectShow graph, adds my filter and starts/controls capture/preview process (work in progress, needs cleanup/simplification). Abilities: * Watching TV under Win32 using WDM Capture driver and DirectShow either immediate or noimmediate mode. * Grabbing synchronized audio/video with mencoder (synchronization is beeing done by DirectShow) Disadvantages: * Audio only capture does not supported (MPlayer's limitation). * Pausing or moving video windows causes buffer overflow (no pause callback exists for tv subsystem in MPlayer and i'm afraid the same issue can be applyed to the linux TV code). * Sets channels only by it's number, not by freq (probably device driver's limitation) that requires some not fine workaround. * Strange behaviour in picture width/height request (system hangup when requesting exact dimensions, if exact dimension are not requested all works fine) TODO: * Rewrite channels selecting subroutine * Improve grabbing subsystem * Review and finish initialization code (proper interact with tv.c) For function properly my code required extending of loader/dshow/output.c functionality (realization some of currently unimplemented methods) so, to avoid breaking something in dshow/* i suggest following way (if you will agree to continue developing and starting some discussion, of course): 1. doxygenize loader/dshow/output.c 2. fix debug messages and methods' names which does not comply with methods behaviour. 3. extends functionality of loader/dshow/output.c to level requied by my driver -- 4.add to guids.* declaration of additional DirectShow interfaces, which is used by new driver 5.add driver (grabber and tvi_dshow) Steps 1-2 would not break any functionality (almost cosmetics), so can be easily reviewed and safely applied even now. 3 and others (espesially tvi_dshow.c) requires additional work and discussion so should be done after next RC release, i think. What will you say? Should i post first patches? If anybody will be interesting in testing it i can upload prebuilded binaries+source anywhere in Web to make testing more easy. Regards, Vladimir Voroshilov mailto:voroshil@gmail.com JID: voroshil@jabber.ru ICQ: 95587719
Vladimir Voroshilov wrote:
What will you say? Should i post first patches?
of course, how can we C otherwise?
If anybody will be interesting in testing it i can upload prebuilded binaries+source anywhere in Web to make testing more easy.
patch, please. But wait, since WDM doesn't permit (afaik, correct me if I'm wrong) to stream from dvb sources, why don't you adapt your patch to BDA? A good BDA player is still missing, or at least I couldn't find any (except payware that are not an option for me) -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Questo inverno scaldale il cuore, con il prezioso calore di un Diamante. * Non lasciarti sfuggire lo sconto del 20% riservato a te! Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=5630&d=16-1
2007/1/16, Nico Sabbi <nsabbi@email.it>:
Vladimir Voroshilov wrote:
What will you say? Should i post first patches?
of course, how can we C otherwise?
If anybody will be interesting in testing it i can upload prebuilded binaries+source anywhere in Web to make testing more easy.
patch, please. Of course. Unfortunatly, currently ready to apply only cosmetics "doxygenize" patch. But if you wish, i can post patch for current development version (as-is). Some parts still ugly, so it can be treated as first draft version only.
But wait, since WDM doesn't permit (afaik, correct me if I'm wrong) to stream from dvb sources, why don't you adapt your patch to BDA? What driver's functionality are you wish?
A good BDA player is still missing, or at least I couldn't find any (except payware that are not an option for me) BDA=Broadcast Driver Architecture, i think. Does it requiere any special hardware for testing (e.g. DVB card, etc.), any special drivers for working?
I have only analog TV tuner with buggy WDM driver :(
-- Email.it, the professional e-mail, gratis per te: http://www.email.it/f
Sponsor: Questo inverno scaldale il cuore, con il prezioso calore di un Diamante. * Non lasciarti sfuggire lo sconto del 20% riservato a te! Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=5630&d=16-1 _______________________________________________ MPlayer-dev-eng mailing list MPlayer-dev-eng@mplayerhq.hu http://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
-- Regards, Vladimir Voroshilov mailto:voroshil@gmail.com JID: voroshil@jabber.ru ICQ: 95587719
Vladimir Voroshilov wrote:
Of course. Unfortunatly, currently ready to apply only cosmetics "doxygenize" patch. But if you wish, i can post patch for current development version (as-is). Some parts still ugly, so it can be treated as first draft version only.
ok
But wait, since WDM doesn't permit (afaik, correct me if I'm wrong) to stream from dvb sources, why don't you adapt your patch to BDA?
What driver's functionality are you wish?
streaming from dvb drivers
A good BDA player is still missing, or at least I couldn't find any (except payware that are not an option for me)
BDA=Broadcast Driver Architecture, i think. Does it requiere any special hardware for testing (e.g. DVB card, etc.), any special drivers for working?
I have only analog TV tuner with buggy WDM driver :(
usual hardware with BDA driver -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Cassine di Pietra: vini veneti di qualit� subito a casa Sua * da un�azienda famigliare al servizio di clienti selezionati * Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=3919&d=16-1
2007/1/16, Nico Sabbi <nsabbi@email.it>:
Vladimir Voroshilov wrote:
Of course. Unfortunatly, currently ready to apply only cosmetics "doxygenize" patch. But if you wish, i can post patch for current development version (as-is). Some parts still ugly, so it can be treated as first draft version only.
ok Cosmetics patches already posted. Other parts will be posted soon.
But wait, since WDM doesn't permit (afaik, correct me if I'm wrong) to stream from dvb sources, why don't you adapt your patch to BDA?
What driver's functionality are you wish?
streaming from dvb drivers
A good BDA player is still missing, or at least I couldn't find any (except payware that are not an option for me)
BDA=Broadcast Driver Architecture, i think. Does it requiere any special hardware for testing (e.g. DVB card, etc.), any special drivers for working?
I have only analog TV tuner with buggy WDM driver :(
usual hardware with BDA driver I have found some info about it. I'm afraid this require similar designed (filter/subdriver), but different driver (using another API). Thus, i can't develop BDA driver without apropriate device.
P.S. I also found that some DVB card have as BDA as WDM drivers. -- Regards, Vladimir Voroshilov mailto:voroshil@gmail.com JID: voroshil@jabber.ru ICQ: 95587719
Hello, On Tue, Jan 16, 2007 at 02:16:41PM +0600, Vladimir Voroshilov wrote:
Driver consist of two parts: 1. DirectShow filter with one video and one audio input pin to grab media samples from live source (almost finished)
I strongly prefer solutions that do not require installation if that was possible.
* Pausing or moving video windows causes buffer overflow (no pause callback exists for tv subsystem in MPlayer and i'm afraid the same issue can be applyed to the linux TV code).
Will have to see about that in detail, but in principle the stream layer can just drop frames, assuming it knows where frames start and end... I'm fairly certain that should be fixable (though even nicer would be if moving the window wouldn't stop everything - interestingly the same issue exists under linux, but only with some window managers...)
* Sets channels only by it's number, not by freq (probably device driver's limitation) that requires some not fine workaround.
"not fine" meaning? A table for translating frequencies into channels seems like a perfectly fine way to handle this. Anyway, without seeing the real code it all is hard to say... [...]
If anybody will be interesting in testing it i can upload prebuilded binaries+source anywhere in Web to make testing more easy.
This is the developers list, I'm sure some here would prefer not to test even their own patches. If you want testing, MPlayer-cygwin or so seems the better place to suggest it... Greetings, Reimar Döffinger
2007/1/17, Reimar Döffinger <Reimar.Doeffinger@stud.uni-karlsruhe.de>: > Hello, > On Tue, Jan 16, 2007 at 02:16:41PM +0600, Vladimir Voroshilov wrote: > > Driver consist of two parts: > > 1. DirectShow filter with one video and one audio input pin to grab > > media samples from live source (almost finished) > > I strongly prefer solutions that do not require installation if that was > possible. It does need any installation.I meant that one part of my code acts as DirectShow filter, by i did not say that it is full-featured DirectShow filter's DLL. My driver is part of MPlayer. MPlayer will build filter (as DirectShow object) at runtime while opening tv:// under Win32. > > * Pausing or moving video windows causes buffer overflow (no pause > > callback exists for tv subsystem in MPlayer and i'm afraid the same > > issue can be applyed to the linux TV code). > > Will have to see about that in detail, but in principle the stream layer > can just drop frames, assuming it knows where frames start and end... > I'm fairly certain that should be fixable (though even nicer would be if > moving the window wouldn't stop everything - interestingly the same > issue exists under linux, but only with some window managers...) I'll continue to investigate it. > > * Sets channels only by it's number, not by freq (probably device > > driver's limitation) that requires some not fine workaround. > > "not fine" meaning? A table for translating frequencies into channels > seems like a perfectly fine way to handle this. > Anyway, without seeing the real code it all is hard to say... But used IAMTVTuner Directshow interface doesn't allow to set frequency, just channel number. Thus i have to read DirectShow's channel table first for proper country (not implemented yet), and every time translate given by tv.c frequency into channel number. This is what i meant under "not fine workaround". I am planning to do following: 1. try to set frequency using IKsPropertySet (direct call to tuner, i think, but not sure). 2. if first call fails driver will set up some flag and will use 3 instead this method until MPlayer finished. 3 driver will use workaround described above. > > If anybody will be interesting in testing it i can upload prebuilded > > binaries+source anywhere in Web to make testing more easy. > > This is the developers list, I'm sure some here would prefer not to test even > their own patches. If you want testing, MPlayer-cygwin or so seems the > better place to suggest it... :) ok. Well, i have attached current development version. First i want hear something about driver's architecture. Probably i am running in wrong way (i hope, I'm not). I'm afraid that (due to output.c changes) it can also broke any functionality in Win32 loader (it shouldn't but who knows...). I have tested (under Linux) all media files from my HDD, but non of them used dshow loader (just dmo). Thus my test was incomplete. I also does not decide where put tvi_dshow.h contents to. It contains some declaration, that already defined in either recent wine versions or used mingw32. Unfortunately it is not possible to mix it together. -- Regards, Vladimir Voroshilov mailto:voroshil@gmail.com JID: voroshil@jabber.ru ICQ: 95587719
2007/1/17, Vladimir Voroshilov <voroshil@gmail.com>:
Well, i have attached current development version. Sorry, i had not checked file size. It much longer then 80kb. At next time i'll be more accurate.
-- Regards, Vladimir Voroshilov mailto:voroshil@gmail.com JID: voroshil@jabber.ru ICQ: 95587719
Vladimir Voroshilov <voroshil <at> gmail.com> writes:
If anybody will be interesting in testing it i can upload prebuilded binaries+source anywhere in Web to make testing more easy.
i'm interested in testing! make sure to --enable-static --enable-runtime- cpudetection . the mplayer-cygwin list would be best.
I'm afraid that (due to output.c changes) it can also broke any functionality in Win32 loader (it shouldn't but who knows...). I have tested (under Linux) all media files from my HDD, but non of them used dshow loader (just dmo). Thus my test was incomplete.
using -vfm dshow or even specifying the dshow codec e.g. -vc wmv8 will force dshow ...
I also does not decide where put tvi_dshow.h contents to. It contains some declaration, that already defined in either recent wine versions or used mingw32. Unfortunately it is not possible to mix it together.
can you rename the declaration? e.g. mplayer_declaration_name . maybe i dont understand how to program yet :) -compn
participants (4)
-
Compn -
Nico Sabbi -
Reimar Döffinger -
Vladimir Voroshilov