Help - Search - Members - Calendar
Full Version: DigitalWatch Development
DVB Owners Discussion Forum - dvbowners.com > Technical & Development Forums > DigitalWatch Development
nate
This thread is for people who are working on DigitalWatch to let other people know what they are working on. If people share then hopefully there won't be too much doubling up in work being done, and if more than one person is working on a similar thing then they will be able to collaberate.
It also gives other developers who aren't necessarily working a particular thing, but have put some thought into it, a chance to share any ideas, hints, resources, etc.. they have.

Also, this can be a place where we can keep a speculative TODO list. By speculative, i mean that not everything on the list needs to be done, but the list is there so that if someone see's something on the list and thinks it's the best thing since sliced bread, then they can implement (or at least think about implementing) it.

To start with, here's my list of things with a few comments i've added.

[list]new TS parser/splitter/recorder (I'm working on this)
To fix the microsoft demultiplexer pausing problem (hopefully).
Can continually parse channel info and provide live feedback to DigitalWatch so that if the pids for a program change then it can adapt on the fly.
Can write our own recording mechanism that hopefully won't have the same bugs as twinhan's.
Can get extra stats such as continuity errors etc.
might be able to do MHP also.


[*]KeepWindowAR function. to keep the width and height of the window relative when resizing.
KeepWindowAR(0/1/2) 0=unlock, 1=lock, 2=toggle
KeepWindowAR(x, y) lock to x:y AR.


[*]Command-line parameters
Do away with the /card x that i've done already. Possibly need to make a SelectCard() function, just depends how the next twinhan SDK works.
Need to make sure commands are run at the appropriate time
ie. before SetChannel() / is SetChannel() (or ManualChannel()) / after SetChannel()
need to move the check for an existing instance of DigitalWatch from DigitalWatchWindow.cpp into DigitalWatch.cpp and if it is running and there are command line arguments specified then use the WM_COPYDATA message (as done in the WS mod for DW) to send them to the already running instance.


[*]Still Image Capture


[*]TimeShifting for twinhan splitter (DVBInput = 3)
Fairly easy. Just compare the difference between DVBSourceMSDemux and DVBSourceMSDemuxTimeShift, then you should be able to create DVBSourceTSSplitterTimeShift the same way.


[*]DSNetworkSink and DSNetworkSource derived from DVBInput
DVBInput=5 and 6 (or whatever we're up to by then)
For network streaming.
Will need to add more stuff to DVBInput like BOOL CanLock() and BOOL CanSetPids() so that the osd can supply sensible messages. For instance, if you try to change networks when using DSNetworkSource it should give a message saying only changing programs is possible, and vise-vera for DSNetworkSink.


[*]On the fly DVBInput change.
Not really important now, but might be handy later
Also thinging that maybe each DVBInput should be in it's own dll. Perhaps it will be better to wait until DVBInput is more developed. Still too many changes going on in it at this stage. Any thoughts on this?


[*]Timer to put the computer to sleep/shutdown
These need to not happen if currently recording.


[*]startup.ini - A list of Functions. Basically a startup script.
might be useful for scripting support from other programs. Rather than specifying command line parameters they can just set the startup.ini script.


[*]Add Now and Next info to options for CaptureFileName mask.


[*]Enhance the OSD
[list]Transparency support for VMR9.
Use IVMRMixerControl9 to get colorkey if VMR9 filter exists.
See FilterGraphManager::GetOverlayKey, HRESULT GetOverlayMixer and GetOverlayMixerInput0Pin.


[*]Bitmaps (skinnable)
[list]channel logos.

[*]osd entry background bitmaps. For those who don't want transparency, but want more than the plain black background.

[*]Control bar (like zoomplayer's) for mouse support.
[list]If anyone has any whiz bang ideas on a good way to implement a skinnable interface then please share.


[*]Menu mode.
Need to create functions Menu(int menuId), MenuUp(), MenuDown(), MenuLeft(), MenuRight(), MenuEnter(), MenuBack(), MenuExit()
Key mapping already has support for multple sets of mappings. Need a menu group where up, down, left, right, enter, back, and exit are mapped to the MenuUp, etc... functions.

[*]Menu to select channels, video decoders, audio decoders, resolutions, timeshifting, filters, ...

[*]Settings page for Global settings such as AR, Auto Fullscreen, etc...
if we have a separate GUI for settings then this mightn't need to be done, but for a HTPC a menu like this would be easier to operate with a remote.
[list]

[*]Channel info
Video info. res, fps, interlaced vs progressive.
Audio info. mpa vs ac3, 2.0, 5.1.

[list]
jslawler
QUOTE
Timer to put the computer to sleep/shutdown
These need to not happen if currently recording.


A while back i found code to put computer into sleep mode, you need to set the token of the current process to have the right permissions. Here is the code i wrote if someone wants to implement it with a timer?

<!--c1--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->

/*

Header: Declared in Winbase.h; include Windows.h.

Library: Use Kernel32.lib.

*/

int ShutdownComputer()

{



//Set privileges to allow shutdown command



HANDLE hToken;

TOKEN_PRIVILEGES tkp;



// Get the current process token handle so we can get shutdown privilege.

if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken)) {

printf("STANDBY: OpenProcessToken failed.");

return 1;

}



// Get the LUID for shutdown privilege.

LookupPrivilegeValue(NULL, SE_SHUTDOWN_NAME, &tkp.Privileges[0].Luid);

tkp.PrivilegeCount = 1; // one privilege to set

tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;



// Get shutdown privilege for this process.

AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, (PTOKEN_PRIVILEGES) NULL, 0);



if (GetLastError() != ERROR_SUCCESS) {

printf("STANDBY: AdjustTokenPrivileges failed.");

return 2;

}





SetSystemPowerState(1, 0); //goes into standby



return 0;

}

