Writing Windows Media Center Extender - c#

I recently purchased an XBox 360 and was first introduced to the term "Media Extender". I didn't realize that windows had the ability to stream content to an XBox and was very surprised and excited. I also noticed that people wrote their own plugins that allowed streaming of, for example, netflix. I would like to know more about how to do this but find it hard to even Google it because I know so little about the terminology (I'm not sure whether the XBox is the "extender" or the "extender" is a plugin that makes the Xbox stream). Can anybody explain this technology to me and perhaps direct me to good getting started reference for building my own plugins (for instance, to stream Pandora to the Xbox)?

An Xbox 360 is a Windows Media Center Extender device, implemented in software on the Xbox. Dedicated hardware implementations exist, such as this, but I don't think they've ever taken off like they were supposed to.
Windows Media Center can be extended via its APIs for building add-ins. Take a look at this Google search.
In my experience (we use this in our lounge) not all plugins seem to work via the Xbox 360 - some work only on the PC.
Hope this helps some.

Related

Capture camera using DirectShow

I'm developping a SmartDevice application (Pocket PC 2003 template) in C# for a device with Windows Mobile 6.1. I need to use the camera of this device (photos, video); to do this work i tried using the CameraCaptureDialog class but it does not work for Pocket PC applications.
So, I documented on the internet and found that I probably refer to DirectShow API, but the problem is that I do not know where to start because I can't found a working/correct example.
My questions:
Is this the right way? Are there alternatives?
Where I can find a very good example that shows how to do this work?
You may try directshowbetcf: http://alexmogurenko.com/blog/directshownetcf/ if you really want to go with DirectShow and NetCF.
There's plenty of examples of directshow on the web. There is a site dedicated to converting the API over to C# which makes it a lot easier, maybe this was it http://directshownet.sourceforge.net/about.html. I struggled with DirectShow until I read the book "programming directshow" from microsoft press. About a third of that way through that book it all seemed incredibly easy and I was able to complete what I wanted. In the end it's a lot like referencing any library and using the classes from within that library. The added difficulty is that you need to add wrappers because they are all COM objects but that has been done for you.
This might be useful to you to understand the DirectShow technology. Basically gives a start to DirctShow and explains some of the important points. But its C++ not C#. Hope this help
Basic Video Capture
DirectShow is the video capture API in Windows Mobile 6. There is a Video Capture Filter there and all in all things are designed pretty much the same way they are in Windows.
The problem is that however that this is a native API, and not just in Windows Mobile. To develop in C# you need some bindings and they are missing. On desktop there is DirectShow.NET, which is a missing piece, but it does not seem to fit well for CE. Yet you still need to fill this gap in Windows Mobile.
To work it around you have a few ways, the first would be to go through DirectShow.NET and update it appropriately to start working on your device, strip parts missing in mobile OS etc. This would get you a twin for DS.NET but for mobile operating system.
Another option would be to do some C++ development and implement the minimal sufficient feature set in that domain, exposing the component via COM. Then you will reference this from managed code and things will get connected together. And another obvious option would be to use a third party solution which already does one of the mentioned above.

Playing video in a .NET application

