How can I use PARTS of Mediaportal? (1 Viewer)

Maephisto

Portal Member
May 17, 2007
5
0
Home Country
Italy Italy
Hi to everyone.

I've tried Mediaportal and it looks wonderful.

My question is about extracting some part of the source code: I have to create an application to view DVB-T channels. Reading the source code of Mediaportal I found g_Player so I thought "wow, everything it has been already done!". Apparently I was wrong :( The thing is that, if I want to use g_Player, I have to include many classes and use many methods to initialize the enviromente for my application. I don't want to create a plugin (I managed to create it reading the tutorial about plugin development), but (let's say) just a simple Form with one button to view a single DVB-T channel.

The main method, after reading some stuff from registry and things like that, creates a MediaPortalApp instance, that extends D3DApp. How can I create a new solution that can use this classes? My idea was to create a simple Form which extends D3DApp (like MediaPortalApp) and do things *similar* to MediaPortalApp.

Is there a way to get some documentation for MediaPortal, like diagrams and examples? Or should I dig the source code to understand every single feature of this complex (yet beautiful) program?

Thx to everyone!
 

Flipit

Portal Pro
February 19, 2005
100
0
Hi,

If your just after a simple form, take a look at the DirectShowLib Samples, the BDA sample is the one you want. It shows you how to setup a BDA-T,S,C graph via C# and submit tuning requests.

You'll need to add something to map logical channels to PIDs but that is hard, you can use MP for inspiration.

Flipit
 

Maephisto

Portal Member
May 17, 2007
5
0
Home Country
Italy Italy
So you're suggesting me to learn Directshow enviroment. Ok, this may be a solution but I believe it's too long: if I were able to extract the right parts from MediaPortal source code, I could create the prototype I need.

Is there a way to embed MediaPortal in my application? I tried to create a MediaPortalApp instance and showing it through .show() method (since MediaPortalApp is a Form) but the form appears empty. I was even thinking to create a plugin for MediaPortal that, with .NET Remoting, could let my application send some commands to MediaPortal, like "switch on tv", "switch off tv" and so on.

The thing is that code is not documented :mad: and it's not easy to understand where are the things I need.
 

Maephisto

Portal Member
May 17, 2007
5
0
Home Country
Italy Italy
thank you for your help: I managed to create the form I needed. I'll be back for other questions about volume, tuning and so on... I'm beginning to understand a little how MediaPortal works!
 

diehard2

Retired Team Member
  • Premium Supporter
  • April 22, 2006
    518
    28
    Chicago
    Home Country
    United States of America United States of America
    From someone who knows DirectShow, it will be quite difficult to write an app that does what you want without understanding the DirectShow interfaces. You don't need to be a COM expert, but a basic understanding will sure help.
     

    Maephisto

    Portal Member
    May 17, 2007
    5
    0
    Home Country
    Italy Italy
    Hi, I'm back with other questions. Reading the BDA Sample in DirectshowLib I managed to create an application that shows tv in a simple form. Now I need to put OSD (on screen display) on my video. I use VideoMixingRenderer9 and reading its features I've understood that it should be easy to add text or images on a video. On MSDN there is a sample using VMR9 and IVMRMixerBitmap9 methods like GetAlphaBitmapParameters and so on... but in DirectshowLib DxText sample it is shown how to do the same thing with SampleGrabber filter. Two different approaches to obtain a similar result. Now, my questions:

    1. can I use SimpleGrabber filter over a live video like TV?
    2. in the sample about IVMRMixerBitmap9 methods there are instructions like GetDC or CreateCompatibleDC (I believe they belong to GDI) and all the code is written in C++: how can I turn the code in C# language? Do I have to convert all the required interfaces? How can I know what interfaces are already implemented by DirectshowLib?

    Thx in advance
     

    Users who are viewing this thread

    Top Bottom