<!--c2--></td></tr></table><span class='postcolor'><!--ec2-->
nate
Just for the benefit of people who don't know.

When you make source available don't include anything in the obj folder. Nothing in there is needed by other people and it makes the zip quite a bit smaller by omitting them. The DigitalWatch.ncb and DigitalWatch.opt files aren't necessary either, but they aren't so big so they aren't as big a deal.
Builty
I'm working on adding mouse support now:

1:
Feature: rotating the mouse wheel button will peform the function defined in an ini file (intending to use it for zooming, but channel change could be cool too.)

Current Status: coded (without ini configuration yet) and functioning on development machine (without tuner card fitted), going to test on HTPC with card soon.


2:
Feature: Control bar. Moving mouse near bottom of screen pops up a control bar, with icons for common functions. Seleting the icon runs the defined function. Intending to use an ini to allow custom configuration of the buttons. Icons have up/down states and are stored in one bitmap, loaded at runtime, hence can be changed by the user. After 3 seconds, of no mouse movement, bar auto hides with mouse.

Current Status: show/hide mechanism coded and working, default skin icons created, some basic functionality of grabbing the mouse locations and running functions done. Working on bitmap loader class.


I'm note sure if this approach fits in exactly with your general OSD plans Nate, so I'd welcome any further suggestions.
null_pointer
QUOTE ("Cropsy")
<b>Mark</b>
Versions of SDTVR from 0.95 onwards require the 2.6 SDK. If that doesn't fix the problem let me know.


Thanks Cropsy, i tried to d/l the 2.6 but could only see v2.5 (specficially WinDTV2.5_SDK_03) of the SDK on the twinhan wesite. Do you know where I can get it?
nate
QUOTE ("Cropsy")
<b>Mark</b>
Versions of SDTVR from 0.95 onwards require the 2.6 SDK. If that doesn't fix the problem let me know.


Thanks Cropsy, i tried to d/l the 2.6 but could only see v2.5 (specficially WinDTV2.5_SDK_03) of the SDK on the twinhan wesite. Do you know where I can get it?
JoeyBloggs
QUOTE ("Cropsy")
<b>Mark</b>
Versions of SDTVR from 0.95 onwards require the 2.6 SDK. If that doesn't fix the problem let me know.


Thanks Cropsy, i tried to d/l the 2.6 but could only see v2.5 (specficially WinDTV2.5_SDK_03) of the SDK on the twinhan wesite. Do you know where I can get it?
nate
@Builty,

I was thinking the mouse wheel (and possibly other clicks) could be added to the KeyMapping class. Just define some negative numbers for the keycode.
#define MOUSE_RIGHTCLICK -2
#define MOUSE_MIDDLECLICK -3
#define MOUSE_SCROLLUP -4
#define MOUSE_SCROLLDOWN -5
Then you can just include them in keys.ini like
Mouse(2) = LastChannel()
Mouse(3) = ZoomMode(-1)
Mouse(4) = NetworkUp()
Mouse(5) = NetworkDown()
Note that i'm still using positive numbers in the .ini file. There's no practical reason for this, i just thought it might make things look nicer. When we parse the file if the function name, if it's Mouse rather than Key then we can negate the value easily enough.