Lately, I've been trying to setup a media center PC. I've played around with all the common media center applications like XBMC, Plex, Boxee, and WMC. But all of them have one issue or another. So I was thinking about writing my own application from scratch.
My problem is I have no experience with developing software that plays media such as videos or music. I'm also not interested in spending a huge amount of time trying to figure this out, considering all the different file formats and codecs out there. I'm really more interested in developing the database and library interface for my application and reusing someone else's control or code for actually playing the media.
One option I was thinking was to just control an existing media player externally. So for example you may browse for a video to play in my application, and then when you hit play it would fire up VideoLAN or some other popular video player.
However, I was wondering if there was an easy way to play video inside a .NET application. I'm looking for something that is capable of playing a wide variety of formats such as MKV files, and DVD ISOs. I'm more experience with WinForms, but was also thinking about using this project as an opportunity to learn WPF.
i've spent many years looking at playing video under wpf.
The short answer
There is no easy way to guarantee to be able to play a variety of formats under wpf ( mkv,dvd etc etc ) or under windows for that matter.
the long answer
If you are looking just to run this at home and not release it, install all the codecs you need and most of the formats will run via mediaelement in wpf.
Getting all the codecs to cooperate can sometimes be frustrating.
Now moving into slightly harder territory.
if you want to play DVD then you need to replace mediaelement with wpfmediakit
http://wpfmediakit.codeplex.com/
wpfmediakit gives a base library to get access to the low level directshow functionality.
There is already a code base for playing DVDs based on wpfmediakit.
Now moving onto the very hard territory.
if you want to distribute your application and have users be able to "just watch" most/all media formats means you need to be able to completely control their codecs, which generally means distributing the codecs with your package and building the directshow filter graph in code rather than let windows build it.
The easiest way is to use the existing .Net hooks to Microsoft's standard MediaPlayer:
http://msdn.microsoft.com/en-us/library/system.windows.media.mediaplayer.aspx
http://msdn.microsoft.com/en-us/library/windows/desktop/dd562851%28v=vs.85%29.aspx
was trying myself a while ago for something to play media in winforms, and found out there is vlc wrappers for .Net, dunno how good they are as i gave up, but you can try
here is one them:
http://vlcdotnet.codeplex.com/
Thanks for all the great answers. But just found out that VLC can actually be controlled through HTTP. So I think I'm just going to use that to point an instance of VLC running with the HTTP interface at whatever file I want to play.

Snapping pictures from Windows C# Canon SDK vs PTP or MTP

I am hoping to receive some general guidance on accomplishing a seemingly simple goal. I have a DSLR camera (Canon EOS 50D) and need to write an application that will tell the camera to take a picture. I also need to transfer the picture to the computer and possibly delete it from the camera's storage. A bonus would be to get a live preview from the camera in my application. My environment will be Windows (either XP Pro or Vista Enterprise) and .Net 3.5 (C#).
I have done some research and found a couple of options. One I know will work, but limits me to using only Canon cameras in the future. I have found and downloaded an SDK from Canon that provides a lot of this functionality. I've looked over the SDK and while it's extensive and written in C it does have C# wrappers that will speed up development a bit.
Another option I've found is called Windows Portable Devices. Apparently, it is an API that will talk to devices that implement PTP and MTP standards. It is COM based and as far as I can tell it has no .Net wrappers. This is not however a show stopper. I could P/Invoke the functionality I need or write a Managed C++ DLL to use in my application to talk to the camera.
I am looking for anyone with experience with WPD to give me pointers. I've perused the documentation and seen references to transferring images and deleting images. I have not, however, seen mention of commands to take a picture, get a preview image, or say focus/auto-focus.
The WPD api provides the command WPD_COMMAND_STILL_IMAGE_CAPTURE_INITIATE
I am not sure whether your camera supports it but it should be simple enough to find out. If you can get the "wpdinfo" tool from the driver development kit and start it with your camera connected then send it a WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_COMMANDS command and see if it supports the still image capture command. IF so then you could give that a try.
The comment from TallGanglyGuy is incorrect. ptp does allow you to trigger new images and change exposure, etc. Some cameras have firmware that only exposes some of the ptp commands.
PTP supports common device controls, such as taking a picture, so that
the user could take advantage of the PC/camera combination in new and
different ways again, without requiring additional software.
quoted from http://msdn.microsoft.com/en-us/windows/hardware/gg463507.aspx#EXC
try my Eos Framework: https://github.com/esskar/Canon.Eos.Framework
IMHO it's a better alternative then the .cs file that comes with the SDK.
PTP and MTP are both protocols for transferring files from a digital still camera (DSC). The protocols provide no functionality for triggering new images, or setting exposure control. You will be stuck using the camera specific SDK. If you want multiple vendor support Nikon has an SDK that provides similar support as the Canon SDK for their cameras.
More info on PTP and MTP can be found here:
http://en.wikipedia.org/wiki/Picture_Transfer_Protocol
and
http://en.wikipedia.org/wiki/Media_Transfer_Protocol
EDIT
I forgot to mention that WIA may be interesting to you, assuming your camera's driver provides a WIA interface.
This is really generic, but it may help.
I had to write an application that used two different bar code scanners from two different vendors with different SDK's. I created an interface that defined the methods and events that I wanted to code for, and then wrote adapter classes that implemented my interface.
This worked well in my case, and switching from one to the other was pretty seamless. If you took the same approach, you wouldn't be totally dependent upon one SDK.

