DVDDemuxPVRClient Question
#1
I'm working on a PVR addon that might have to handle its own demuxing, but I have a few questions about how it all happens.

I set bHandlesDemuxing to true and from that I expect the DVDDemuxFactory to make the DVDDemuxPVRClient, which it does. However, after it's created, the call to Open is made and I can't get a handle on the expected order of operations here.

The Abort() is called, but on the first channel loaded, this function shouldn't have anything to perform, correct?

The next function that does something that will call into the addon is RequestStreams() and the first call from there into the addon is GetStreamProperties(). At what point should I have opened my input and parsed out the streams?

I feel like I'm missing something obvious, but I've looked into it long enough to where my frustration has overtaken my pride. Confused

Thanks for any help!
Reply
#2
First CDVDInputStreamPVRManager opens the stream, the connection to the backend. The backed starts parsing. At the time CDVDDemuxPVRClient::Open is called it is not guaranteed that your streams are ready, hence RequestStreams may return empty. You have to signal DMX_SPECIALID_STREAMCHANGE every time there is a change. This may be the number of streams or any change in stream properties.
Reply
#3
Ahhh, somehow I was missing that the call to OpenLiveStream had already happened. Yeah, missed something a bit obvious. Thanks for the reply.
Reply
#4
Got some more questions if you don't mind. Big Grin

If I set bHandlesDemuxing to false, what would be the result of sending the DMX_SPECIALID_STREAMCHANGE in the middle of playback? Does xbmc reload all the streams (maybe even reload the file header?) and continue playback at the current position?

I guess what I'm trying to get ahold of and it doesn't look exposed to the addons is the ffmpeg instance associated with the playback if I choose to not handle the demuxing on my own. I'd like to tinker with some values during playback, but if I can't I would need to be able to reload some things from the file without interrupting playback. If that's not doable, it looks like bHandlesDemuxing has to be true for me...
Reply
#5
If you set bHandlesDemuxing to false, you can't send DMX_SPECIALID_STREAMCHANGE because ffmpeg does the parsing.

What do you want to reload? Currently ffmpeg demuxer recognizes changes in stream parameters like audio changes from 5.1 to stereo. This is signaled to player which can reconfigure audio. After we have merged this: https://github.com/xbmc/xbmc/pull/1757, ffmpeg will also detect PMT changes, this is i.e. an audio or subtitle stream got added or removed. In such a case ffmpeg will send DMX_SPECIALID_STREAMCHANGE by itself.
Reply
#6
Well, the problem I've run into is that ffmpeg doesn't handle .wtv files properly when the metadata WM/MediaIsLive is true. I was hoping to be able to skirt that by reloading the header when the end of the stream was reached (according to the then-current header). I'd reload the header, keep the stream reading at the current time, and ffmpeg would continue reading again until ffmpeg parsed to the new end of stream according to the reloaded header, rinse, and repeat.

It looks like the fix should be in ffmpeg for live files to be honest, but I didn't want to touch it if I didn't have to. I'll look into that, it's the more appropriate place for the fix I believe.
Reply

Logout Mark Read Team Forum Stats Members Help
DVDDemuxPVRClient Question0