QUOTE
I'm note sure if this approach fits in exactly with your general OSD plans Nate, so I'd welcome any further suggestions.
I havn't really figured out the best way to go here, but my general feeling is that we need to introduce an int in OSDEntry called entryType that we can set depending on what sort of entry it is. I think it would be hardcoded though. It's not really something that needs to go in osd.ini.
#define ENTRYTYPE_TEXT 1
#define ENTRYTYPE_BITMAP 2
#define ENTRYTYPE_CONTROLBAR 3
Then in OSD::RepainEntry()
if entry.entryType == ENTRYTYPE_TEXT ShowText(entry)
if entry.entryType == ENTRYTYPE_BITMAP ShowBitmap(entry)
if entry.entryType == ENTRYTYPE_CONTROLBAR ShowControlBar(entry)
Builty
Thanks for the tips Nate. I got the mouse clicks/scroll going just as you describe, works very nicely, and required minimal changes. Now for the next bit!
Builty
Update: I have the whole thing coded and functional, but I have a couple of bugs to resolve:
- the entire OSD is overwritten a couple of times when a channel is changed, hence my controlbar disappears
- some of the OSD text is configured to appear partially on top of my controlbar, so it needs to be moved.

Hoping to have it complete in a week or so.
nate
QUOTE
- the entire OSD is overwritten a couple of times when a channel is changed, hence my controlbar disappears
I've been battling with this since v0.3. Getting the OSD to display properly when the overlay refreshes is a pain, and just when you think you've fixed it something else goes wrong.

QUOTE
- some of the OSD text is configured to appear partially on top of my controlbar, so it needs to be moved.
Why don't you just draw the control bar after all the OSD text is drawn?
Builty
QUOTE
QUOTE
- the entire OSD is overwritten a couple of times when a channel is changed, hence my controlbar disappears
I've been battling with this since v0.3. Getting the OSD to display properly when the overlay refreshes is a pain, and just when you think you've fixed it something else goes wrong.

QUOTE
- some of the OSD text is configured to appear partially on top of my controlbar, so it needs to be moved.
Why don't you just draw the control bar after all the OSD text is drawn?


I could just overwrite the text, but I thought it would be nicer to bump the text up (only needs a little) so that both are visible at the same time.
nate
Just an update to let everyone know what's happening with the development of DigitalWatch.

Since the currently available version is more or less adequate for most people I've decided to totally pull the code apart and more or less start again. The main reason for this is that the BDA architecture is totally different to twinhan's which the program was originally designed around. There's also some features that i'm hoping to add in the future that will be difficult to implement in the current setup, so by starting again i can create a design that will allow for these.
Aside from that, I know a lot more about directshow now than i did when i started so i should be able to do things better and make it more stable.

So in a nutshell, the next release of DW will be a bit of a way off.

Some of the features i'm hoping to implement are
- background recording
- file playback
- network streaming
- automatic PID scanning
- on screen menus
Spoonfed
Nate,

Sound promising, hopefully Dvico beat you with BDA drivers (....errrm fat chance smile.gif ) and i can be in 'dual BDA bliss" with WS and DW smile.gif
If we are lucky the "pausing/frame by frame" issue will also vanish smile.gif
magnetik
Excellent news - im sure everyone will agree that we are all awaiting with Baited breath for this next release smile.gif

until then the current BDA beta is getting alot of use on my HTPC setup - and even tho its crashes sometimes on channel change - it does so very gracefully so its all okay biggrin.gif
Champion_R
Can we please have working 5.1 support in the next Digitalwatch BDA considering it's being rebuilt from scratch? Currently 5.1 doesn't play properly and upconverting 2.0 to 5.1 suffers the same problem, only the front left and front right channels work.

The problem only occurs when using the MS Demuxer, 5.1 works fine with the Twinhan demuxer but you can only use the MS one with Digitalwatch BDA.
oscillatory
QUOTE (magnetik @ Jul 23 2004, 11:12 AM)
Excellent news - im sure everyone will agree that we are all awaiting with Baited breath for this next release smile.gif

Definintely!

nate, do you plan on the revamped version of DW having multi-card support, similar to that currently implemented in WS?

Currently I'm running TH drivers on one card and BDA on the other, along with respective versions of DW and WS to get pseudo multi-card functionality, but it means I have to be conscious of which tuner I'm using to watch and record at any given time. So this is the key feature I'm hanging out for!

Keep up the great work...
Spoonfed
Perhaps even an option to "allow" WS to take priority. Ie say WS is capturing on 1 card, DW is using the other card, WS wants to start a 2nd capture then perhaps WS takes over, or something, i guess this may require some WS/DW interaction?
Simon
If you're going to support MHP i'm gonna love you biggrin.gif

Are you going to implement interactivity with a return channel (internet connection) too?

Bye
Simon
bear
Nate,

Just a thought.