Can Adobe Air be the best solution for a Mac and iPhone application?

We are at a crossroad as what development tool to use for our application. We do not know if
we will go for Adobe Air or use the traditional road which is Objective-C and Cocoa. The software is similar to www.riffmasterpro in functionality. Is Air the best solution here?
Well, firstly, Flash isn't supported on iPhone so there is no Air platform for iPhone (at least, none that I know of - correct me if I'm wrong).
Secondly, native Objective-C applications on Mac will always surpass Air applications with regards to how well they tie into the OS. An example of this is TweetDeck. It's an amazing application but it just doesn't feel like a Mac app (no meaningful menus, no growl integration, etc...). Mac users are typically very specific with regards to how their apps behave.
I would advise that if you want to write Mac applications (and iPhone applications) to rather stick with Objective-C.
If your primary concern is cross-platform (with the exception of iPhone) then Air is an option worth considering.
If you're looking to build an app solely for the Mac/iPhone platform, I would suggest using Objective-C instead. Adobe AIR's strength is that it can be installed and used cross-platform with little problem.
One of the downsides of that, though, is that performance will never be as good as something that ties directly into the operation system.
problem of using middle frameworks is that you will never have the potential of the hardware, in other worlds you will not be able to use any feature that Mac/Windows can give to you by the hardware, you wll always be attached to what the framework will give to you and hope that you can do everything that you need...
specially in your music application.
regarding the Adobe Air framework, it is a good idea to cover both Linux, Mac and Windows computers but you will not be able to run it under the iPhone because there is no Adobe Flash supported... Adobe is making a flash player for the iPhone, but I do believe that will ot support Air, at least by the near future.
For the iPhone you can build a Web Application or a SDK Application, the last on, and if you will use SDK 3.0, you will find plenty of good things to use it to, but you need to develop a full application from sctrath.

Where can I get started writing a media server in C# like PlayOn

Where can I get started writing a media server in C# like PlayOn
http://www.themediamall.com/playon
UPDATE:
I have learned that PlayOn is a is a DLNA/UPnP media server but I am still looking for C# example implementation of this type of server. I am placing a bounty and will award it if you can point me to some sample code that I can use to server photos and/or video content to a media client like XBOX 360, Playstation 3, Media Center, or Media Center Extenders
After more research I have learned that PlayOn is a is a DLNA/UPnP media server. There is not lots of information on it but there are a few. If anyone can reference an example that would be awesome.
here some links I found after discovering I was looking for DLNA/UPnP
Creating a DLNA server/service in VB.NET
C# UPNP/DNLA Media Server Library
This question may also help point you in the right direction.
Specifically the accepted answer point to the Platinum UPnP library. Whilst it's a C++ library, it looks promising and i'm sure it could be integrated with a C# solution or at least give you ideas for your own implementation.
My recommendation would be not to write you own server for the reason that Windows Media Services - which is a great FREE streaming server from Microsoft is available already. It focuses on the heavy lifting of how do you stream, formats etc... is well documented and understood which makes deployment easier. Your focus could then be on the areas it sucks at, which is client front end - i.e. a nice web or Silverlight interface, maybe an RSS feed of videos. This shouldn't be hard as the server API and how to write code against it is well documented.
XNA Studio?
Perhaps have a look at the codebase for Media Portal
Here is the developer page
http://www.team-mediaportal.com/contribute_to_mediaportal.html
There is also a media sharing library on code plex that might help
http://www.codeplex.com/blueportal
Here's a couple of things to look into:
/whsUpnp360
UPnP MediaServer using Intels SDK for Windows Home Server and Xbox 360 (written in C#)
http://www.mperfect.net/whsUpnp360/
UPnP library for C#?
http://bytes.com/groups/net-c/741142-upnp-library-c

Categories