Wrap InputStream in a File (for MediaPortal TVserver client in XBMC)
#16
Gamester17: Yes that is what I initially based my design on - the myth:// code.

spiff: Yep that's what I'm doing. I tried manually loading the rtsp url (made a .strm file with the URL in it), and it turns out it's still caching. The xbox version does not seem to cache rtsp streams, yet the linux port does. I am not sure why yet.
Reply
#17
Thumbs Up 
http://forum.team-mediaportal.com/genera...post277808
EvilDude Wrote:I have a patch (for xbmc linux at least, haven't tried with the xbox port but I'm hoping it works fine)
http://pastebin.com/m1bc4159b

It adds very basic native support to XBMC. The Python script is probably still better at this point Tongue However, this will hopefully eventually let me do channel+/- directly while watching. The python script is still faster, as it doesn't cache whereas this attempts to cache.

Developers: is it possible to switch channel without new graph, basically having to close the last stream etc? Or at least, is it possible to somehow get a change channel thing that will keep the stream going (with blank frames), as it would be much faster than closing and reopening the stream after changing a channel.

@EvilDude, patch would be more than welcomed, please see:
http://wiki.xbmc.org/?title=HOW-TO_submit_a_patch
http://wiki.xbmc.org/?title=Appendix_D:_...ment_Notes

Submitting the patch for review is the first step to get it accepted to the SVN

Nod
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#18
Ok thanks, posted it here
https://sourceforge.net/tracker/index.ph...tid=581840
Reply
#19
Hi, I'm happy that someone is working on an integration of MP TV Server & XBMC, both software are great!
is the patch applied to the svn? if so, EvilDude, can u please describe how do I work with that?
I'm a programmer myself and I would be happy to assist improving the integration between MPTVServer & XBMC.

leo
Reply
#20
leo2 Wrote:is the patch applied to the svn?
No, elupus will need to review it but he is currently away on holiday, and spiff already asked for some changes:
Quote:not a real review, just some stuff i noticed right away..

Index: xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp
===================================================================
--- xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp (revision 13756)
+++ xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp (working copy)
@@ -259,6 +260,25 @@
[...]
+ if( m_dllAvFormat.av_open_input_file(&m_pFormatContext,
rtspUrl.c_str(), iformat, FFMPEG_FILE_BUFFER_SIZE, NULL) < 0 )
+ {
+ CLog::Log(LOGDEBUG, "Error, could not open tv server file %s",
strFile.c_str());
+ Dispose();
+ return false;
+ }
+ CLog::Log(LOGERROR, "SUCCESS??!?\n");
+
+ }
this block is shared with the stream_type_ffmpeg one