Would it be a good idea to implement a simple web interface into DW for the purpose of communicating with the WS program. This may assist a DW user in determining an action based on any conflicts with WS.

eg. DW could poll WS every 60 sec for any requests for the tv card that it is using. It would then alert the DW user that a scheduled recording is due to occur and that the card is needed.(if not on same network that is.)

It could then prompt the DW user to release the card before it is required or defer the WS recording until the card is released. You could also use this tactic for background recording in DW.

What you think?

Dan.
datkins
You could implement notification through flat files,
or a TCP port on localhost.

WS could connect to Digital Watch and Ask it what it is doing.
Then ask it to record, if on the right station, or WS would not both recording given the user is watching the show live.

Otherwise WS check for a free card, and uses it, otherwise force Digital Watch to change channels and record.

An alternative is to be able to share a card.

???
nate
QUOTE (Champion_R @ Jul 23 2004, 05:11 PM)
Can we please have working 5.1 support in the next Digitalwatch BDA considering it's being rebuilt from scratch?
Probably not straight away, but the new design will make it easier to add support for it.

QUOTE (oscillatory @ Jul 24 2004, 01:47 PM)
nate, do you plan on the revamped version of DW having multi-card support, similar to that currently implemented in WS?
Yes.

QUOTE (Spoonfed @ Jul 24 2004, 04:05 PM)
Perhaps even an option to "allow" WS to take priority.  Ie say WS is capturing on 1 card, DW is using the other card, WS wants to start a 2nd capture then perhaps WS takes over, or something, i guess this may require some WS/DW interaction?
I'm trying to avoid having DW do any recordings for WS. I'm hoping that if WS needs to use a card that DW is using then it can tell DW to stop. It's a pretty simple bit of code for Null to add and it'll mean that all recordings done by WS will be reliable.

QUOTE (Simon @ Jul 24 2004, 08:38 PM)
If you're going to support MHP i'm gonna love you biggrin.gif

Are you going to implement interactivity with a return channel (internet connection) too?
I'm not working on MHP, but if someone develops an open-source MHP decoder that i can integrate into DW then sure. I don't know about implementing a return channel. We'll have to see.

QUOTE (bear @ Jul 25 2004, 11:39 PM)
Nate,Would it be a good idea to implement a simple web interface into DW for the purpose of communicating with the WS program. This may assist a DW user in determining an action based on any conflicts with WS.

eg. DW could poll WS every 60 sec for any requests for the tv card that it is using. It would then alert the DW user that a scheduled recording is due to occur and that the card is needed.(if not on same network that is.)
Yes it's probably a good idea, but it's definatly something to put in the Later category.

QUOTE (datkins @ Jul 26 2004, 12:39 AM)
You could implement notification through flat files, or a TCP port on localhost.
Just going to use windows messages.
brent
QUOTE (nate @ Jul 26 2004, 12:51 PM)
QUOTE (Champion_R @ Jul 23 2004, 05:11 PM)
Can we please have working 5.1 support in the next Digitalwatch BDA considering it's being rebuilt from scratch?
Probably not straight away, but the new design will make it easier to add support for it.

huh.gif
5.1 works fine for me.
Champion_R
QUOTE (brent @ Jul 27 2004, 04:45 PM)
huh.gif
5.1 works fine for me.

I'm assuming you output via SPDIF to an external receiver.
brent
Ahhh ok, yeah I am.
wynton
I would thank the team for the soft, it looks very interesting.
I have two questions :
- I live in france and there are 5 multiplex. The last multiplex frequency is 598000. But when I try to scan channel with dw2.0.1.6, the soft doesn't show the last multiplex in the frequency list. If there are 3,2 , 4 multipex 598000 frequency is not recognized.
- It's impossible to record a channel, maybe there is a command line to enter somewhere to activate the functionnality

I looked for on the forum but I see no answer for my trouble
Thanks for your help.
nate
Thanks for the feedback wynton.

QUOTE (wynton @ Oct 16 2005, 11:23 PM) *
- I live in france and there are 5 multiplex. The last multiplex frequency is 598000. But when I try to scan channel with dw2.0.1.6, the soft doesn't show the last multiplex in the frequency list. If there are 3,2 , 4 multipex 598000 frequency is not recognized.
Feel free to edit the FrequencyList.xml file in the BDA_DVB-T folder.

QUOTE (wynton @ Oct 16 2005, 11:23 PM) *
- It's impossible to record a channel, maybe there is a command line to enter somewhere to activate the functionnality
Recording has not been implemented yet. I use DVB-WS for all my recording so it's not high on the priority list.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2018 Invision Power Services, Inc.