else
{
g_urltimeout = 0;
@@ -318,6 +338,7 @@

// read data using avformat's buffers
pd.buf_size = m_dllAvFormat.get_buffer(m_ioContext, pd.buf,
sizeof(probe_buffer));
+
unrelated cosmetics

if (pd.buf_size == 0)
{
CLog::Log(LOGERROR, "%s - error reading from input stream, %s",
__FUNCTION__, strFile.c_str());
Index: xbmc/cores/dvdplayer/DVDInputStreams/DVDFactoryInputStream.cpp
===================================================================
---
xbmc/cores/dvdplayer/DVDInputStreams/DVDFactoryInputStream.cpp (revision
13756)
+++
xbmc/cores/dvdplayer/DVDInputStreams/DVDFactoryInputStream.cpp (working
copy)
@@ -52,7 +54,10 @@
else if(file.substr(0, 7) == "myth://"
|| file.substr(0, 8) == "cmyth://"
|| file.substr(0, 8) == "gmyth://")
+ //|| file.substr(0, 10) == "tvserver://")
?

Index: xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamFile.cpp
===================================================================
--- xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamFile.cpp (revision
13756)
+++ xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamFile.cpp (working
copy)
@@ -54,6 +54,7 @@
if( CFileItem(strFile, false).IsInternetStream() )
flags |= READ_CACHED;

+ CLog::Log(LOGERROR, "ABOUT TO OPEN A FILE!! file is %s", strFile);
please remove

#define DVDSTREAM_BLOCK_SIZE_FILE (2048 * 16)
Index: xbmc/cores/dvdplayer/DVDInputStreams/TVServerFile.cpp
===================================================================
--- xbmc/cores/dvdplayer/DVDInputStreams/TVServerFile.cpp (revision 0)
+++ xbmc/cores/dvdplayer/DVDInputStreams/TVServerFile.cpp (revision 0)
@@ -0,0 +1,256 @@
[..]
+ if(nret) return false;
separate line please

+ CStdString result = c.StartTimeshift(channelId);
+ CLog::Log(LOGERROR, "Start timeshift returned %s", result.c_str());
+ c.Disconnect();
+
+ if(result.substr(0, 7) == "[ERROR]") return false;
ditto
+ rtspFile = new CDVDInputStreamFFmpeg();
+ if(!rtspFile) return false;
ditto

+ rtspFileUrl = result;
+ CLog::Log(LOGERROR, "WE HAVE SUCCESSFULLY MADE AN INPUT STREAM!!\n");
+
+
+ bool openFile = rtspFile->Open(result,"application/rtsl");
+ CLog::Log(LOGERROR, "Open file result %d\n", openFile);
+
+
+ return openFile;
+}
+


+
+
+bool CTVServerFile::Open(const char* strFile, const std:Confusedtring
&content){
braces on separate lines please. everywhere

+const CStdString CTVServerFile::GetRTSPStream()
+{
+ return this->rtspFileUrl;
+}
+
+
+void CTVServerFile::Close()
+{
+ if(rtspFile) rtspFile->Close();

separate

+ /*
+ if(!m_dll)
+ return;
+
+ if(m_program)
+ {
+ m_dll->ref_release(m_program);
+ m_program = NULL;
+ }
+ if(m_recorder)
+ {
+ m_dll->recorder_stop_livetv(m_recorder);
+ m_dll->ref_release(m_recorder);
+ m_recorder = NULL;
+ }
+ if(m_file)
+ {
+ m_dll->ref_release(m_file);
+ m_file = NULL;
+ }
+ if(m_session)
+ {
+ m_session->SetListener(NULL);
+ CCMythSession::ReleaseSession(m_session);
+ m_session = NULL;
+ }
+ */

remove. no new commented code
+}
+
+CTVServerFile::CTVServerFile() :
CDVDInputStream(DVDSTREAM_TYPE_TVSERVER)
+{
+
+ rtspFile = NULL;
+
+ CLog::Log(LOGERROR, "CTVServerFILE!!!!!");
remove. in general get rid of these or atleast put them at debug level
+}
+
+CTVServerFile::~CTVServerFile()
+{
+ if (rtspFile) rtspFile->Close();
ndex: xbmc/cores/dvdplayer/DVDInputStreams/TVServerFile.h
===================================================================
--- xbmc/cores/dvdplayer/DVDInputStreams/TVServerFile.h (revision 0)
+++ xbmc/cores/dvdplayer/DVDInputStreams/TVServerFile.h (revision 0)
@@ -0,0 +1,58 @@
[...]
+using namespace XFILE;

big no. no using of namespaces in headers, it means all code after the
inclusion of this header is using it.

Index: xbmc/FileSystem/ILiveTV.h
===================================================================
--- xbmc/FileSystem/ILiveTV.h (revision 13756)
+++ xbmc/FileSystem/ILiveTV.h (working copy)
@@ -1,3 +1,6 @@
+#ifndef __I_LIVETV__H__
+#define __I_LIVETV__H__
+

identifiers starting with _ is reserved for the compiler
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#21
Gamester17 Wrote:No, elupus will need to review it but he is currently away on holiday, and spiff already asked for some changes:
Thanks, I can't wait to use this feature...
Reply
#22
I want to make the changes but unfortunately xbmc for osx does not compile for me. I am waiting for it to compile, and once it does, I'll make the changes to the patch.
Reply
#23
Ok, installed linux got it all compiled on linux (gave up on osx, too much effort).

Now - the page I want,
https://sourceforge.net/tracker/index.ph...tid=581840
is not accessible anymore!

I made some fixes to the patch - it is a lot cleaner now, but I would like to look at the rest of the feedback from spiff, which I can't read. Is there anyway to get to that page?
Reply
#24
We've moved to trac (trac.xbmc.org).

http://trac.xbmc.org/ticket/4265

Sadly it has butched the comments.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#25
Thanks for that, I've uploaded a new patch.

trac is a lot nicer though Smile
Reply
#26
What about this?
Any news?
Even without EPG this patch should be applied. This as other means of TV viewing have been put into "future" milestone. I there a roadmap?
Reply
#27
Well last i looked at the patch it tended to be quite intrustive. And it doesn't apply to current svn anymore. Could somebody update it if it's still valid
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#28
Sorry I haven't updated it - I kind of stopped for now, waiting for the PVR interface.

I decided that the python script works quite well for now, so have focused on that side rather than integrating it into XBMC directly. The python script lets you watch live tv (shows EPG info for current / next shows) and lets you watch recorded shows.
Reply
#29
That's really good news, absolutely, but don't hold your breath waiting PVR Interface, there is no one responsible for that.
Reply
#30
Noone responsible for that? There's a separate branch in SVN that alcoheca is working on..
Reply

Logout Mark Read Team Forum Stats Members Help
Wrap InputStream in a File (for MediaPortal TVserver client in XBMC)0